X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Ffsm.h;h=50f75e69a2741880890f32020dcd8b202cf34af4;hb=4f3e40659fcccce45068473ae94cfead18260c77;hp=75a36d52fe94e9172a0578ef5491a06e2fb26344;hpb=b5599f6001d9b024b3a572ab62c92027d94f052f;p=ppp.git diff --git a/pppd/fsm.h b/pppd/fsm.h index 75a36d5..50f75e6 100644 --- a/pppd/fsm.h +++ b/pppd/fsm.h @@ -41,13 +41,20 @@ * * $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $ */ +#ifndef PPP_FSM_H +#define PPP_FSM_H + +#include "pppdconf.h" + +#ifdef __cplusplus +extern "C" { +#endif /* * Packet header = Code, id, length. */ #define HEADERLEN 4 - /* * CP (LCP, IPCP, etc.) codes. */ @@ -68,9 +75,9 @@ typedef struct fsm { int protocol; /* Data Link Layer Protocol field value */ int state; /* State */ int flags; /* Contains option bits */ - u_char id; /* Current id */ - u_char reqid; /* Current request id */ - u_char seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + unsigned char id; /* Current id */ + unsigned char reqid; /* Current request id */ + unsigned char seen_ack; /* Have received valid Ack/Nak/Rej to Req */ int timeouttime; /* Timeout time in milliseconds */ int maxconfreqtransmits; /* Maximum Configure-Request transmissions */ int retransmits; /* Number of retransmissions left */ @@ -88,15 +95,15 @@ typedef struct fsm_callbacks { void (*resetci)(fsm *); /* Reset our Configuration Information */ int (*cilen)(fsm *); /* Length of our Configuration Information */ void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); + (fsm *, unsigned char *, int *); int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); + (fsm *, unsigned char *, int); int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); + (fsm *, unsigned char *, int, int); int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); + (fsm *, unsigned char *, int); int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); + (fsm *, unsigned char *, int *, int); void (*up)(fsm *); /* Called when fsm reaches OPENED state */ void (*down)(fsm *); /* Called when fsm leaves OPENED state */ void (*starting)(fsm *); /* Called when we want the lower layer */ @@ -104,7 +111,7 @@ typedef struct fsm_callbacks { void (*protreject)(int); /* Called when Protocol-Reject received */ void (*retransmit)(fsm *); /* Retransmission is necessary */ int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); + (fsm *, int, int, unsigned char *, int); char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; @@ -149,12 +156,18 @@ void fsm_lowerup (fsm *); void fsm_lowerdown (fsm *); void fsm_open (fsm *); void fsm_close (fsm *, char *); -void fsm_input (fsm *, u_char *, int); +void fsm_input (fsm *, unsigned char *, int); void fsm_protreject (fsm *); -void fsm_sdata (fsm *, int, int, u_char *, int); +void fsm_sdata (fsm *, int, int, unsigned char *, int); /* * Variables */ extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */ + +#ifdef __cplusplus +} +#endif + +#endif // PPP_FSM_H