]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/rp-pppoe/plugin.c
Enable more verbose PPPoE plugin output
[ppp.git] / pppd / plugins / rp-pppoe / plugin.c
index bad8113c0ed6f73cb9fc93c84cb5d0b929819919..afb6b09108667ca2a8ba031dabb92a28b995d118 100644 (file)
@@ -22,7 +22,7 @@
 ***********************************************************************/
 
 static char const RCSID[] =
-"$Id: plugin.c,v 1.1 2001/12/14 02:55:20 mostrows Exp $";
+"$Id: plugin.c,v 1.3 2002/02/12 04:36:00 mostrows Exp $";
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
@@ -54,12 +54,15 @@ static char const RCSID[] =
 
 #define _PATH_ETHOPT         _ROOT_PATH "/etc/ppp/options."
 
+char pppd_version[] = VERSION;
+
 /* From sys-linux.c in pppd -- MUST FIX THIS! */
 extern int new_style_driver;
 
 static char *service = NULL;
 static char *acName = NULL;
 static char *existingSession = NULL;
+static int printACNames = 0;
 
 static int PPPoEDevnameHook(const char *name);
 static option_t Options[] = {
@@ -73,6 +76,8 @@ static option_t Options[] = {
       "Desired PPPoE access concentrator name" },
     { "rp_pppoe_sess",    o_string, &existingSession,
       "Attach to existing session (sessid:macaddr)" },
+    { "rp_pppoe_verbose", o_int, &printACNames,
+      "Be verbose about discovered access concentrators"},
     { NULL }
 };
 int (*OldDevnameHook)(const char *name) = NULL;
@@ -105,6 +110,7 @@ PPPOEInitDevice(void)
     conn->discoverySocket = -1;
     conn->sessionSocket = -1;
     conn->useHostUniq = 1;
+    conn->printACNames = printACNames;
     return 1;
 }
 
@@ -142,10 +148,8 @@ PPPOEConnectDevice(void)
        }
     }
 
-#ifdef HAVE_LICENSE
     /* Set PPPoE session-number for further consumption */
-    pppd_pppoe_session = ntohs(conn->session);
-#endif
+    ppp_session_number = ntohs(conn->session);
 
     /* Make the session socket */
     conn->sessionSocket = socket(AF_PPPOX, SOCK_STREAM, PX_PROTO_OE);
@@ -157,7 +161,7 @@ PPPOEConnectDevice(void)
     sp.sa_addr.pppoe.sid = conn->session;
     memcpy(sp.sa_addr.pppoe.dev, conn->ifName, IFNAMSIZ);
     memcpy(sp.sa_addr.pppoe.remote, conn->peerEth, ETH_ALEN);
-#ifdef HAVE_LICENSE
+
     /* Set remote_number for ServPoET */
     sprintf(remote_number, "%02X:%02X:%02X:%02X:%02X:%02X",
            (unsigned) conn->peerEth[0],
@@ -166,7 +170,6 @@ PPPOEConnectDevice(void)
            (unsigned) conn->peerEth[3],
            (unsigned) conn->peerEth[4],
            (unsigned) conn->peerEth[5]);
-#endif
 
     if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
                sizeof(struct sockaddr_pppox)) < 0) {