diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-09 05:16:16 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-09 05:16:16 +0000 |
commit | 64417e98d530e581f6a3f3d432182d57fe5a76c3 (patch) | |
tree | 4edf9b44c631967ff6011430ad08f6b33df84336 /usr.sbin/pppd/fsm.c | |
parent | 8122b2be80fd8ce95da7de42c61a1f9a38f9107a (diff) |
ansi functions and prototypes
ok denis
Diffstat (limited to 'usr.sbin/pppd/fsm.c')
-rw-r--r-- | usr.sbin/pppd/fsm.c | 71 |
1 files changed, 17 insertions, 54 deletions
diff --git a/usr.sbin/pppd/fsm.c b/usr.sbin/pppd/fsm.c index 0a95205bf4d..891ac55226c 100644 --- a/usr.sbin/pppd/fsm.c +++ b/usr.sbin/pppd/fsm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsm.c,v 1.8 2009/10/27 23:59:53 deraadt Exp $ */ +/* $OpenBSD: fsm.c,v 1.9 2024/08/09 05:16:13 deraadt Exp $ */ /* * fsm.c - {Link, IP} Control Protocol Finite State Machine. @@ -76,8 +76,7 @@ int peer_mru[NUM_PPP]; * Initialize fsm state. */ void -fsm_init(f) - fsm *f; +fsm_init(fsm *f) { f->state = INITIAL; f->flags = 0; @@ -94,8 +93,7 @@ fsm_init(f) * fsm_lowerup - The lower layer is up. */ void -fsm_lowerup(f) - fsm *f; +fsm_lowerup(fsm *f) { switch( f->state ){ case INITIAL: @@ -125,8 +123,7 @@ fsm_lowerup(f) * Cancel all timeouts and inform upper layers. */ void -fsm_lowerdown(f) - fsm *f; +fsm_lowerdown(fsm *f) { switch( f->state ){ case CLOSED: @@ -169,8 +166,7 @@ fsm_lowerdown(f) * fsm_open - Link is allowed to come up. */ void -fsm_open(f) - fsm *f; +fsm_open(fsm *f) { switch( f->state ){ case INITIAL: @@ -210,9 +206,7 @@ fsm_open(f) * the CLOSED state. */ void -fsm_close(f, reason) - fsm *f; - char *reason; +fsm_close(fsm *f, char *reason) { f->term_reason = reason; f->term_reason_len = (reason == NULL? 0: strlen(reason)); @@ -253,8 +247,7 @@ fsm_close(f, reason) * fsm_timeout - Timeout expired. */ static void -fsm_timeout(arg) - void *arg; +fsm_timeout(void *arg) { fsm *f = (fsm *) arg; @@ -308,10 +301,7 @@ fsm_timeout(arg) * fsm_input - Input packet. */ void -fsm_input(f, inpacket, l) - fsm *f; - u_char *inpacket; - int l; +fsm_input(fsm *f, u_char *inpacket, int l) { u_char *inp; u_char code, id; @@ -390,11 +380,7 @@ fsm_input(f, inpacket, l) * fsm_rconfreq - Receive Configure-Request. */ static void -fsm_rconfreq(f, id, inp, len) - fsm *f; - u_char id; - u_char *inp; - int len; +fsm_rconfreq(fsm *f, int id, u_char *inp, int len) { int code, reject_if_disagree; @@ -461,11 +447,7 @@ fsm_rconfreq(f, id, inp, len) * fsm_rconfack - Receive Configure-Ack. */ static void -fsm_rconfack(f, id, inp, len) - fsm *f; - int id; - u_char *inp; - int len; +fsm_rconfack(fsm *f, int id, u_char *inp, int len) { FSMDEBUG((LOG_INFO, "fsm_rconfack(%s): Rcvd id %d.", PROTO_NAME(f), id)); @@ -523,11 +505,7 @@ fsm_rconfack(f, id, inp, len) * fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. */ static void -fsm_rconfnakrej(f, code, id, inp, len) - fsm *f; - int code, id; - u_char *inp; - int len; +fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { int (*proc)(fsm *, u_char *, int); int ret; @@ -585,11 +563,7 @@ fsm_rconfnakrej(f, code, id, inp, len) * fsm_rtermreq - Receive Terminate-Req. */ static void -fsm_rtermreq(f, id, p, len) - fsm *f; - int id; - u_char *p; - int len; +fsm_rtermreq(fsm *f, int id, u_char *p, int len) { char str[80]; @@ -624,8 +598,7 @@ fsm_rtermreq(f, id, p, len) * fsm_rtermack - Receive Terminate-Ack. */ static void -fsm_rtermack(f) - fsm *f; +fsm_rtermack(fsm *f) { FSMDEBUG((LOG_INFO, "fsm_rtermack(%s).", PROTO_NAME(f))); @@ -660,10 +633,7 @@ fsm_rtermack(f) * fsm_rcoderej - Receive an Code-Reject. */ static void -fsm_rcoderej(f, inp, len) - fsm *f; - u_char *inp; - int len; +fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; @@ -689,8 +659,7 @@ fsm_rcoderej(f, inp, len) * Treat this as a catastrophic error (RXJ-). */ void -fsm_protreject(f) - fsm *f; +fsm_protreject(fsm *f) { switch( f->state ){ case CLOSING: @@ -739,9 +708,7 @@ fsm_protreject(f) * fsm_sconfreq - Send a Configure-Request. */ static void -fsm_sconfreq(f, retransmit) - fsm *f; - int retransmit; +fsm_sconfreq(fsm *f, int retransmit) { u_char *outp; int cilen; @@ -792,11 +759,7 @@ fsm_sconfreq(f, retransmit) * Used for all packets sent to our peer by this module. */ void -fsm_sdata(f, code, id, data, datalen) - fsm *f; - u_char code, id; - u_char *data; - int datalen; +fsm_sdata(fsm *f, int code, int id, u_char *data, int datalen) { u_char *outp; int outlen; |