summaryrefslogtreecommitdiffstats
path: root/usr.sbin/atm/scspd
diff options
context:
space:
mode:
authormks <mks@FreeBSD.org>1999-07-01 20:48:59 +0000
committermks <mks@FreeBSD.org>1999-07-01 20:48:59 +0000
commit7707e35f12ca77282d0d391e98bf0db7bf1b734c (patch)
tree4a3901b074c8e4dd2814e00f82d841659871f67a /usr.sbin/atm/scspd
parent22e38b45b20e68f38edb59cfdd12a4422d39c6c4 (diff)
downloadFreeBSD-src-7707e35f12ca77282d0d391e98bf0db7bf1b734c.zip
FreeBSD-src-7707e35f12ca77282d0d391e98bf0db7bf1b734c.tar.gz
Modify code to be -Wall'able.
PR: bin/11315
Diffstat (limited to 'usr.sbin/atm/scspd')
-rw-r--r--usr.sbin/atm/scspd/scsp_cafsm.c24
-rw-r--r--usr.sbin/atm/scspd/scsp_config.c25
-rw-r--r--usr.sbin/atm/scspd/scsp_config_lex.c26
-rw-r--r--usr.sbin/atm/scspd/scsp_config_parse.y32
-rw-r--r--usr.sbin/atm/scspd/scsp_hfsm.c23
-rw-r--r--usr.sbin/atm/scspd/scsp_if.c36
-rw-r--r--usr.sbin/atm/scspd/scsp_input.c45
-rw-r--r--usr.sbin/atm/scspd/scsp_log.c30
-rw-r--r--usr.sbin/atm/scspd/scsp_msg.c23
-rw-r--r--usr.sbin/atm/scspd/scsp_output.c36
-rw-r--r--usr.sbin/atm/scspd/scsp_print.c118
-rw-r--r--usr.sbin/atm/scspd/scsp_socket.c36
-rw-r--r--usr.sbin/atm/scspd/scsp_subr.c34
-rw-r--r--usr.sbin/atm/scspd/scsp_timer.c20
-rw-r--r--usr.sbin/atm/scspd/scsp_var.h33
-rw-r--r--usr.sbin/atm/scspd/scspd.c36
16 files changed, 295 insertions, 282 deletions
diff --git a/usr.sbin/atm/scspd/scsp_cafsm.c b/usr.sbin/atm/scspd/scsp_cafsm.c
index b9d2b51..6741dde 100644
--- a/usr.sbin/atm/scspd/scsp_cafsm.c
+++ b/usr.sbin/atm/scspd/scsp_cafsm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_cafsm.c,v 1.7 1998/08/21 18:08:23 johnc Exp $
+ * @(#) $Id: scsp_cafsm.c,v 1.1 1998/09/15 08:23:15 phk Exp $
*
*/
@@ -36,18 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_cafsm.c,v 1.7 1998/08/21 18:08:23 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -59,11 +49,21 @@ static char *RCSid = "@(#) $Id: scsp_cafsm.c,v 1.7 1998/08/21 18:08:23 johnc Exp
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_cafsm.c,v 1.1 1998/09/15 08:23:15 phk Exp $");
+#endif
+
/*
* CA FSM actions
@@ -741,7 +741,6 @@ scsp_ca_act_08(dcsp, p)
{
int rc;
Scsp_msg *msg = (Scsp_msg *)p;
- Scsp_csu_msg *csusp;
Scsp_csa *csap;
/*
@@ -1406,7 +1405,6 @@ scsp_ca_act_19(dcsp, p)
Scsp_dcs *dcsp;
void *p;
{
- int found, rc = 0;
Scsp_if_msg *cmsg = (Scsp_if_msg *)p;
Scsp_csa *csap;
diff --git a/usr.sbin/atm/scspd/scsp_config.c b/usr.sbin/atm/scspd/scsp_config.c
index 99eca7a..9d86b58 100644
--- a/usr.sbin/atm/scspd/scsp_config.c
+++ b/usr.sbin/atm/scspd/scsp_config.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_config.c,v 1.3 1998/08/13 20:11:14 johnc Exp $
+ * @(#) $Id: scsp_config.c,v 1.1 1998/09/15 08:23:15 phk Exp $
*
*/
@@ -35,18 +35,8 @@
*
*/
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_config.c,v 1.3 1998/08/13 20:11:14 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -58,11 +48,23 @@ static char *RCSid = "@(#) $Id: scsp_config.c,v 1.3 1998/08/13 20:11:14 johnc Ex
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_config.c,v 1.1 1998/09/15 08:23:15 phk Exp $");
+#endif
+
+
+extern int yyparse __P((void));
/*
* Global variables
@@ -72,7 +74,6 @@ Scsp_server *current_server;
Scsp_dcs *current_dcs;
-
/*
* Process the configuration file
*
diff --git a/usr.sbin/atm/scspd/scsp_config_lex.c b/usr.sbin/atm/scspd/scsp_config_lex.c
index 7b77ae6..c930d8c 100644
--- a/usr.sbin/atm/scspd/scsp_config_lex.c
+++ b/usr.sbin/atm/scspd/scsp_config_lex.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_config_lex.c,v 1.3 1998/08/13 20:11:14 johnc Exp $
+ * @(#) $Id: scsp_config_lex.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -35,18 +35,8 @@
*
*/
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_config_lex.c,v 1.3 1998/08/13 20:11:14 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -58,12 +48,24 @@ static char *RCSid = "@(#) $Id: scsp_config_lex.c,v 1.3 1998/08/13 20:11:14 john
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <ctype.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
#include "scsp_config_parse.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_config_lex.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
+
/*
* Global variables
*/
@@ -316,7 +318,7 @@ char_class(c)
} else if (c < 0 || !isascii(c)) {
class = CHAR_INVALID;
} else {
- class = class_tbl[c];
+ class = class_tbl[(int)c];
}
return(class);
diff --git a/usr.sbin/atm/scspd/scsp_config_parse.y b/usr.sbin/atm/scspd/scsp_config_parse.y
index 4c02de28..e5ef706 100644
--- a/usr.sbin/atm/scspd/scsp_config_parse.y
+++ b/usr.sbin/atm/scspd/scsp_config_parse.y
@@ -24,7 +24,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_config_parse.y,v 1.2 1998/07/24 17:12:14 johnc Exp $
+ * @(#) $Id: scsp_config_parse.y,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -37,18 +37,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_config_parse.y,v 1.2 1998/07/24 17:12:14 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -61,15 +51,26 @@ static char *RCSid = "@(#) $Id: scsp_config_parse.y,v 1.2 1998/07/24 17:12:14 jo
#include <netatm/atm_ioctl.h>
#include <libatm.h>
-#include "scsp_msg.h"
-#include "scsp_if.h"
-#include "scsp_var.h"
-
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
+#include "scsp_msg.h"
+#include "scsp_if.h"
+#include "scsp_var.h"
+
+#ifndef lint
+__RCSID("@(#) $Id: scsp_config_parse.y,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
+
+void yyerror __P((char *));
%}
@@ -403,6 +404,7 @@ parse_error(fmt, va_alist)
}
+void
yyerror(s)
char *s;
{
diff --git a/usr.sbin/atm/scspd/scsp_hfsm.c b/usr.sbin/atm/scspd/scsp_hfsm.c
index 2953804..8dae5a1 100644
--- a/usr.sbin/atm/scspd/scsp_hfsm.c
+++ b/usr.sbin/atm/scspd/scsp_hfsm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_hfsm.c,v 1.4 1998/07/16 15:59:25 johnc Exp $
+ * @(#) $Id: scsp_hfsm.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -36,17 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_hfsm.c,v 1.4 1998/07/16 15:59:25 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -57,11 +48,19 @@ static char *RCSid = "@(#) $Id: scsp_hfsm.c,v 1.4 1998/07/16 15:59:25 johnc Exp
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_hfsm.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
/*
* HELLO FSM actions
@@ -231,7 +230,6 @@ scsp_hello_act_02(dcsp, msg)
Scsp_msg *msg;
{
int rc;
- struct in_addr addr;
/*
* Cancel any current timers
@@ -488,7 +486,7 @@ scsp_hello_act_06(dcsp, msg)
Scsp_dcs *dcsp;
Scsp_msg *msg;
{
- int rc, rcv_found;
+ int rc = 0, rcv_found;
Scsp_id *ridp;
/*
@@ -552,7 +550,6 @@ scsp_hello_act_06(dcsp, msg)
/*
* Check the message for the local server's ID
*/
- rc = 0;
for (ridp = &msg->sc_hello->hello_mcp.rid,
rcv_found = 0;
ridp;
diff --git a/usr.sbin/atm/scspd/scsp_if.c b/usr.sbin/atm/scspd/scsp_if.c
index 1930990..e9ced0a 100644
--- a/usr.sbin/atm/scspd/scsp_if.c
+++ b/usr.sbin/atm/scspd/scsp_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_if.c,v 1.5 1998/08/13 20:11:14 johnc Exp $
+ * @(#) $Id: scsp_if.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -36,18 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_if.c,v 1.5 1998/08/13 20:11:14 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -59,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_if.c,v 1.5 1998/08/13 20:11:14 johnc Exp $"
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_if.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
/*
* SCSP client server interface FSM actions
@@ -335,7 +336,7 @@ scsp_client_act_05(dcsp, msg, cmsg)
Scsp_msg *msg;
Scsp_if_msg *cmsg;
{
- int i, rc;
+ int i;
Scsp_cse *csep, *ncsep;
/*
@@ -356,17 +357,6 @@ scsp_client_act_05(dcsp, msg, cmsg)
dcsp->sd_client_state = SCSP_CIFSM_SUM;
return(0);
-
-act_05_fail:
- for (csep = dcsp->sd_ca_csas; csep; csep = ncsep) {
- ncsep = csep->sc_next;
- UNLINK(csep, Scsp_cse, dcsp->sd_ca_csas, sc_next);
- UM_FREE(csep);
- }
-
- dcsp->sd_client_state = SCSP_CIFSM_NULL;
-
- return(rc);
}
diff --git a/usr.sbin/atm/scspd/scsp_input.c b/usr.sbin/atm/scspd/scsp_input.c
index 21d0a07..86cc3be 100644
--- a/usr.sbin/atm/scspd/scsp_input.c
+++ b/usr.sbin/atm/scspd/scsp_input.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_input.c,v 1.3 1998/08/13 20:11:15 johnc Exp $
+ * @(#) $Id: scsp_input.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -35,21 +35,12 @@
*
*/
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_input.c,v 1.3 1998/08/13 20:11:15 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
+#include <net/ethernet.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netatm/port.h>
#include <netatm/queue.h>
#include <netatm/atm.h>
@@ -58,11 +49,21 @@ static char *RCSid = "@(#) $Id: scsp_input.c,v 1.3 1998/08/13 20:11:15 johnc Exp
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_input.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
static int scsp_parse_atmarp __P((char *, int, Scsp_atmarp_csa **));
@@ -321,7 +322,7 @@ scsp_parse_mcp(buff, pdu_len, mcp)
Scsp_mcp *mcp;
{
int len;
- u_char *idp, *odp;
+ u_char *idp;
struct scsp_nmcp *smp;
/*
@@ -468,9 +469,9 @@ scsp_parse_csa(buff, pdu_len, csapp)
Scsp_csa **csapp;
{
int len;
- char *idp, *odp;
+ char *idp;
struct scsp_ncsa *scp;
- Scsp_csa *csap;
+ Scsp_csa *csap = NULL;
/*
* Check the record length
@@ -656,9 +657,9 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
int pdu_len;
Scsp_atmarp_csa **acspp;
{
- int i, len, proc_len;
+ int len, proc_len;
struct scsp_atmarp_ncsa *sacp;
- Scsp_atmarp_csa *acsp;
+ Scsp_atmarp_csa *acsp = NULL;
/*
* Initial packet verification
@@ -688,7 +689,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
*/
acsp->sa_sha.address_format = T_ATM_ABSENT;
acsp->sa_sha.address_length = 0;
- if (len = (sacp->sa_shtl & ARP_TL_LMASK)) {
+ if ((len = (sacp->sa_shtl & ARP_TL_LMASK)) != 0) {
if (sacp->sa_shtl & ARP_TL_E164) {
if (len > sizeof(Atm_addr_e164))
goto acs_invalid;
@@ -711,7 +712,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
*/
acsp->sa_ssa.address_format = T_ATM_ABSENT;
acsp->sa_ssa.address_length = 0;
- if (len = (sacp->sa_sstl & ARP_TL_LMASK)) {
+ if ((len = (sacp->sa_sstl & ARP_TL_LMASK)) != 0) {
if (((sacp->sa_sstl & ARP_TL_TMASK) != ARP_TL_NSAPA) ||
(len != sizeof(Atm_addr_nsap)))
goto acs_invalid;
@@ -727,7 +728,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
/*
* Verify/gather source IP address
*/
- if (len = sacp->sa_spln) {
+ if ((len = sacp->sa_spln) != 0) {
if (len != sizeof(struct in_addr))
goto acs_invalid;
if (pdu_len < proc_len + len)
@@ -743,7 +744,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
*/
acsp->sa_tha.address_format = T_ATM_ABSENT;
acsp->sa_tha.address_length = 0;
- if (len = (sacp->sa_thtl & ARP_TL_LMASK)) {
+ if ((len = (sacp->sa_thtl & ARP_TL_LMASK)) != 0) {
if (sacp->sa_thtl & ARP_TL_E164) {
if (len > sizeof(Atm_addr_e164))
goto acs_invalid;
@@ -766,7 +767,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
*/
acsp->sa_tsa.address_format = T_ATM_ABSENT;
acsp->sa_tsa.address_length = 0;
- if (len = (sacp->sa_tstl & ARP_TL_LMASK)) {
+ if ((len = (sacp->sa_tstl & ARP_TL_LMASK)) != 0) {
if (((sacp->sa_tstl & ARP_TL_TMASK) != ARP_TL_NSAPA) ||
(len != sizeof(Atm_addr_nsap)))
goto acs_invalid;
@@ -782,7 +783,7 @@ scsp_parse_atmarp(buff, pdu_len, acspp)
/*
* Verify/gather target IP address
*/
- if (len = sacp->sa_tpln) {
+ if ((len = sacp->sa_tpln) != 0) {
if (len != sizeof(struct in_addr))
goto acs_invalid;
if (pdu_len < proc_len + len)
diff --git a/usr.sbin/atm/scspd/scsp_log.c b/usr.sbin/atm/scspd/scsp_log.c
index 9088078..21f4222 100644
--- a/usr.sbin/atm/scspd/scsp_log.c
+++ b/usr.sbin/atm/scspd/scsp_log.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_log.c,v 1.2 1998/07/12 20:49:36 johnc Exp $
+ * @(#) $Id: scsp_log.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -36,18 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_log.c,v 1.2 1998/07/12 20:49:36 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -59,16 +49,26 @@ static char *RCSid = "@(#) $Id: scsp_log.c,v 1.2 1998/07/12 20:49:36 johnc Exp $
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
-#include "scsp_msg.h"
-#include "scsp_if.h"
-#include "scsp_var.h"
-
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
+#include "scsp_msg.h"
+#include "scsp_if.h"
+#include "scsp_var.h"
+
+#ifndef lint
+__RCSID("@(#) $Id: scsp_log.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
/*
diff --git a/usr.sbin/atm/scspd/scsp_msg.c b/usr.sbin/atm/scspd/scsp_msg.c
index bed2918..9db61ba 100644
--- a/usr.sbin/atm/scspd/scsp_msg.c
+++ b/usr.sbin/atm/scspd/scsp_msg.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_msg.c,v 1.6 1998/08/21 18:08:24 johnc Exp $
+ * @(#) $Id: scsp_msg.c,v 1.1 1998/09/15 08:23:16 phk Exp $
*
*/
@@ -36,18 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_msg.c,v 1.6 1998/08/21 18:08:24 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -59,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_msg.c,v 1.6 1998/08/21 18:08:24 johnc Exp $
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_msg.c,v 1.1 1998/09/15 08:23:16 phk Exp $");
+#endif
+
+
/*
* Copy CSAS records into a CA record
*
diff --git a/usr.sbin/atm/scspd/scsp_output.c b/usr.sbin/atm/scspd/scsp_output.c
index 10ee493..7f8f1cd 100644
--- a/usr.sbin/atm/scspd/scsp_output.c
+++ b/usr.sbin/atm/scspd/scsp_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_output.c,v 1.2 1998/07/12 20:49:45 johnc Exp $
+ * @(#) $Id: scsp_output.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -35,21 +35,12 @@
*
*/
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_output.c,v 1.2 1998/07/12 20:49:45 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
#include <sys/socket.h>
+#include <net/ethernet.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#include <netatm/port.h>
#include <netatm/queue.h>
#include <netatm/atm.h>
@@ -57,12 +48,23 @@ static char *RCSid = "@(#) $Id: scsp_output.c,v 1.2 1998/07/12 20:49:45 johnc Ex
#include <netatm/atm_sap.h>
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
-
+
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_output.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Put a long integer into the output buffer
@@ -140,7 +142,7 @@ scsp_format_mcp(mcp, buff)
char *buff;
{
int len;
- char *idp, *odp;
+ char *odp;
struct scsp_nmcp *smp;
/*
@@ -214,7 +216,6 @@ scsp_format_ext(exp, buff, blen)
char *buff;
int blen;
{
- int len;
struct scsp_next *sep;
/*
@@ -269,7 +270,7 @@ scsp_format_atmarp(acsp, buff)
char *buff;
{
char *cp;
- int len, pkt_len, rc;
+ int len, pkt_len;
struct scsp_atmarp_ncsa *sanp;
/*
@@ -432,7 +433,7 @@ scsp_format_csa(csap, buff)
char *buff;
{
int len = 0;
- char *idp, *odp;
+ char *odp;
struct scsp_ncsa *scp;
/*
@@ -643,9 +644,8 @@ scsp_format_hello(hp, buff, blen)
char *buff;
int blen;
{
- int i, len, proc_len;
+ int len, proc_len;
struct scsp_nhello *shp;
- Scsp_id *idp;
Scsp_id *ridp;
/*
diff --git a/usr.sbin/atm/scspd/scsp_print.c b/usr.sbin/atm/scspd/scsp_print.c
index 4655077..89b69a5 100644
--- a/usr.sbin/atm/scspd/scsp_print.c
+++ b/usr.sbin/atm/scspd/scsp_print.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_print.c,v 1.5 1998/08/13 20:11:16 johnc Exp $
+ * @(#) $Id: scsp_print.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -36,19 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_print.c,v 1.5 1998/08/13 20:11:16 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -60,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_print.c,v 1.5 1998/08/13 20:11:16 johnc Exp
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_print.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Indent string
@@ -418,8 +418,7 @@ print_scsp_id(fp, idp)
int i;
inc_indent();
- fprintf(fp, "%sNext: 0x%x\n", indent,
- (u_long)idp->next);
+ fprintf(fp, "%sNext: %p\n", indent, idp->next);
fprintf(fp, "%sLength: %d\n", indent,
idp->id_len);
fprintf(fp, "%sID: 0x", indent);
@@ -512,8 +511,7 @@ print_scsp_ext(fp, exp)
u_char *cp;
inc_indent();
- fprintf(fp, "%sNext: 0x%x\n", indent,
- exp->next);
+ fprintf(fp, "%sNext: %p\n", indent, exp->next);
fprintf(fp, "%sType: %s (0x%02x)\n", indent,
scsp_type_name(exp->type, ext_types),
exp->type);
@@ -584,12 +582,11 @@ print_scsp_csa(fp, csap)
Scsp_csa *csap;
{
inc_indent();
- fprintf(fp, "%sNext: 0x%x\n", indent,
- (u_long)csap->next);
+ fprintf(fp, "%sNext: %p\n", indent, csap->next);
fprintf(fp, "%sHops: %d\n", indent, csap->hops);
fprintf(fp, "%sNull Flag: %s\n", indent,
csap->null ? "True" : "False");
- fprintf(fp, "%sSequence no.: %d (0x%x)\n",
+ fprintf(fp, "%sSequence no.: %ld (0x%lx)\n",
indent, csap->seq, csap->seq);
fprintf(fp, "%sCache Key:\n", indent);
print_scsp_cache_key(fp, &csap->key);
@@ -623,7 +620,7 @@ print_scsp_ca(fp, cap)
Scsp_csa *csap;
inc_indent();
- fprintf(fp, "%sCA Seq. No.: %d\n", indent,
+ fprintf(fp, "%sCA Seq. No.: %ld\n", indent,
cap->ca_seq);
fprintf(fp, "%sM bit: %s\n", indent,
cap->ca_m ? "True" : "False");
@@ -635,8 +632,7 @@ print_scsp_ca(fp, cap)
print_scsp_mcp(fp, &cap->ca_mcp);
for (csap = cap->ca_csa_rec, n = 1; csap;
csap = csap->next, n++) {
- fprintf(fp, "%sCSA Record %d (0x%x):\n", indent, n,
- (u_long)csap);
+ fprintf(fp, "%sCSA Record %d (%p):\n", indent, n, csap);
print_scsp_csa(fp, csap);
}
dec_indent();
@@ -832,7 +828,7 @@ print_scsp_if_atmarp(fp, amp)
print_scsp_cache_key(fp, &amp->sa_key);
fprintf(fp, "%sOriginator ID:\n", indent);
print_scsp_id(fp, &amp->sa_oid);
- fprintf(fp, "%sSequence number: %d (0x%08x)\n", indent,
+ fprintf(fp, "%sSequence number: %ld (0x%08lx)\n", indent,
amp->sa_seq, (u_long)amp->sa_seq);
dec_indent();
}
@@ -861,8 +857,7 @@ print_scsp_if_msg(fp, imsg)
* Initialize
*/
init_indent();
- fprintf(fp, "SCSP Client Interface Message at 0x%x\n",
- (u_long)imsg);
+ fprintf(fp, "SCSP Client Interface Message at %p\n", imsg);
/*
* Print the message header
@@ -878,7 +873,7 @@ print_scsp_if_msg(fp, imsg)
imsg->si_proto);
fprintf(fp, "%sLength: %d\n", indent,
imsg->si_len);
- fprintf(fp, "%sToken: 0x%x\n", indent,
+ fprintf(fp, "%sToken: 0x%lx\n", indent,
imsg->si_tok);
/*
@@ -943,14 +938,13 @@ print_scsp_pending(fp, pp)
/*
* Print a header
*/
- fprintf(fp, "Pending control block at 0x%x\n", (u_long)pp);
+ fprintf(fp, "Pending control block at %p\n", pp);
/*
* Print the fields of the control block
*/
inc_indent();
- fprintf(fp, "%sNext: 0x%x\n", indent,
- (u_long)pp->sp_next);
+ fprintf(fp, "%sNext: %p\n", indent, pp->sp_next);
fprintf(fp, "%sSocket: %d\n", indent,
pp->sp_sock);
@@ -982,13 +976,13 @@ print_scsp_server(fp, ssp)
/*
* Print a header
*/
- fprintf(fp, "Server control block at 0x%x\n", (u_long)ssp);
+ fprintf(fp, "Server control block at %p\n", ssp);
/*
* Print the fields of the client control block
*/
inc_indent();
- fprintf(fp, "%sNext: 0x%x\n", indent,
+ fprintf(fp, "%sNext: %p\n", indent,
ssp->ss_next);
fprintf(fp, "%sName: %s\n", indent,
ssp->ss_name);
@@ -996,15 +990,15 @@ print_scsp_server(fp, ssp)
ssp->ss_intf);
fprintf(fp, "%sState: %d\n", indent,
ssp->ss_state);
- fprintf(fp, "%sProtocol ID: 0x%x\n", indent,
+ fprintf(fp, "%sProtocol ID: 0x%lx\n", indent,
ssp->ss_pid);
fprintf(fp, "%sID length: %d\n", indent,
ssp->ss_id_len);
fprintf(fp, "%sCache key length: %d\n", indent,
ssp->ss_ckey_len);
- fprintf(fp, "%sServer Group ID: 0x%x\n", indent,
+ fprintf(fp, "%sServer Group ID: 0x%lx\n", indent,
ssp->ss_sgid);
- fprintf(fp, "%sFamily ID: 0x%x\n", indent,
+ fprintf(fp, "%sFamily ID: 0x%lx\n", indent,
ssp->ss_fid);
fprintf(fp, "%sSocket: %d\n", indent,
ssp->ss_sock);
@@ -1044,9 +1038,8 @@ print_scsp_cse(fp, csep)
* Print the fields of the cache summary entry
*/
inc_indent();
- fprintf(fp, "%sNext CSE: 0x%x\n", indent,
- (u_long)csep->sc_next);
- fprintf(fp, "%sCSA sequence no.: %d (0x%x)\n", indent,
+ fprintf(fp, "%sNext CSE: %p\n", indent, csep->sc_next);
+ fprintf(fp, "%sCSA sequence no.: %ld (0x%lx)\n", indent,
csep->sc_seq, csep->sc_seq);
fprintf(fp, "%sCache key:\n", indent);
print_scsp_cache_key(fp, &csep->sc_key);
@@ -1076,10 +1069,8 @@ print_scsp_csu_rexmt(fp, rxp)
Scsp_csa *csap;
inc_indent();
- fprintf(fp, "%sNext CSU Req rexmt: 0x%x\n", indent,
- (u_long)rxp->sr_next);
- fprintf(fp, "%sDCS address: 0x%x\n", indent,
- (u_long)rxp->sr_dcs);
+ fprintf(fp, "%sNext CSU Req rexmt: %p\n", indent, rxp->sr_next);
+ fprintf(fp, "%sDCS address: %p\n", indent, rxp->sr_dcs);
for (csap = rxp->sr_csa, i = 1; csap;
csap = csap->next, i++) {
fprintf(fp, "%sCSA %d:\n", indent, i);
@@ -1117,16 +1108,14 @@ print_scsp_dcs(fp, dcsp)
/*
* Print a header
*/
- fprintf(fp, "DCS control block at 0x%x\n", (u_long)dcsp);
+ fprintf(fp, "DCS control block at %p\n", dcsp);
/*
* Print the fields of the DCS control block
*/
inc_indent();
- fprintf(fp, "%sNext DCS block: 0x%x\n", indent,
- (u_long)dcsp->sd_next);
- fprintf(fp, "%sServer control block: 0x%x\n", indent,
- (u_long)dcsp->sd_server);
+ fprintf(fp, "%sNext DCS block: %p\n", indent, dcsp->sd_next);
+ fprintf(fp, "%sServer control block: %p\n", indent, dcsp->sd_server);
fprintf(fp, "%sDCS ID:\n", indent);
print_scsp_id(fp, &dcsp->sd_dcsid);
fprintf(fp, "%sDCS address: %s\n", indent,
@@ -1146,17 +1135,17 @@ print_scsp_dcs(fp, dcsp)
dcsp->sd_hello_rcvd);
fprintf(fp, "%sCA FSM State: %s\n", indent,
format_cafsm_state(dcsp->sd_ca_state));
- fprintf(fp, "%sCA Seq. No.: 0x%x\n", indent,
+ fprintf(fp, "%sCA Seq. No.: 0x%lx\n", indent,
dcsp->sd_ca_seq);
fprintf(fp, "%sCA Rexmit Int: %d\n", indent,
dcsp->sd_ca_rexmt_int);
- fprintf(fp, "%sCA Retransmit Msg: 0x%x\n", indent,
- (u_long)dcsp->sd_ca_rexmt_msg);
+ fprintf(fp, "%sCA Retransmit Msg: %p\n", indent,
+ dcsp->sd_ca_rexmt_msg);
fprintf(fp, "%sCSASs to send: ", indent);
if (dcsp->sd_ca_csas == (Scsp_cse *)0) {
fprintf(fp, "Empty\n");
} else {
- fprintf(fp, "0x%x\n", (u_long) dcsp->sd_ca_csas);
+ fprintf(fp, "%p\n", dcsp->sd_ca_csas);
}
fprintf(fp, "%sCSUS Rexmit Int: %d\n", indent,
dcsp->sd_csus_rexmt_int);
@@ -1164,16 +1153,16 @@ print_scsp_dcs(fp, dcsp)
if (dcsp->sd_crl == (Scsp_csa *)0) {
fprintf(fp, "Empty\n");
} else {
- fprintf(fp, "0x%x\n", dcsp->sd_crl);
+ fprintf(fp, "%p\n", dcsp->sd_crl);
}
- fprintf(fp, "%sCSUS Rexmit Msg: 0x%x\n", indent,
- (u_long)dcsp->sd_csus_rexmt_msg);
+ fprintf(fp, "%sCSUS Rexmit Msg: %p\n", indent,
+ dcsp->sd_csus_rexmt_msg);
fprintf(fp, "%sCSA Hop count: %d\n", indent,
dcsp->sd_hops);
- fprintf(fp, "%sCSAs Pending ACK: 0x%x\n", indent,
- (u_long)dcsp->sd_csu_ack_pend);
- fprintf(fp, "%sCSAs ACKed: 0x%x\n", indent,
- (u_long)dcsp->sd_csu_ack);
+ fprintf(fp, "%sCSAs Pending ACK: %p\n", indent,
+ dcsp->sd_csu_ack_pend);
+ fprintf(fp, "%sCSAs ACKed: %p\n", indent,
+ dcsp->sd_csu_ack);
fprintf(fp, "%sCSU Req Rexmit Int: %d\n", indent,
dcsp->sd_csu_rexmt_int);
fprintf(fp, "%sCSU Req Rexmit Max: %d\n", indent,
@@ -1182,7 +1171,7 @@ print_scsp_dcs(fp, dcsp)
if (!dcsp->sd_csu_rexmt) {
fprintf(fp, "Empty\n");
} else {
- fprintf(fp, "0x%x\n", (u_long)dcsp->sd_csu_rexmt);
+ fprintf(fp, "%p\n", dcsp->sd_csu_rexmt);
}
fprintf(fp, "%sClient I/F state: %d\n", indent,
dcsp->sd_client_state);
@@ -1195,9 +1184,8 @@ print_scsp_dcs(fp, dcsp)
inc_indent();
for (csep = dcsp->sd_ca_csas; csep;
csep = csep->sc_next) {
- fprintf(fp, "%sCache summary entry at 0x%x\n",
- indent,
- (u_long)csep);
+ fprintf(fp, "%sCache summary entry at %p\n",
+ indent, csep);
print_scsp_cse(fp, csep);
}
dec_indent();
@@ -1210,8 +1198,7 @@ print_scsp_dcs(fp, dcsp)
fprintf(fp, "\n%sCache Request List:\n", indent);
inc_indent();
for (csap = dcsp->sd_crl; csap; csap = csap->next) {
- fprintf(fp, "%sCSA at 0x%x\n", indent,
- (u_long)csap);
+ fprintf(fp, "%sCSA at %p\n", indent, csap);
print_scsp_csa(fp, csap);
}
dec_indent();
@@ -1225,8 +1212,8 @@ print_scsp_dcs(fp, dcsp)
inc_indent();
for (rxp = dcsp->sd_csu_rexmt; rxp;
rxp = rxp->sr_next) {
- fprintf(fp, "%sCSU Rexmit Block at 0x%x\n",
- indent, (u_long)csap);
+ fprintf(fp, "%sCSU Rexmit Block at %p\n",
+ indent, rxp);
print_scsp_csu_rexmt(fp, rxp);
}
dec_indent();
@@ -1253,7 +1240,6 @@ print_scsp_dump()
Scsp_server *ssp;
Scsp_dcs *dcsp;
Scsp_cse *scp;
- Scsp_csu_rexmt *rxp;
Scsp_pending *pp;
FILE *df;
char fname[64];
diff --git a/usr.sbin/atm/scspd/scsp_socket.c b/usr.sbin/atm/scspd/scsp_socket.c
index 83f41cd..aa6e040 100644
--- a/usr.sbin/atm/scspd/scsp_socket.c
+++ b/usr.sbin/atm/scspd/scsp_socket.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_socket.c,v 1.6 1998/08/21 18:08:24 johnc Exp $
+ * @(#) $Id: scsp_socket.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -36,20 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_socket.c,v 1.6 1998/08/21 18:08:24 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -61,11 +49,23 @@ static char *RCSid = "@(#) $Id: scsp_socket.c,v 1.6 1998/08/21 18:08:24 johnc Ex
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_socket.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Local variables
@@ -143,7 +143,7 @@ scsp_find_dcs(sd)
int sd;
{
Scsp_server *ssp;
- Scsp_dcs *dcsp;
+ Scsp_dcs *dcsp = NULL;
/*
* Loop through the list of servers
@@ -315,6 +315,8 @@ scsp_dcs_connect(dcsp)
traffic.forward.PCR_all_traffic = ATM_PCR_OC12C;
traffic.backward.PCR_all_traffic = ATM_PCR_OC12C;
break;
+ case MEDIA_UNKNOWN:
+ break;
}
if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_TRAFFIC,
@@ -500,6 +502,8 @@ scsp_dcs_listen(ssp)
traffic.forward.PCR_all_traffic = ATM_PCR_OC12C;
traffic.backward.PCR_all_traffic = ATM_PCR_OC12C;
break;
+ case MEDIA_UNKNOWN:
+ break;
}
if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_TRAFFIC,
@@ -715,7 +719,6 @@ scsp_dcs_read(dcsp)
char *buff = (char *)0;
Scsp_server *ssp = dcsp->sd_server;
Scsp_msg *msg;
- struct scsp_nhdr msg_hdr, *mhp;
/*
* Get a buffer to hold the entire message
@@ -962,7 +965,7 @@ scsp_if_sock_read(sd)
int sd;
{
- int len, rc;
+ int len;
char *buff = (char *)0;
Scsp_if_msg *msg;
Scsp_if_msg_hdr msg_hdr;
@@ -1230,7 +1233,6 @@ scsp_pending_read(psp)
{
int rc;
Scsp_server *ssp;
- Scsp_dcs *dcsp;
Scsp_if_msg *msg;
/*
diff --git a/usr.sbin/atm/scspd/scsp_subr.c b/usr.sbin/atm/scspd/scsp_subr.c
index c14195b..3540694 100644
--- a/usr.sbin/atm/scspd/scsp_subr.c
+++ b/usr.sbin/atm/scspd/scsp_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_subr.c,v 1.5 1998/08/13 20:11:16 johnc Exp $
+ * @(#) $Id: scsp_subr.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -36,19 +36,8 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_subr.c,v 1.5 1998/08/13 20:11:16 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -61,12 +50,23 @@ static char *RCSid = "@(#) $Id: scsp_subr.c,v 1.5 1998/08/13 20:11:16 johnc Exp
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
#include <netatm/uni/unisig_var.h>
-
+
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_subr.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Hash an SCSP cache key
@@ -89,7 +89,7 @@ scsp_hash(ckp)
*/
h = 0;
for (i = ckp->key_len-1, j = 0;
- i > 0, j < sizeof(int);
+ i > 0 && j < sizeof(int);
i--, j++)
h = (h << 8) + ckp->key[i];
h = abs(h);
@@ -693,7 +693,6 @@ scsp_get_server_info(ssp)
struct air_int_rsp *intf_rsp = (struct air_int_rsp *)0;
struct air_cfg_rsp *cfg_rsp = (struct air_cfg_rsp *)0;
struct sockaddr_in *ip_addr;
- struct sockaddr_in subnet_mask;
Atm_addr_nsap *anp;
/*
@@ -863,9 +862,9 @@ scsp_process_ca(dcsp, cap)
for (csap = cap->ca_csa_rec; csap; csap = next_csap) {
next_csap = csap->next;
SCSP_LOOKUP(ssp, &csap->key, csep);
- if (!csep || scsp_cmp_id(&csap->oid,
+ if (!csep || (scsp_cmp_id(&csap->oid,
&csep->sc_oid) == 0 &&
- csap->seq > csep->sc_seq) {
+ csap->seq > csep->sc_seq)) {
/*
* CSAS entry not in cache or more
* up to date than cache, add it to CRL
@@ -929,6 +928,7 @@ scsp_process_cache_rsp(ssp, smp)
aap++;
break;
case SCSP_NHRP_PROTO:
+ default:
/*
* Not implemented yet
*/
diff --git a/usr.sbin/atm/scspd/scsp_timer.c b/usr.sbin/atm/scspd/scsp_timer.c
index 0ec6169d..d61dad3 100644
--- a/usr.sbin/atm/scspd/scsp_timer.c
+++ b/usr.sbin/atm/scspd/scsp_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_timer.c,v 1.2 1998/07/16 15:59:50 johnc Exp $
+ * @(#) $Id: scsp_timer.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -35,16 +35,8 @@
*
*/
-#ifndef lint
-static char *RCSid = "@(#) $Id: scsp_timer.c,v 1.2 1998/07/16 15:59:50 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <syslog.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -54,12 +46,20 @@ static char *RCSid = "@(#) $Id: scsp_timer.c,v 1.2 1998/07/16 15:59:50 johnc Exp
#include <netatm/atm_sap.h>
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
-
+
+#include <errno.h>
#include <libatm.h>
+#include <stdio.h>
+#include <syslog.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scsp_timer.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Process an SCSP Open timeout
diff --git a/usr.sbin/atm/scspd/scsp_var.h b/usr.sbin/atm/scspd/scsp_var.h
index ba383d5..707b688 100644
--- a/usr.sbin/atm/scspd/scsp_var.h
+++ b/usr.sbin/atm/scspd/scsp_var.h
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scsp_var.h,v 1.5 1998/08/13 20:11:17 johnc Exp $
+ * @(#) $Id: scsp_var.h,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -337,6 +337,33 @@ extern int scsp_cafsm __P((Scsp_dcs *, int, void *));
/* scsp_config.c */
extern int scsp_config __P((char *));
+extern int start_dcs __P((void));
+extern int finish_dcs __P((void));
+extern int set_dcs_addr __P((char *, char *));
+extern int set_dcs_ca_rexmit __P((int));
+extern int set_dcs_csus_rexmit __P((int));
+extern int set_dcs_csu_rexmit __P((int));
+extern int set_dcs_csu_rexmit_max __P((int));
+extern int set_dcs_hello_df __P((int));
+extern int set_dcs_hello_int __P((int));
+extern int set_dcs_hops __P((int));
+extern int set_dcs_id __P((char *));
+extern int set_intf __P((char *));
+extern int set_protocol __P((int));
+extern int set_server_group __P((int));
+extern int start_server __P((char *));
+extern int finish_server __P((void));
+extern int set_log_file __P((char *));
+
+/* scsp_config_lex.c */
+extern int yylex __P((void));
+
+/* scsp_config_parse.y */
+#if __STDC__
+extern void parse_error __P((const char *, ...));
+#else
+extern void parse_error __P((char *, va_alist));
+#endif
/* scsp_hfsm.c */
extern int scsp_hfsm __P((Scsp_dcs *, int, Scsp_msg *));
@@ -398,7 +425,9 @@ extern int scsp_dcs_read __P((Scsp_dcs *));
extern int scsp_server_listen __P(());
extern int scsp_server_accept __P((int));
extern Scsp_if_msg * scsp_if_sock_read __P((int));
+extern int scsp_if_sock_write __P((int, Scsp_if_msg *));
extern int scsp_server_read __P((Scsp_server *));
+extern int scsp_send_cache_ind __P((Scsp_server *));
extern int scsp_pending_read __P((Scsp_pending *));
/* scsp_subr.c */
@@ -415,6 +444,8 @@ extern void scsp_server_shutdown __P((Scsp_server *));
extern void scsp_server_delete __P((Scsp_server *));
extern int scsp_get_server_info __P((Scsp_server *));
extern void scsp_process_ca __P((Scsp_dcs *, Scsp_ca *));
+extern void scsp_process_cache_rsp __P((Scsp_server *,
+ Scsp_if_msg *));
extern int scsp_propagate_csa __P(( Scsp_dcs *,
Scsp_csa *));
extern void scsp_update_cache __P(( Scsp_dcs *,
diff --git a/usr.sbin/atm/scspd/scspd.c b/usr.sbin/atm/scspd/scspd.c
index 74fe868..932fdef 100644
--- a/usr.sbin/atm/scspd/scspd.c
+++ b/usr.sbin/atm/scspd/scspd.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: scspd.c,v 1.6 1998/08/21 18:08:25 johnc Exp $
+ * @(#) $Id: scspd.c,v 1.1 1998/09/15 08:23:17 phk Exp $
*
*/
@@ -36,23 +36,13 @@
*
*/
-
-#ifndef lint
-static char *RCSid = "@(#) $Id: scspd.c,v 1.6 1998/08/21 18:08:25 johnc Exp $";
-#endif
-
#include <sys/types.h>
#include <sys/param.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <syslog.h>
#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/ttycom.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <sys/ttycom.h>
#include <netatm/queue.h>
#include <netatm/atm.h>
#include <netatm/atm_if.h>
@@ -60,11 +50,22 @@ static char *RCSid = "@(#) $Id: scspd.c,v 1.6 1998/08/21 18:08:25 johnc Exp $";
#include <netatm/atm_sys.h>
#include <netatm/atm_ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
#include <libatm.h>
+#include <stdio.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "scsp_msg.h"
#include "scsp_if.h"
#include "scsp_var.h"
+#ifndef lint
+__RCSID("@(#) $Id: scspd.c,v 1.1 1998/09/15 08:23:17 phk Exp $");
+#endif
+
/*
* Global variables
@@ -151,7 +152,7 @@ initialize(argc, argv)
/*
* Save program name, ignoring any path components
*/
- if (prog = (char *)strrchr(argv[0], '/'))
+ if ((prog = (char *)strrchr(argv[0], '/')) != NULL)
prog++;
else
prog = argv[0];
@@ -353,6 +354,7 @@ daemon_bypass:
* none
*
*/
+int
main(argc, argv)
int argc;
char *argv[];
@@ -493,7 +495,7 @@ main(argc, argv)
for (i = 0; i <= scsp_max_socket; i++) {
if (FD_ISSET(i, &write_set)) {
FD_CLR(i, &write_set);
- if (dcsp = scsp_find_dcs(i)) {
+ if ((dcsp = scsp_find_dcs(i)) != NULL) {
rc = scsp_hfsm(dcsp,
SCSP_HFSM_VC_ESTAB,
(Scsp_msg *)0);
@@ -534,9 +536,9 @@ main(argc, argv)
*/
for (i = 0; i <= scsp_max_socket; i++) {
if (FD_ISSET(i, &read_set)) {
- if (ssp = scsp_find_server(i)) {
+ if ((ssp = scsp_find_server(i)) != NULL) {
rc = scsp_server_read(ssp);
- } else if (dcsp = scsp_find_dcs(i)) {
+ } else if ((dcsp = scsp_find_dcs(i)) != NULL) {
rc = scsp_dcs_read(dcsp);
}
}
OpenPOWER on IntegriCloud