]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/fsm.h
mods to get it to compile better on linux
[ppp.git] / pppd / fsm.h
index dc1c179df88325390b5702a2978a948ace0bd8ad..1916342b638721a0439937290e29c64bfff55a6c 100644 (file)
@@ -16,7 +16,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Id: fsm.h,v 1.4 1994/09/21 06:47:37 paulus Exp $
+ * $Id: fsm.h,v 1.7 1997/04/30 05:52:37 paulus Exp $
  */
 
 /*
 
 
 /*
- * Each FSM is described by a fsm_callbacks and a fsm structure.
+ * Each FSM is described by an fsm structure and fsm callbacks.
  */
-typedef struct fsm_callbacks {
-    void (*resetci)();         /* Reset our Configuration Information */
-    int  (*cilen)();           /* Length of our Configuration Information */
-    void (*addci)();           /* Add our Configuration Information */
-    int  (*ackci)();           /* ACK our Configuration Information */
-    int  (*nakci)();           /* NAK our Configuration Information */
-    int  (*rejci)();           /* Reject our Configuration Information */
-    int  (*reqci)();           /* Request peer's Configuration Information */
-    void (*up)();              /* Called when fsm reaches OPENED state */
-    void (*down)();            /* Called when fsm leaves OPENED state */
-    void (*starting)();                /* Called when we want the lower layer */
-    void (*finished)();                /* Called when we don't want the lower layer */
-    void (*protreject)();      /* Called when Protocol-Reject received */
-    void (*retransmit)();      /* Retransmission is necessary */
-    int  (*extcode)();         /* Called when unknown code received */
-    char *proto_name;          /* String name for protocol (for messages) */
-} fsm_callbacks;
-
-
 typedef struct fsm {
     int unit;                  /* Interface unit number */
     int protocol;              /* Data Link Layer Protocol field value */
@@ -73,10 +54,45 @@ typedef struct fsm {
     int maxtermtransmits;      /* Maximum Terminate-Request transmissions */
     int nakloops;              /* Number of nak loops since last ack */
     int maxnakloops;           /* Maximum number of nak loops tolerated */
-    fsm_callbacks *callbacks;  /* Callback routines */
+    struct fsm_callbacks *callbacks;   /* Callback routines */
+    char *term_reason;         /* Reason for closing protocol */
+    int term_reason_len;       /* Length of term_reason */
 } fsm;
 
 
+typedef struct fsm_callbacks {
+    void (*resetci)            /* Reset our Configuration Information */
+               __P((fsm *));
+    int  (*cilen)              /* Length of our Configuration Information */
+               __P((fsm *));
+    void (*addci)              /* Add our Configuration Information */
+               __P((fsm *, u_char *, int *));
+    int  (*ackci)              /* ACK our Configuration Information */
+               __P((fsm *, u_char *, int));
+    int  (*nakci)              /* NAK our Configuration Information */
+               __P((fsm *, u_char *, int));
+    int  (*rejci)              /* Reject our Configuration Information */
+               __P((fsm *, u_char *, int));
+    int  (*reqci)              /* Request peer's Configuration Information */
+               __P((fsm *, u_char *, int *, int));
+    void (*up)                 /* Called when fsm reaches OPENED state */
+               __P((fsm *));
+    void (*down)               /* Called when fsm leaves OPENED state */
+               __P((fsm *));
+    void (*starting)           /* Called when we want the lower layer */
+               __P((fsm *));
+    void (*finished)           /* Called when we don't want the lower layer */
+               __P((fsm *));
+    void (*protreject)         /* Called when Protocol-Reject received */
+               __P((int));
+    void (*retransmit)         /* Retransmission is necessary */
+               __P((fsm *));
+    int  (*extcode)            /* Called when unknown code received */
+               __P((fsm *, int, int, u_char *, int));
+    char *proto_name;          /* String name for protocol (for messages) */
+} fsm_callbacks;
+
+
 /*
  * Link states.
  */
@@ -106,7 +122,7 @@ typedef struct fsm {
 #define DEFTIMEOUT     3       /* Timeout time in seconds */
 #define DEFMAXTERMREQS 2       /* Maximum Terminate-Request transmissions */
 #define DEFMAXCONFREQS 10      /* Maximum Configure-Request transmissions */
-#define DEFMAXNAKLOOPS 10      /* Maximum number of nak loops */
+#define DEFMAXNAKLOOPS       /* Maximum number of nak loops */
 
 
 /*
@@ -116,7 +132,7 @@ void fsm_init __P((fsm *));
 void fsm_lowerup __P((fsm *));
 void fsm_lowerdown __P((fsm *));
 void fsm_open __P((fsm *));
-void fsm_close __P((fsm *));
+void fsm_close __P((fsm *, char *));
 void fsm_input __P((fsm *, u_char *, int));
 void fsm_protreject __P((fsm *));
 void fsm_sdata __P((fsm *, int, int, u_char *, int));