diff options
| author | Alexander Barton <alex@barton.de> | 2010-10-11 16:54:49 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2010-10-11 16:54:49 +0200 |
| commit | a988bbc86aed404b7bcfdbceafc030ea4bc5ecab (patch) | |
| tree | d1d8bf2f1b844400279169ab651f23e6f1deb861 /src | |
| parent | 4226db873fa01e0c50a48fc8c96605e5420f5732 (diff) | |
| download | ngircd-a988bbc86aed404b7bcfdbceafc030ea4bc5ecab.tar.gz ngircd-a988bbc86aed404b7bcfdbceafc030ea4bc5ecab.zip | |
New configuration option "NoZeroConf" to disable ZeroConf registration
If ngIRCd is compiled to register its services using ZeroConf (e.g. using Howl, Avahi or on Mac OS X) this parameter can be used to disable service registration at runtime.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/conf.c | 7 | ||||
| -rw-r--r-- | src/ngircd/conf.h | 3 | ||||
| -rw-r--r-- | src/ngircd/rendezvous.c | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index acb40103..f8b470fa 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -338,6 +338,7 @@ Conf_Test( void ) printf(" NoDNS = %s\n", yesno_to_str(Conf_NoDNS)); printf(" NoIdent = %s\n", yesno_to_str(Conf_NoIdent)); printf(" NoPAM = %s\n", yesno_to_str(Conf_NoPAM)); + printf(" NoZeroConf = %s\n", yesno_to_str(Conf_NoZeroConf)); #ifdef WANT_IPV6 printf(" ConnectIPv4 = %s\n", yesno_to_str(Conf_ConnectIPv6)); @@ -587,6 +588,7 @@ Set_Defaults(bool InitServers) Conf_NoDNS = false; Conf_NoIdent = false; Conf_NoPAM = false; + Conf_NoZeroConf = false; Conf_Oper_Count = 0; Conf_Channel_Count = 0; @@ -1048,6 +1050,11 @@ Handle_GLOBAL( int Line, char *Var, char *Arg ) Conf_NoPAM = Check_ArgIsTrue(Arg); return; } + if(strcasecmp(Var, "NoZeroConf") == 0) { + /* don't register services using ZeroConf */ + Conf_NoZeroConf = Check_ArgIsTrue(Arg); + return; + } #ifdef WANT_IPV6 /* the default setting for all the WANT_IPV6 special options is 'true' */ if( strcasecmp( Var, "ConnectIPv6" ) == 0 ) { diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h index ff67dc79..47a499ae 100644 --- a/src/ngircd/conf.h +++ b/src/ngircd/conf.h @@ -152,6 +152,9 @@ GLOBAL bool Conf_NoIdent; /* Disable all usage of PAM, even when compiled with support for it */ GLOBAL bool Conf_NoPAM; +/* Disable service registration using "ZeroConf" */ +GLOBAL bool Conf_NoZeroConf; + /* * try to connect to remote systems using the ipv6 protocol, * if they have an ipv6 address? (default yes) diff --git a/src/ngircd/rendezvous.c b/src/ngircd/rendezvous.c index 7c106292..2d9ae699 100644 --- a/src/ngircd/rendezvous.c +++ b/src/ngircd/rendezvous.c @@ -144,12 +144,16 @@ GLOBAL void Rendezvous_Exit( void ) } /* Rendezvous_Exit */ +/** + * Register ZeroConf service + */ GLOBAL bool Rendezvous_Register( char *Name, char *Type, UINT16 Port ) { - /* Register new service */ - int i; + if (Conf_NoZeroConf) + return; + /* Search free port structure */ for( i = 0; i < MAX_RENDEZVOUS; i++ ) if( ! My_Rendezvous[i].Desc[0] ) break; if( i >= MAX_RENDEZVOUS ) |