]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
Large patch from Frank Cusack <fcusack@fcusack.com> to add proper
[ppp.git] / pppd / main.c
index a80b0a5a83f5aa0b79459352ecbaf1104b72e7d2..16231db75ead75a846022061d3a9a4d4c2395306 100644 (file)
@@ -17,7 +17,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: main.c,v 1.110 2002/01/14 14:25:10 dfs Exp $"
+#define RCSID  "$Id: main.c,v 1.112 2002/02/12 20:07:09 dfs Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
@@ -83,6 +83,7 @@ char hostname[MAXNAMELEN];    /* Our hostname */
 static char pidfilename[MAXPATHLEN];   /* name of pid file */
 static char linkpidfile[MAXPATHLEN];   /* name of linkname pid file */
 char ppp_devnam[MAXPATHLEN];   /* name of PPP tty (maybe ttypx) */
+char remote_number[MAXNAMELEN]; /* Remote telephone number, if available */
 uid_t uid;                     /* Our real user-id */
 struct notifier *pidchange = NULL;
 struct notifier *phasechange = NULL;
@@ -97,7 +98,8 @@ volatile int status;          /* exit status for pppd */
 int unsuccess;                 /* # unsuccessful connection attempts */
 int do_callback;               /* != 0 if we should do callback next */
 int doing_callback;            /* != 0 if we are doing callback */
-
+int ppp_session_number;                /* Session number, for channels with such a
+                                  concept (eg PPPoE) */
 #ifdef USE_TDB
 TDB_CONTEXT *pppdb;            /* database for storing status etc. */
 #endif
@@ -106,6 +108,8 @@ char db_key[32];
 
 int (*holdoff_hook) __P((void)) = NULL;
 int (*new_phase_hook) __P((int)) = NULL;
+void (*snoop_recv_hook) __P((unsigned char *p, int len)) = NULL;
+void (*snoop_send_hook) __P((unsigned char *p, int len)) = NULL;
 
 static int conn_running;       /* we have a [dis]connector running */
 static int devfd;              /* fd of underlying device */
@@ -966,6 +970,7 @@ get_input()
     }
 
     dump_packet("rcvd", p, len);
+    if (snoop_recv_hook) snoop_recv_hook(p, len);
 
     p += 2;                            /* Skip address and control */
     GETSHORT(protocol, p);