From 83d1af558c8236383005372c97614d45a8da8f84 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Fri, 6 Feb 1998 02:24:29 +0000 Subject: Isolate fsm callback functions Derive {lcp,ipcp,ccp}state structures from struct fsm where convenient. Create bundle_Down() and remove LcpDown() --- usr.sbin/ppp/fsm.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'usr.sbin/ppp/fsm.h') diff --git a/usr.sbin/ppp/fsm.h b/usr.sbin/ppp/fsm.h index f7ec057cc72c..705dd75d27ae 100644 --- a/usr.sbin/ppp/fsm.h +++ b/usr.sbin/ppp/fsm.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: fsm.h,v 1.16.2.3 1998/01/31 02:48:18 brian Exp $ + * $Id: fsm.h,v 1.16.2.4 1998/02/02 19:32:06 brian Exp $ * * TODO: */ @@ -45,6 +45,20 @@ #define OPEN_PASSIVE -1 +struct fsm; + +struct fsm_callbacks { + void (*LayerUp) (struct fsm *); /* Layer is now up (tlu) */ + void (*LayerDown) (struct fsm *); /* About to come down (tld) */ + void (*LayerStart) (struct fsm *); /* Layer about to start up (tls) */ + void (*LayerFinish) (struct fsm *); /* Layer now down (tlf) */ + void (*InitRestartCounter) (struct fsm *); /* Set fsm timer load */ + void (*SendConfigReq) (struct fsm *); /* Send REQ please */ + void (*SendTerminateReq) (struct fsm *); /* Term REQ just sent */ + void (*SendTerminateAck) (struct fsm *); /* Send Term ACK please */ + void (*DecodeConfig) (struct fsm *, u_char *, int, int); +}; + struct fsm { const char *name; /* Name of protocol */ u_short proto; /* Protocol number */ @@ -76,16 +90,7 @@ struct fsm { /* Our high-level link */ struct bundle *bundle; - void (*LayerUp) (struct fsm *); /* Layer is now up (tlu) */ - void (*LayerDown) (struct fsm *); /* About to come down (tld) */ - void (*LayerStart) (struct fsm *); /* Layer about to start up (tls) */ - void (*LayerFinish) (struct fsm *); /* Layer now down (tlf) */ - void (*InitRestartCounter) (struct fsm *); /* Set fsm timer load */ - void (*SendConfigReq) (struct fsm *); /* Send REQ please */ - void (*SendTerminateReq) (struct fsm *); /* Term REQ just sent */ - void (*SendTerminateAck) (struct fsm *); /* Send Term ACK please */ - void (*DecodeConfig) (struct bundle *, u_char *, int, int); - /* Deal with incoming data */ + const struct fsm_callbacks *fn; }; struct fsmheader { -- cgit v1.3