]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Use some conditionals to display some command line options.
authorVincent Bernat <bernat@luffy.cx>
Wed, 17 Mar 2010 12:43:58 +0000 (13:43 +0100)
committerVincent Bernat <bernat@luffy.cx>
Wed, 17 Mar 2010 12:46:49 +0000 (13:46 +0100)
src/lldpctl.c
src/lldpd.c

index 059b29dcb20f0bc99b87c1b3cb3f41bfc42f36d7..6a8b5c31f8e35cf82e6d7952dec8bb6bb22e35b7 100644 (file)
@@ -49,9 +49,11 @@ usage(void)
        fprintf(stderr, "\n");
 
        fprintf(stderr, "-d          Enable more debugging information.\n");
+#ifdef ENABLE_LLDPMED
        fprintf(stderr, "-L location Enable the transmission of LLDP-MED location TLV for the\n");
        fprintf(stderr, "            given interfaces. Can be repeated to enable the transmission\n");
        fprintf(stderr, "            of the location in several formats.\n");
+#endif
 
        fprintf(stderr, "\n");
 
index ae85a5bdc19500ccefe6ce30bf7ee6ba9f18701c..ebd9ce1ab208d14b0b3593c6f2105e3040831594 100644 (file)
@@ -107,24 +107,38 @@ usage(void)
        fprintf(stderr, "-i       Disable LLDP-MED inventory TLV transmission.\n");
        fprintf(stderr, "-k       Disable advertising of kernel release, version, machine.\n");
        fprintf(stderr, "-m IP    Specify the management address of this system.\n");
+#ifdef ENABLE_LLDPMED
        fprintf(stderr, "-M class Enable emission of LLDP-MED frame. 'class' should be one of:\n");
        fprintf(stderr, "             1 Generic Endpoint (Class I)\n");
        fprintf(stderr, "             2 Media Endpoint (Class II)\n");
        fprintf(stderr, "             3 Communication Device Endpoints (Class III)\n");
        fprintf(stderr, "             4 Network Connectivity Device\n");
+#endif
+#ifdef USE_SNMP
        fprintf(stderr, "-x       Enable SNMP subagent.\n");
+#endif
 #ifdef ENABLE_LISTENVLAN
        fprintf(stderr, "-v       Listen on VLAN as well.\n");
 #endif
        fprintf(stderr, "\n");
 
-       fprintf(stderr, "Protocol support. (Disabled by default)\n");
+#if defined ENABLE_CDP || defined ENABLE_EDP || defined ENABLE_FDP || defined ENABLE_SONMP
+       fprintf(stderr, "Additional protocol support.\n");
+#ifdef ENABLE_CDP
        fprintf(stderr, "-c       Enable the support of CDP protocol. (Cisco)\n");
+#endif
+#ifdef ENABLE_EDP
        fprintf(stderr, "-e       Enable the support of EDP protocol. (Extreme)\n");
+#endif
+#ifdef ENABLE_FDP
        fprintf(stderr, "-f       Enable the support of FDP protocol. (Foundry)\n");
+#endif
+#ifdef ENABLE_SONMP
        fprintf(stderr, "-s       Enable the support of SONMP protocol. (Nortel)\n");
+#endif
 
        fprintf(stderr, "\n");
+#endif
 
        fprintf(stderr, "see manual page lldpd(8) for more information\n");
        exit(1);