X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fpppoe-discovery.c;fp=pppd%2Fplugins%2Fpppoe%2Fpppoe-discovery.c;h=6f01790f1bc11d24ca891fb6f43761561bb88b29;hb=a352af45cf46af5de0c2b2377f0ca8e33776ad6c;hp=e41d2863cb9bafe0e85eb321f8bd7421ad91c758;hpb=4fb319056f168bb8379865b91b4fd3e1ada73f1e;p=ppp.git diff --git a/pppd/plugins/pppoe/pppoe-discovery.c b/pppd/plugins/pppoe/pppoe-discovery.c index e41d286..6f01790 100644 --- a/pppd/plugins/pppoe/pppoe-discovery.c +++ b/pppd/plugins/pppoe/pppoe-discovery.c @@ -45,6 +45,8 @@ #include #endif +int pppoe_verbose; + char *xstrdup(const char *s); void usage(void); @@ -375,7 +377,7 @@ parsePADOTags(UINT16_t type, UINT16_t len, unsigned char *data, switch(type) { case TAG_AC_NAME: pc->seenACName = 1; - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Access-Concentrator: %.*s\n", (int) len, data); } if (conn->acName && len == strlen(conn->acName) && @@ -385,7 +387,7 @@ parsePADOTags(UINT16_t type, UINT16_t len, unsigned char *data, break; case TAG_SERVICE_NAME: pc->seenServiceName = 1; - if (conn->printACNames && len > 0) { + if (pppoe_verbose >= 1 && len > 0) { printf(" Service-Name: %.*s\n", (int) len, data); } if (conn->serviceName && len == strlen(conn->serviceName) && @@ -394,7 +396,7 @@ parsePADOTags(UINT16_t type, UINT16_t len, unsigned char *data, } break; case TAG_AC_COOKIE: - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Got a cookie:"); /* Print first 20 bytes of cookie */ for (i=0; icookie.payload, data, len); break; case TAG_RELAY_SESSION_ID: - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Got a Relay-ID:"); /* Print first 20 bytes of relay ID */ for (i=0; irelayId.payload, data, len); break; case TAG_SERVICE_NAME_ERROR: - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Got a Service-Name-Error tag: %.*s\n", (int) len, data); } break; case TAG_AC_SYSTEM_ERROR: - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Got a System-Error tag: %.*s\n", (int) len, data); } break; case TAG_GENERIC_ERROR: - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("Got a Generic-Error tag: %.*s\n", (int) len, data); } break; @@ -588,7 +590,7 @@ waitForPADO(PPPoEConnection *conn, int timeout) conn->numPADOs++; if (pc.acNameOK && pc.serviceNameOK) { memcpy(conn->peerEth, packet.ethHdr.h_source, ETH_ALEN); - if (conn->printACNames) { + if (pppoe_verbose >= 1) { printf("AC-Ethernet-Address: %02x:%02x:%02x:%02x:%02x:%02x\n", (unsigned) conn->peerEth[0], (unsigned) conn->peerEth[1], @@ -649,7 +651,7 @@ int main(int argc, char *argv[]) memset(conn, 0, sizeof(PPPoEConnection)); - conn->printACNames = 1; + pppoe_verbose = 1; conn->discoveryTimeout = PADI_TIMEOUT; conn->discoveryAttempts = MAX_PADI_ATTEMPTS; @@ -713,7 +715,7 @@ int main(int argc, char *argv[]) conn->ifName = xstrdup(optarg); break; case 'Q': - conn->printACNames = 0; + pppoe_verbose = 0; break; case 'V': case 'h':