From 2c7d6d81ef9291d46c57c4e95a2255fe022be7ee Mon Sep 17 00:00:00 2001 From: Mike Spengler Date: Thu, 1 Jul 1999 20:48:59 +0000 Subject: [PATCH] Modify code to be -Wall'able. PR: bin/11315 --- lib/libatm/atm_addr.c | 19 ++-- lib/libatm/cache_key.c | 17 ++-- lib/libatm/ioctl_subr.c | 56 +++--------- lib/libatm/ip_addr.c | 15 ++-- lib/libatm/ip_checksum.c | 12 ++- lib/libatm/libatm.h | 7 +- lib/libatm/timer.c | 16 ++-- sbin/atm/atm/atm.c | 28 +++--- sbin/atm/atm/atm.h | 3 +- sbin/atm/atm/atm_eni.c | 38 ++++---- sbin/atm/atm/atm_fore200.c | 42 ++++----- sbin/atm/atm/atm_inet.c | 20 ++--- sbin/atm/atm/atm_print.c | 41 ++++----- sbin/atm/atm/atm_set.c | 23 ++--- sbin/atm/atm/atm_show.c | 32 +++---- sbin/atm/atm/atm_subr.c | 25 +++--- sbin/atm/fore_dnld/fore_dnld.c | 40 +++++---- sbin/atm/ilmid/ilmid.c | 28 +++--- usr.sbin/atm/atmarpd/atmarp_config.c | 23 +++-- usr.sbin/atm/atmarpd/atmarp_log.c | 26 +++--- usr.sbin/atm/atmarpd/atmarp_scsp.c | 33 ++++--- usr.sbin/atm/atmarpd/atmarp_subr.c | 41 +++++---- usr.sbin/atm/atmarpd/atmarp_timer.c | 21 ++--- usr.sbin/atm/atmarpd/atmarp_var.h | 3 +- usr.sbin/atm/atmarpd/atmarpd.c | 32 +++---- usr.sbin/atm/scspd/scsp_cafsm.c | 24 +++-- usr.sbin/atm/scspd/scsp_config.c | 25 +++--- usr.sbin/atm/scspd/scsp_config_lex.c | 26 +++--- usr.sbin/atm/scspd/scsp_config_parse.y | 32 +++---- usr.sbin/atm/scspd/scsp_hfsm.c | 23 +++-- usr.sbin/atm/scspd/scsp_if.c | 36 +++----- usr.sbin/atm/scspd/scsp_input.c | 45 +++++----- usr.sbin/atm/scspd/scsp_log.c | 30 +++---- usr.sbin/atm/scspd/scsp_msg.c | 23 ++--- usr.sbin/atm/scspd/scsp_output.c | 36 ++++---- usr.sbin/atm/scspd/scsp_print.c | 118 +++++++++++-------------- usr.sbin/atm/scspd/scsp_socket.c | 36 ++++---- usr.sbin/atm/scspd/scsp_subr.c | 34 +++---- usr.sbin/atm/scspd/scsp_timer.c | 20 ++--- usr.sbin/atm/scspd/scsp_var.h | 33 ++++++- usr.sbin/atm/scspd/scspd.c | 36 ++++---- 41 files changed, 605 insertions(+), 613 deletions(-) diff --git a/lib/libatm/atm_addr.c b/lib/libatm/atm_addr.c index 102f0b8dd32e..36a13f1f9851 100644 --- a/lib/libatm/atm_addr.c +++ b/lib/libatm/atm_addr.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_addr.c,v 1.1 1998/09/15 08:22:33 phk Exp $ + * @(#) $Id: atm_addr.c,v 1.2 1999/05/20 23:52:15 mks Exp $ * */ @@ -35,14 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/09/15 08:22:33 phk Exp $"; -#endif - #include #include -#include - #include #include #include @@ -53,8 +47,15 @@ static char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/09/15 08:22:33 phk Exp $"; #include #include +#include +#include + #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_addr.c,v 1.2 1999/05/20 23:52:15 mks Exp $"); +#endif + extern char *prog; @@ -78,7 +79,7 @@ get_hex_atm_addr(in, out, len) u_char *out; int len; { - int c_type, c_value, i, out_len, state, val; + int c_type, c_value, i, out_len, state, val = 0; /* * Character table @@ -284,7 +285,7 @@ format_atm_addr(addr) case T_ATM_E164_ADDR: atm_e164 = (Atm_addr_e164 *)addr->address; for(i=0; iaddress_length; i++) { - sprintf(&str[strlen(str)], "%c\0", + sprintf(&str[strlen(str)], "%c", atm_e164->aae_addr[i]); } break; diff --git a/lib/libatm/cache_key.c b/lib/libatm/cache_key.c index f0d66502e0b3..df0328bb115a 100644 --- a/lib/libatm/cache_key.c +++ b/lib/libatm/cache_key.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: cache_key.c,v 1.1 1998/07/09 21:45:27 johnc Exp $ + * @(#) $Id: cache_key.c,v 1.1 1998/09/15 08:22:33 phk Exp $ * */ @@ -36,14 +36,8 @@ * */ - -#ifndef lint -static char *RCSid = "@(#) $Id: cache_key.c,v 1.1 1998/07/09 21:45:27 johnc Exp $"; -#endif - #include #include - #include #include #include @@ -55,8 +49,14 @@ static char *RCSid = "@(#) $Id: cache_key.c,v 1.1 1998/07/09 21:45:27 johnc Exp #include #include +#include + #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: cache_key.c,v 1.1 1998/09/15 08:22:33 phk Exp $"); +#endif + /* * Compute an SCSP cache key @@ -78,8 +78,7 @@ scsp_cache_key(ap, ip, ol, op) int ol; char *op; { - int i, key, len; - char *cp; + int i, len; char buff[32], digest[16]; MD5_CTX context; diff --git a/lib/libatm/ioctl_subr.c b/lib/libatm/ioctl_subr.c index a77d79fa8e4e..1cf598a95760 100644 --- a/lib/libatm/ioctl_subr.c +++ b/lib/libatm/ioctl_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: ioctl_subr.c,v 1.2 1998/07/10 17:09:20 root Exp $ + * @(#) $Id: ioctl_subr.c,v 1.1 1998/09/15 08:22:34 phk Exp $ * */ @@ -35,14 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: ioctl_subr.c,v 1.2 1998/07/10 17:09:20 root Exp $"; -#endif - #include #include - -#include #include #include #include @@ -54,8 +48,18 @@ static char *RCSid = "@(#) $Id: ioctl_subr.c,v 1.2 1998/07/10 17:09:20 root Exp #include #include +#include +#include +#include +#include + #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: ioctl_subr.c,v 1.1 1998/09/15 08:22:34 phk Exp $"); +#endif + + #ifndef TRUE #define TRUE 1 #endif @@ -177,43 +181,6 @@ get_vcc_info(intf, vccp) } -/* - * Count number of open VCCs - * - * Issue a AIOCS_INF_VCC to get info on all open VCCs. Count them and - * return the answer. - * - * Arguments: - * intf pointer to interface name (or null string) - * - * Returns: - * int number of VCCs - * - */ -int -count_vccs ( intf ) -char *intf; -{ - int vcc_info_len; - int count = 0; - char *cp; - struct air_vcc_rsp *vcc_info, *vcc_info_base; - - vcc_info_len = get_vcc_info ( intf, &vcc_info ); - if ( !vcc_info ) - return ( 0 ); - vcc_info_base = vcc_info; - - for ( ; vcc_info_len >= sizeof ( struct air_vcc_rsp ); - vcc_info_len -= sizeof ( struct air_vcc_rsp ), - vcc_info++ ) { - count++; - } - free ( vcc_info_base ); - return ( count ); -} - - /* * Get subnet mask * @@ -342,7 +309,6 @@ verify_nif_name(name) char *name; { int rc, s; - caddr_t buf; struct atminfreq air; struct air_netif_rsp *nif_info; diff --git a/lib/libatm/ip_addr.c b/lib/libatm/ip_addr.c index aee3368ea7b7..fbf60c4e0fae 100644 --- a/lib/libatm/ip_addr.c +++ b/lib/libatm/ip_addr.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: ip_addr.c,v 1.1 1998/07/09 21:45:42 johnc Exp $ + * @(#) $Id: ip_addr.c,v 1.1 1998/09/15 08:22:34 phk Exp $ * */ @@ -35,14 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: ip_addr.c,v 1.1 1998/07/09 21:45:42 johnc Exp $"; -#endif - #include #include - -#include #include #include #include @@ -54,8 +48,15 @@ static char *RCSid = "@(#) $Id: ip_addr.c,v 1.1 1998/07/09 21:45:42 johnc Exp $" #include #include +#include +#include + #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: ip_addr.c,v 1.1 1998/09/15 08:22:34 phk Exp $"); +#endif + /* * Get IP address diff --git a/lib/libatm/ip_checksum.c b/lib/libatm/ip_checksum.c index 478f6ca77015..3cdf2f2bee28 100644 --- a/lib/libatm/ip_checksum.c +++ b/lib/libatm/ip_checksum.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: ip_checksum.c,v 1.4 1998/08/11 18:11:48 johnc Exp $ + * @(#) $Id: ip_checksum.c,v 1.1 1998/09/15 08:22:34 phk Exp $ * */ @@ -36,14 +36,8 @@ * */ - -#ifndef lint -static char *RCSid = "@(#) $Id: ip_checksum.c,v 1.4 1998/08/11 18:11:48 johnc Exp $"; -#endif - #include #include - #include #include #include @@ -56,6 +50,10 @@ static char *RCSid = "@(#) $Id: ip_checksum.c,v 1.4 1998/08/11 18:11:48 johnc Ex #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: ip_checksum.c,v 1.1 1998/09/15 08:22:34 phk Exp $"); +#endif + /* * Compute an IP checksum diff --git a/lib/libatm/libatm.h b/lib/libatm/libatm.h index 346243195678..28ddbc289989 100644 --- a/lib/libatm/libatm.h +++ b/lib/libatm/libatm.h @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: libatm.h,v 1.5 1998/08/06 16:56:27 johnc Exp $ + * @(#) $Id: libatm.h,v 1.1 1998/09/15 08:22:34 phk Exp $ * */ @@ -96,8 +96,9 @@ extern int get_subnet_mask __P((char *, struct sockaddr_in *)); extern int get_mtu __P((char *)); extern int verify_nif_name __P((char *)); -extern int get_cfg_info __P((char *, - struct air_cfg_rsp **)); +extern int get_cfg_info __P((char *, struct air_cfg_rsp **)); +extern int get_intf_info __P((char *, struct air_int_rsp **)); +extern int get_netif_info __P((char *, struct air_netif_rsp **)); /* ip_addr.c */ extern struct sockaddr_in *get_ip_addr __P((char *)); diff --git a/lib/libatm/timer.c b/lib/libatm/timer.c index fc8b64fe7167..d2bae91c4195 100644 --- a/lib/libatm/timer.c +++ b/lib/libatm/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: timer.c,v 1.4 1998/07/16 15:50:26 johnc Exp $ + * @(#) $Id: timer.c,v 1.1 1998/09/15 08:22:34 phk Exp $ * */ @@ -35,14 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: timer.c,v 1.4 1998/07/16 15:50:26 johnc Exp $"; -#endif - #include #include - -#include #include #include #include @@ -54,8 +48,16 @@ static char *RCSid = "@(#) $Id: timer.c,v 1.4 1998/07/16 15:50:26 johnc Exp $"; #include #include +#include +#include + #include "libatm.h" +#ifndef lint +__RCSID("@(#) $Id: timer.c,v 1.1 1998/09/15 08:22:34 phk Exp $"); +#endif + + Harp_timer *harp_timer_head; int harp_timer_exec; diff --git a/sbin/atm/atm/atm.c b/sbin/atm/atm/atm.c index a668b740e552..923120729edf 100644 --- a/sbin/atm/atm/atm.c +++ b/sbin/atm/atm/atm.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm.c,v 1.17 1998/08/06 16:57:47 johnc Exp $ + * @(#) $Id: atm.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm.c,v 1.17 1998/08/06 16:57:47 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -59,9 +50,19 @@ static char *RCSid = "@(#) $Id: atm.c,v 1.17 1998/08/06 16:57:47 johnc Exp $"; #include #include +#include #include +#include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif + /* * Usage string @@ -217,6 +218,7 @@ char *prog; char prefix[128] = ""; +int main(argc, argv) int argc; char **argv; @@ -226,7 +228,7 @@ main(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]; @@ -240,7 +242,7 @@ main(argc, argv) /* * Validate and process command */ - if (error = do_cmd(cmds, argc, argv)) + if ((error = do_cmd(cmds, argc, argv)) != 0) usage(cmds, ""); exit(error); @@ -724,7 +726,7 @@ arp_add(argc, argv, cmdp) char **argv; struct cmd *cmdp; { - int len, rc, s; + int len, s; struct atmaddreq apr; Atm_addr host_atm; struct sockaddr_in *sin; diff --git a/sbin/atm/atm/atm.h b/sbin/atm/atm/atm.h index f903bd781bab..bed5bad06cba 100644 --- a/sbin/atm/atm/atm.h +++ b/sbin/atm/atm/atm.h @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm.h,v 1.1 1998/09/15 08:22:45 phk Exp $ + * @(#) $Id: atm.h,v 1.2 1999/01/20 18:36:58 mks Exp $ * */ @@ -166,6 +166,7 @@ void ip_pvcadd __P((int, char **, struct cmd *, struct atmaddreq *, /* atm_print.c */ void print_arp_info __P((struct air_arp_rsp *)); void print_asrv_info __P((struct air_asrv_rsp *)); +void print_cfg_info __P((struct air_cfg_rsp *)); void print_intf_info __P((struct air_int_rsp *)); void print_ip_vcc_info __P((struct air_ip_vcc_rsp *)); void print_netif_info __P((struct air_netif_rsp *)); diff --git a/sbin/atm/atm/atm_eni.c b/sbin/atm/atm/atm_eni.c index 272e48f59527..6bf0985dc34c 100644 --- a/sbin/atm/atm/atm_eni.c +++ b/sbin/atm/atm/atm_eni.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_eni.c,v 1.8 1998/08/26 23:29:31 mks Exp $ + * @(#) $Id: atm_eni.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_eni.c,v 1.8 1998/08/26 23:29:31 mks Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -55,11 +46,20 @@ static char *RCSid = "@(#) $Id: atm_eni.c,v 1.8 1998/08/26 23:29:31 mks Exp $"; #include #include #include - -#include -#include "atm.h" #include +#include +#include +#include +#include +#include + +#include "atm.h" + +#ifndef lint +__RCSID("@(#) $Id: atm_eni.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif + /* * Local constants @@ -241,7 +241,7 @@ print_eni_oc3(vi) /* * Print the OC-3c info */ - printf("%7d %7d %7d %7d %7d %7d %7d\n", + printf("%7ld %7ld %7ld %7ld %7ld %7ld %7ld\n", stats->eni_st_oc3.oc3_sect_bip8, stats->eni_st_oc3.oc3_path_bip8, stats->eni_st_oc3.oc3_line_bip24, @@ -282,7 +282,7 @@ print_eni_atm(vi) /* * Print the ATM layer info */ - printf("%10d %10d\n", + printf("%10ld %10ld\n", stats->eni_st_atm.atm_rcvd, stats->eni_st_atm.atm_xmit); } @@ -318,7 +318,7 @@ print_eni_aal0(vi) /* * Print the AAL 0 info */ - printf("%10d %10d %10d\n", + printf("%10ld %10ld %10ld\n", stats->eni_st_aal0.aal0_rcvd, stats->eni_st_aal0.aal0_xmit, stats->eni_st_aal0.aal0_drops); @@ -355,7 +355,7 @@ print_eni_aal5(vi) /* * Print the AAL 5 info */ - printf("%10d %10d %5d %5d %9d %9d %5d %5d %5d\n", + printf("%10ld %10ld %5ld %5ld %9ld %9ld %5ld %5ld %5ld\n", stats->eni_st_aal5.aal5_rcvd, stats->eni_st_aal5.aal5_xmit, stats->eni_st_aal5.aal5_crc_len, @@ -397,7 +397,7 @@ print_eni_driver(vi) /* * Print the driver info */ - printf ( "%5d %5d %5d %5d %5d %5d %5d %5d %5d %5d %5d\n", + printf ( "%5ld %5ld %5ld %5ld %5ld %5ld %5ld %5ld %5ld %5ld %5ld\n", stats->eni_st_drv.drv_mm_toobig, stats->eni_st_drv.drv_mm_nodesc, stats->eni_st_drv.drv_mm_nobuf, @@ -419,7 +419,7 @@ print_eni_driver(vi) /* * Print the driver info */ - printf ( "%5d %5d %5d %5d %5d %5d %5d %7d %5d %7d\n", + printf ( "%5ld %5ld %5ld %5ld %5ld %5ld %5ld %7ld %5ld %7ld\n", stats->eni_st_drv.drv_rv_novcc, stats->eni_st_drv.drv_rv_intrq, stats->eni_st_drv.drv_rv_segdma, diff --git a/sbin/atm/atm/atm_fore200.c b/sbin/atm/atm/atm_fore200.c index 9dd64b4c86c0..0040aa4ecfba 100644 --- a/sbin/atm/atm/atm_fore200.c +++ b/sbin/atm/atm/atm_fore200.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_fore200.c,v 1.10 1998/08/26 23:29:31 mks Exp $ + * @(#) $Id: atm_fore200.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_fore200.c,v 1.10 1998/08/26 23:29:31 mks Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -55,13 +46,22 @@ static char *RCSid = "@(#) $Id: atm_fore200.c,v 1.10 1998/08/26 23:29:31 mks Exp #include #include #include - -#include -#include "atm.h" #include #include #include +#include +#include +#include +#include +#include + +#include "atm.h" + +#ifndef lint +__RCSID("@(#) $Id: atm_fore200.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif + /* * Local constants @@ -305,7 +305,7 @@ print_fore200_taxi(vi) /* * Print the physical layer info */ - printf("%10d %12d\n", + printf("%10ld %12ld\n", stats->st_taxi.taxi_bad_crc, stats->st_taxi.taxi_framing); } @@ -341,7 +341,7 @@ print_fore200_oc3(vi) /* * Print the OC-3c info */ - printf("%7d %7d %7d %7d %7d %7d %7d\n", + printf("%7ld %7ld %7ld %7ld %7ld %7ld %7ld\n", stats->st_oc3.oc3_sect_bip8, stats->st_oc3.oc3_path_bip8, stats->st_oc3.oc3_line_bip24, @@ -382,7 +382,7 @@ print_fore200_dev(vi) /* * Print the device info */ - printf("%10d %10d %10d %10d %10d %s\n", + printf("%10ld %10ld %10ld %10ld %10ld %s\n", stats->st_misc.buf1_sm_fail, stats->st_misc.buf1_lg_fail, stats->st_misc.buf2_sm_fail, @@ -422,7 +422,7 @@ print_fore200_atm(vi) /* * Print the ATM layer info */ - printf("%10d %10d %10d %10d %10d %10d\n", + printf("%10ld %10ld %10ld %10ld %10ld %10ld\n", stats->st_atm.atm_rcvd, stats->st_atm.atm_xmit, stats->st_atm.atm_vpi_range, @@ -462,7 +462,7 @@ print_fore200_aal0(vi) /* * Print the AAL 0 info */ - printf("%10d %10d %10d\n", + printf("%10ld %10ld %10ld\n", stats->st_aal0.aal0_rcvd, stats->st_aal0.aal0_xmit, stats->st_aal0.aal0_drops); @@ -499,7 +499,7 @@ print_fore200_aal4(vi) /* * Print the AAL 4 info */ - printf("%10d %10d %5d %5d %5d %9d %9d %5d %5d\n", + printf("%10ld %10ld %5ld %5ld %5ld %9ld %9ld %5ld %5ld\n", stats->st_aal4.aal4_rcvd, stats->st_aal4.aal4_xmit, stats->st_aal4.aal4_crc, @@ -542,7 +542,7 @@ print_fore200_aal5(vi) /* * Print the AAL 5 info */ - printf("%10d %10d %5d %5d %9d %9d %5d %5d %5d\n", + printf("%10ld %10ld %5ld %5ld %9ld %9ld %5ld %5ld %5ld\n", stats->st_aal5.aal5_rcvd, stats->st_aal5.aal5_xmit, stats->st_aal5.aal5_crc_len, @@ -585,7 +585,7 @@ print_fore200_driver(vi) /* * Print the driver info */ - printf("%4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d\n", + printf("%4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld\n", stats->st_drv.drv_xm_notact, stats->st_drv.drv_xm_full, stats->st_drv.drv_xm_maxpdu, diff --git a/sbin/atm/atm/atm_inet.c b/sbin/atm/atm/atm_inet.c index 91b62dc4d334..9ca2ceb1494c 100644 --- a/sbin/atm/atm/atm_inet.c +++ b/sbin/atm/atm/atm_inet.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_inet.c,v 1.9 1998/08/26 23:29:31 mks Exp $ + * @(#) $Id: atm_inet.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,18 +35,9 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_inet.c,v 1.9 1998/08/26 23:29:31 mks Exp $"; -#endif - #include #include - -#include -#include -#include #include -#include #include #include #include @@ -56,9 +47,18 @@ static char *RCSid = "@(#) $Id: atm_inet.c,v 1.9 1998/08/26 23:29:31 mks Exp $"; #include #include +#include #include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_inet.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif + /* * Process add command for a TCP/IP PVC diff --git a/sbin/atm/atm/atm_print.c b/sbin/atm/atm/atm_print.c index 93aaef824862..4b5e8432d22f 100644 --- a/sbin/atm/atm/atm_print.c +++ b/sbin/atm/atm/atm_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: atm_print.c,v 1.12 1998/07/30 22:38:56 mks Exp $ + * @(#) $Id: atm_print.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,19 +35,12 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_print.c,v 1.12 1998/07/30 22:38:56 mks Exp $"; -#endif - #include #include - -#include -#include -#include #include #include #include +#include #include #include #include @@ -56,15 +49,23 @@ static char *RCSid = "@(#) $Id: atm_print.c,v 1.12 1998/07/30 22:38:56 mks Exp $ #include #include #include - -#include #include #include #include #include #include + +#include +#include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_print.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif #define ARP_HDR \ @@ -349,7 +350,6 @@ print_asrv_info(si) { int i; char *atm_addr, *state; - char print_lis[32]; struct in_addr *addr; /* @@ -395,7 +395,7 @@ print_asrv_info(si) for (i = 0; i < si->asp_nprefix; i++) { printf("%s", inet_ntoa(*addr)); addr++; - printf("/0x%0x", ntohl(addr->s_addr)); + printf("/0x%0lx", ntohl(addr->s_addr)); addr++; if (i < si->asp_nprefix -1) printf(", "); @@ -444,7 +444,7 @@ print_cfg_info(si) /* * Print the ARP server information */ - printf("%-8s %-8s %-8s %-14s %-4s %d\n", + printf("%-8s %-8s %-8s %-14s %-4s %ld\n", si->acp_intf, vendor, adapter, @@ -474,9 +474,8 @@ print_intf_info(ni) { int i; char nif_names[(IFNAMSIZ *2)+4]; - char *atm_addr, *ip_addr; + char *atm_addr; char *sigmgr = "-", *state_name = "-"; - struct sockaddr_in *sin; struct state *s_t; /* @@ -681,8 +680,6 @@ void print_intf_stats(pi) struct air_phy_stat_rsp *pi; { - int i; - /* * Print a header if it hasn't already been done */ @@ -694,7 +691,7 @@ print_intf_stats(pi) /* * Print the interface statistics */ - printf("%-9s %7d %8d %5d %7d %8d %5d %5d\n", + printf("%-9s %7ld %8ld %5ld %7ld %8ld %5ld %5ld\n", pi->app_intf, pi->app_ipdus, pi->app_ibytes, @@ -737,7 +734,7 @@ print_vcc_stats(vi) vi->avp_vpi, vi->avp_vci); if ( vi->avp_type & VCC_IN ) - printf ( " %7d %8d %5d", + printf ( " %7ld %8ld %5ld", vi->avp_ipdus, vi->avp_ibytes, vi->avp_ierrors); @@ -745,7 +742,7 @@ print_vcc_stats(vi) printf ( " - - -" ); if ( vi->avp_type & VCC_OUT ) - printf ( " %7d %8d %5d\n", + printf ( " %7ld %8ld %5ld\n", vi->avp_opdus, vi->avp_obytes, vi->avp_oerrors); @@ -770,7 +767,7 @@ print_vcc_info(vi) { int i; char *aal_name = "-" , *encaps_name = "-", *owner_name = "-"; - char *proto_name = "-", *state_name = "-", *type_name = "-"; + char *state_name = "-", *type_name = "-"; char dir_name[10]; struct state *s_t; diff --git a/sbin/atm/atm/atm_set.c b/sbin/atm/atm/atm_set.c index 199c37f153f6..413116b2965f 100644 --- a/sbin/atm/atm/atm_set.c +++ b/sbin/atm/atm/atm_set.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_set.c,v 1.12 1998/08/26 23:29:32 mks Exp $ + * @(#) $Id: atm_set.c,v 1.1 1998/09/15 08:22:45 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_set.c,v 1.12 1998/08/26 23:29:32 mks Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -57,9 +48,19 @@ static char *RCSid = "@(#) $Id: atm_set.c,v 1.12 1998/08/26 23:29:32 mks Exp $"; #include #include +#include #include +#include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_set.c,v 1.1 1998/09/15 08:22:45 phk Exp $"); +#endif + /* * Process ATM ARP server set command @@ -83,7 +84,7 @@ set_arpserver(argc, argv, cmdp) struct cmd *cmdp; { int i, len, prefix_len = 0, rc, s; - char *cp, *intf; + char *intf; Atm_addr server; struct sockaddr_in *lis; struct sockaddr_in if_mask; diff --git a/sbin/atm/atm/atm_show.c b/sbin/atm/atm/atm_show.c index 8c32dfc96be8..7e296857db74 100644 --- a/sbin/atm/atm/atm_show.c +++ b/sbin/atm/atm/atm_show.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_show.c,v 1.12 1998/07/24 16:20:34 johnc Exp $ + * @(#) $Id: atm_show.c,v 1.1 1998/09/15 08:22:46 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_show.c,v 1.12 1998/07/24 16:20:34 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -57,9 +48,18 @@ static char *RCSid = "@(#) $Id: atm_show.c,v 1.12 1998/07/24 16:20:34 johnc Exp #include #include +#include #include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_show.c,v 1.1 1998/09/15 08:22:46 phk Exp $"); +#endif + /* * Local functions @@ -90,7 +90,7 @@ show_arp(argc, argv, cmdp) char **argv; struct cmd *cmdp; { - int buf_len, arp_info_len, ip_info_len, sel; + int buf_len, arp_info_len; struct atminfreq air; struct air_arp_rsp *arp_info, *arp_info_base; struct sockaddr_in *sin; @@ -418,7 +418,7 @@ show_ip_vcc(argc, argv, cmdp) char **argv; struct cmd *cmdp; { - int buf_len, ip_info_len, rc, sel; + int buf_len, ip_info_len, rc; char *if_name = (char *)0; struct atminfreq air; struct air_ip_vcc_rsp *ip_info, *ip_info_base; @@ -1150,17 +1150,17 @@ arp_compare(p1, p2) /* * Compare the IP addresses */ - if (rc = sin1->sin_family - sin2->sin_family) + if ((rc = sin1->sin_family - sin2->sin_family) != 0) return(rc); - if (rc = sin1->sin_addr.s_addr - sin2->sin_addr.s_addr) + if ((rc = sin1->sin_addr.s_addr - sin2->sin_addr.s_addr) != 0) return(rc); /* * Compare the ATM addresses */ - if (rc = c1->aap_addr.address_format - c2->aap_addr.address_format) + if ((rc = c1->aap_addr.address_format - c2->aap_addr.address_format) != 0) return(rc); - if (rc = c1->aap_addr.address_length - c2->aap_addr.address_length) + if ((rc = c1->aap_addr.address_length - c2->aap_addr.address_length) != 0) return(rc); switch(c1->aap_addr.address_format) { case T_ATM_ABSENT: diff --git a/sbin/atm/atm/atm_subr.c b/sbin/atm/atm/atm_subr.c index 45711739ceb4..6c2cbb95e1f4 100644 --- a/sbin/atm/atm/atm_subr.c +++ b/sbin/atm/atm/atm_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: atm_subr.c,v 1.11 1998/07/09 22:24:03 johnc Exp $ + * @(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:46 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atm_subr.c,v 1.11 1998/07/09 22:24:03 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -55,10 +46,20 @@ static char *RCSid = "@(#) $Id: atm_subr.c,v 1.11 1998/07/09 22:24:03 johnc Exp #include #include #include +#include +#include #include +#include +#include +#include + #include "atm.h" +#ifndef lint +__RCSID("@(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:46 phk Exp $"); +#endif + /* * Table entry definition @@ -328,7 +329,7 @@ parse_ip_prefix(cp, op) char *cp; struct in_addr *op; { - int i, len; + int len; char *mp; struct in_addr ip_addr; @@ -494,7 +495,7 @@ compress_prefix_list(ipp, ilen) /* * m1 is longer */ - if (ip1->s_addr & m2->s_addr == + if ((ip1->s_addr & m2->s_addr) == ip2->s_addr) { ip1->s_addr = 0; m1->s_addr = 0; diff --git a/sbin/atm/fore_dnld/fore_dnld.c b/sbin/atm/fore_dnld/fore_dnld.c index fa4fc1a7dab1..ecf0567cebed 100644 --- a/sbin/atm/fore_dnld/fore_dnld.c +++ b/sbin/atm/fore_dnld/fore_dnld.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: fore_dnld.c,v 1.2 1998/10/30 16:17:43 dg Exp $ + * @(#) $Id: fore_dnld.c,v 1.3 1999/05/23 23:18:34 imp Exp $ * */ @@ -36,36 +36,37 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: fore_dnld.c,v 1.2 1998/10/30 16:17:43 dg Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include -#include #include +#include #include #include #include #include #include - #include #include #include +#include +#include +#include +#include +#include #if (defined(BSD) && (BSD >= 199103)) #include #else #include #endif /* !BSD */ +#include + +#ifndef lint +__RCSID("@(#) $Id: fore_dnld.c,v 1.3 1999/05/23 23:18:34 imp Exp $"); +#endif + #ifdef sun #define DEV_NAME "/dev/sbus%d" @@ -98,6 +99,7 @@ int lineptr = 0; Mon960 *Uart; +void delay(cnt) int cnt; { @@ -256,6 +258,7 @@ int dn; * Returns: * none */ +void xmit_to_i960 ( line, len, dn ) char *line; int len; @@ -670,10 +673,12 @@ u_char *ram; u_long start; u_long entry; } binhdr; +#ifdef sun union { u_long w; char c[4]; } w1, w2; +#endif int fd; int n; int cnt = 0; @@ -784,9 +789,8 @@ u_char *ram; */ { char cmd[80]; - char c; - sprintf ( cmd, "go %x\r\n", binhdr.entry ); + sprintf ( cmd, "go %lx\r\n", binhdr.entry ); xmit_to_i960 ( cmd, strlen ( cmd ), 0 ); @@ -805,6 +809,7 @@ u_char *ram; /* * Program to download previously processed microcode to series-200 host adapter */ +int main( argc, argv ) int argc; char *argv[]; @@ -817,7 +822,6 @@ char *argv[]; int i, err; int binary = 0; /* Send binary file */ caddr_t buf; /* Ioctl buffer */ - Atm_config *adp; /* Adapter config */ char bus_dev[80]; /* Bus device to mmap on */ struct atminfreq req; struct air_cfg_rsp *air; /* Config info response structure */ @@ -929,7 +933,11 @@ char *argv[]; /* * Create /dev name */ +#ifdef sun sprintf ( bus_dev, DEV_NAME, air->acp_busslot ); +#else + sprintf ( bus_dev, DEV_NAME ); +#endif /* * Setup signal handlers @@ -1197,6 +1205,8 @@ char *argv[]; } else sndfile = filename; break; + default: + break; } } else sndfile = objfile; diff --git a/sbin/atm/ilmid/ilmid.c b/sbin/atm/ilmid/ilmid.c index a1c6e348f9ae..7c2e0f388053 100644 --- a/sbin/atm/ilmid/ilmid.c +++ b/sbin/atm/ilmid/ilmid.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: ilmid.c,v 1.2 1999/01/20 00:56:21 mks Exp $ + * @(#) $Id: ilmid.c,v 1.3 1999/05/23 23:18:38 imp Exp $ * */ @@ -46,19 +46,6 @@ */ #include - -#ifndef lint -__RCSID("@(#) $Id: ilmid.c,v 1.2 1999/01/20 00:56:21 mks Exp $"); -#endif - -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -75,7 +62,20 @@ __RCSID("@(#) $Id: ilmid.c,v 1.2 1999/01/20 00:56:21 mks Exp $"); #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include + +#ifndef lint +__RCSID("@(#) $Id: ilmid.c,v 1.3 1999/05/23 23:18:38 imp Exp $"); +#endif + #define MAX_LEN 9180 diff --git a/usr.sbin/atm/atmarpd/atmarp_config.c b/usr.sbin/atm/atmarpd/atmarp_config.c index 5a4b78df78a5..03cc11c8e60b 100644 --- a/usr.sbin/atm/atmarpd/atmarp_config.c +++ b/usr.sbin/atm/atmarpd/atmarp_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: atmarp_config.c,v 1.5 1998/08/13 20:11:11 johnc Exp $ + * @(#) $Id: atmarp_config.c,v 1.1 1998/09/15 08:23:14 phk Exp $ * */ @@ -35,18 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atmarp_config.c,v 1.5 1998/08/13 20:11:11 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include -#include #include #include #include @@ -58,12 +48,22 @@ static char *RCSid = "@(#) $Id: atmarp_config.c,v 1.5 1998/08/13 20:11:11 johnc #include #include +#include #include +#include +#include +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" +#ifndef lint +__RCSID("@(#) $Id: atmarp_config.c,v 1.1 1998/09/15 08:23:14 phk Exp $"); +#endif + /* * Configure network interface for ATMARP cache synchronization @@ -85,7 +85,6 @@ atmarp_cfg_netif(netif) { int rc; Atmarp_intf *aip = (Atmarp_intf *)0; - Atm_addr_nsap *anp; /* * Get an ATMARP interface block diff --git a/usr.sbin/atm/atmarpd/atmarp_log.c b/usr.sbin/atm/atmarpd/atmarp_log.c index 8de541523fd2..f7201b0c0d67 100644 --- a/usr.sbin/atm/atmarpd/atmarp_log.c +++ b/usr.sbin/atm/atmarpd/atmarp_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: atmarp_log.c,v 1.1 1998/07/24 17:11:51 johnc Exp $ + * @(#) $Id: atmarp_log.c,v 1.1 1998/09/15 08:23:14 phk Exp $ * */ @@ -36,17 +36,8 @@ * */ - -#ifndef lint -static char *RCSid = "@(#) $Id: atmarp_log.c,v 1.1 1998/07/24 17:11:51 johnc Exp $"; -#endif - #include #include - -#include -#include -#include #include #include #include @@ -57,16 +48,23 @@ static char *RCSid = "@(#) $Id: atmarp_log.c,v 1.1 1998/07/24 17:11:51 johnc Exp #include #include +#include #include +#if __STDC__ +#include +#else +#include +#endif +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" -#if __STDC__ -#include -#else -#include +#ifndef lint +__RCSID("@(#) $Id: atmarp_log.c,v 1.1 1998/09/15 08:23:14 phk Exp $"); #endif diff --git a/usr.sbin/atm/atmarpd/atmarp_scsp.c b/usr.sbin/atm/atmarpd/atmarp_scsp.c index e0638211a27f..b0a01a7bd956 100644 --- a/usr.sbin/atm/atmarpd/atmarp_scsp.c +++ b/usr.sbin/atm/atmarpd/atmarp_scsp.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atmarp_scsp.c,v 1.6 1998/08/13 20:11:11 johnc Exp $ + * @(#) $Id: atmarp_scsp.c,v 1.1 1998/09/15 08:23:14 phk Exp $ * */ @@ -35,19 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atmarp_scsp.c,v 1.6 1998/08/13 20:11:11 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include -#include -#include #include #include #include @@ -60,12 +49,24 @@ static char *RCSid = "@(#) $Id: atmarp_scsp.c,v 1.6 1998/08/13 20:11:11 johnc Ex #include #include +#include +#include #include +#include +#include +#include +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" +#ifndef lint +__RCSID("@(#) $Id: atmarp_scsp.c,v 1.1 1998/09/15 08:23:14 phk Exp $"); +#endif + /* * Send the cache for a LIS to SCSP @@ -142,7 +143,6 @@ atmarp_scsp_cache(aip, msg) /* * Free the message */ -cache_done: if (smp) UM_FREE(smp); @@ -254,10 +254,9 @@ atmarp_scsp_update(aap, state) Atmarp *aap; int state; { - int i, len, rc = 0; + int rc = 0; Atmarp_intf *aip = aap->aa_intf; Scsp_if_msg *smp = (Scsp_if_msg *)0; - Scsp_atmarp_msg *sap; /* * Make sure the connection to SCSP is active @@ -455,7 +454,7 @@ int atmarp_scsp_read(aip) Atmarp_intf *aip; { - int len, rc; + int len, rc = 0; char *buff = (char *)0; Scsp_if_msg *smp; Scsp_if_msg_hdr msg_hdr; @@ -505,6 +504,7 @@ atmarp_scsp_read(aip) switch(smp->si_type) { case SCSP_CFG_RSP: if (smp->si_rc != SCSP_RSP_OK) { + rc = EINVAL; goto read_fail; } break; @@ -521,7 +521,6 @@ atmarp_scsp_read(aip) /* * Ignore Update Responses */ - rc = 0; break; default: atmarp_log(LOG_ERR, "Unexpected SCSP message received"); diff --git a/usr.sbin/atm/atmarpd/atmarp_subr.c b/usr.sbin/atm/atmarpd/atmarp_subr.c index 3cc20e05f5ba..51ba9fae5304 100644 --- a/usr.sbin/atm/atmarpd/atmarp_subr.c +++ b/usr.sbin/atm/atmarpd/atmarp_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: atmarp_subr.c,v 1.6 1998/08/13 20:11:11 johnc Exp $ + * @(#) $Id: atmarp_subr.c,v 1.1 1998/09/15 08:23:14 phk Exp $ * */ @@ -36,23 +36,13 @@ * */ - -#ifndef lint -static char *RCSid = "@(#) $Id: atmarp_subr.c,v 1.6 1998/08/13 20:11:11 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include -#include #include #include #include #include +#include #include #include #include @@ -64,12 +54,23 @@ static char *RCSid = "@(#) $Id: atmarp_subr.c,v 1.6 1998/08/13 20:11:11 johnc Ex #include #include +#include #include +#include +#include +#include +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" +#ifndef lint +__RCSID("@(#) $Id: atmarp_subr.c,v 1.1 1998/09/15 08:23:14 phk Exp $"); +#endif + /* * Find an ATMARP interface, given its socket number @@ -716,7 +717,7 @@ print_scsp_id(df, ip) { int i; - fprintf(df, "\t next: 0x%0x\n", (u_long)ip->next); + fprintf(df, "\t next: %p\n", ip->next); fprintf(df, "\t id_len: %d\n", ip->id_len); fprintf(df, "\t id: 0x"); for (i = 0; i < ip->id_len; i++) { @@ -774,10 +775,8 @@ print_atmarp_intf(df, aip) return; } - fprintf(df, "ATMARP network interface entry at 0x%0x\n", - (u_long)aip); - fprintf(df, "\tai_next: 0x%0x\n", - (u_long)aip->ai_next); + fprintf(df, "ATMARP network interface entry at %p\n", aip); + fprintf(df, "\tai_next: %p\n", aip->ai_next); fprintf(df, "\tai_intf: %s\n", aip->ai_intf); fprintf(df, "\tai_ip_addr: %s\n", format_ip_addr(&aip->ai_ip_addr)); @@ -816,8 +815,8 @@ print_atmarp_cache(df, aap) return; } - fprintf(df, "ATMARP entry at 0x%0x\n", (u_long)aap); - fprintf(df, "\taa_next: 0x%0x\n", (u_long)aap->aa_next); + fprintf(df, "ATMARP entry at %p\n", aap); + fprintf(df, "\taa_next: %p\n", aap->aa_next); fprintf(df, "\taa_dstip: %s\n", inet_ntoa(aap->aa_dstip)); fprintf(df, "\taa_dstatm: %s\n", format_atm_addr(&aap->aa_dstatm)); @@ -827,9 +826,9 @@ print_atmarp_cache(df, aap) print_scsp_cache_key(df, &aap->aa_key); fprintf(df, "\taa_oid:\n"); print_scsp_id(df, &aap->aa_oid); - fprintf(df, "\taa_seq: %d (0x%x)\n", aap->aa_seq, + fprintf(df, "\taa_seq: %ld (0x%lx)\n", aap->aa_seq, aap->aa_seq); - fprintf(df, "\taa_intf: 0x%0x\n", (u_long)aap->aa_intf); + fprintf(df, "\taa_intf: %p\n", aap->aa_intf); fprintf(df, "\taa_flags: "); if (aap->aa_flags & AAF_PERM) fprintf(df, "Permanent "); diff --git a/usr.sbin/atm/atmarpd/atmarp_timer.c b/usr.sbin/atm/atmarpd/atmarp_timer.c index f9c41cc5fe54..cee01eb91cf0 100644 --- a/usr.sbin/atm/atmarpd/atmarp_timer.c +++ b/usr.sbin/atm/atmarpd/atmarp_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: atmarp_timer.c,v 1.2 1998/08/13 20:11:12 johnc Exp $ + * @(#) $Id: atmarp_timer.c,v 1.1 1998/09/15 08:23:15 phk Exp $ * */ @@ -35,17 +35,8 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atmarp_timer.c,v 1.2 1998/08/13 20:11:12 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include #include #include #include @@ -57,12 +48,22 @@ static char *RCSid = "@(#) $Id: atmarp_timer.c,v 1.2 1998/08/13 20:11:12 johnc E #include #include +#include #include +#include +#include +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" +#ifndef lint +__RCSID("@(#) $Id: atmarp_timer.c,v 1.1 1998/09/15 08:23:15 phk Exp $"); +#endif + /* * Cache update timeout processing diff --git a/usr.sbin/atm/atmarpd/atmarp_var.h b/usr.sbin/atm/atmarpd/atmarp_var.h index e8dfa4b8e1b7..708dc63a63b4 100644 --- a/usr.sbin/atm/atmarpd/atmarp_var.h +++ b/usr.sbin/atm/atmarpd/atmarp_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: atmarp_var.h,v 1.6 1998/08/13 20:11:12 johnc Exp $ + * @(#) $Id: atmarp_var.h,v 1.1 1998/09/15 08:23:15 phk Exp $ * */ @@ -208,6 +208,7 @@ extern void atmarp_clear_marks __P(()); extern int atmarp_is_server __P((Atmarp_intf *)); extern int atmarp_if_ready __P((Atmarp_intf *)); extern Atmarp * atmarp_copy_cache_entry __P((struct air_arp_rsp *)); +extern int atmarp_update_kernel __P((Atmarp *)); extern void atmarp_get_updated_cache __P(()); extern void atmarp_process_cache_entry __P((struct air_arp_rsp *)); extern void print_atmarp_intf __P((FILE *, Atmarp_intf *)); diff --git a/usr.sbin/atm/atmarpd/atmarpd.c b/usr.sbin/atm/atmarpd/atmarpd.c index 72ebb52b4bba..befa0712d6a2 100644 --- a/usr.sbin/atm/atmarpd/atmarpd.c +++ b/usr.sbin/atm/atmarpd/atmarpd.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atmarpd.c,v 1.5 1998/08/13 20:11:13 johnc Exp $ + * @(#) $Id: atmarpd.c,v 1.1 1998/09/15 08:23:15 phk Exp $ * */ @@ -35,22 +35,13 @@ * */ -#ifndef lint -static char *RCSid = "@(#) $Id: atmarpd.c,v 1.5 1998/08/13 20:11:13 johnc Exp $"; -#endif - #include #include - -#include -#include -#include -#include -#include #include +#include +#include #include #include -#include #include #include #include @@ -58,12 +49,23 @@ static char *RCSid = "@(#) $Id: atmarpd.c,v 1.5 1998/08/13 20:11:13 johnc Exp $" #include #include +#include +#include #include +#include +#include +#include +#include + #include "../scspd/scsp_msg.h" #include "../scspd/scsp_if.h" #include "../scspd/scsp_var.h" #include "atmarp_var.h" +#ifndef lint +__RCSID("@(#) $Id: atmarpd.c,v 1.1 1998/09/15 08:23:15 phk Exp $"); +#endif + /* * Global variables @@ -78,7 +80,6 @@ char *atmarp_log_file_name = (char *)0; Harp_timer cache_timer, perm_timer; - /* * Print a usage message * @@ -119,7 +120,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]; @@ -317,6 +318,7 @@ start_daemon() * none * */ +int main(argc, argv) int argc; char *argv[]; @@ -387,7 +389,7 @@ main(argc, argv) if (harp_timer_exec) { timer_proc(); continue; - } else if (errno = EINTR) { + } else if (errno == EINTR) { continue; } else { atmarp_log(LOG_ERR, "Select failed"); diff --git a/usr.sbin/atm/scspd/scsp_cafsm.c b/usr.sbin/atm/scspd/scsp_cafsm.c index b9d2b512ca9e..6741dde85335 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 #include - -#include -#include -#include -#include #include #include #include @@ -59,11 +49,21 @@ static char *RCSid = "@(#) $Id: scsp_cafsm.c,v 1.7 1998/08/21 18:08:23 johnc Exp #include #include +#include #include +#include +#include +#include +#include + #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 99eca7af628a..9d86b58a5271 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 #include - -#include -#include -#include -#include -#include #include #include #include @@ -58,11 +48,23 @@ static char *RCSid = "@(#) $Id: scsp_config.c,v 1.3 1998/08/13 20:11:14 johnc Ex #include #include +#include #include +#include +#include +#include +#include + #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 7b77ae6f1eea..c930d8cd683a 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 #include - -#include -#include -#include -#include -#include #include #include #include @@ -58,12 +48,24 @@ static char *RCSid = "@(#) $Id: scsp_config_lex.c,v 1.3 1998/08/13 20:11:14 john #include #include +#include +#include #include +#include +#include +#include +#include + #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 4c02de284471..e5ef706f5ee8 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 #include - -#include -#include -#include -#include #include #include #include @@ -61,15 +51,26 @@ static char *RCSid = "@(#) $Id: scsp_config_parse.y,v 1.2 1998/07/24 17:12:14 jo #include #include -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - #if __STDC__ #include #else #include #endif +#include +#include +#include +#include + +#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 29538048da90..8dae5a17c813 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 #include - -#include -#include -#include #include #include #include @@ -57,11 +48,19 @@ static char *RCSid = "@(#) $Id: scsp_hfsm.c,v 1.4 1998/07/16 15:59:25 johnc Exp #include #include +#include #include +#include +#include + #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 19309908e513..e9ced0a43186 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 #include - -#include -#include -#include -#include #include #include #include @@ -59,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_if.c,v 1.5 1998/08/13 20:11:14 johnc Exp $" #include #include +#include #include +#include +#include +#include +#include +#include + #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 21d0a073bed8..86cc3bedc51c 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 #include - -#include -#include -#include -#include #include +#include #include #include -#include #include #include #include @@ -58,11 +49,21 @@ static char *RCSid = "@(#) $Id: scsp_input.c,v 1.3 1998/08/13 20:11:15 johnc Exp #include #include +#include #include +#include +#include +#include +#include + #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 9088078af33b..21f422215bcb 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 #include - -#include -#include -#include -#include #include #include #include @@ -59,16 +49,26 @@ static char *RCSid = "@(#) $Id: scsp_log.c,v 1.2 1998/07/12 20:49:36 johnc Exp $ #include #include +#include #include -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - #if __STDC__ #include #else #include #endif +#include +#include +#include +#include +#include + +#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 bed2918522e9..9db61ba45083 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 #include - -#include -#include -#include -#include #include #include #include @@ -59,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_msg.c,v 1.6 1998/08/21 18:08:24 johnc Exp $ #include #include +#include #include +#include +#include +#include +#include + #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 10ee4930e635..7f8f1cd9e27e 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 #include - -#include -#include -#include -#include #include +#include #include #include -#include #include #include #include @@ -57,12 +48,23 @@ static char *RCSid = "@(#) $Id: scsp_output.c,v 1.2 1998/07/12 20:49:45 johnc Ex #include #include #include - + +#include #include +#include +#include +#include +#include +#include + #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 46550772cf44..89b69a513e69 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 #include - -#include -#include -#include -#include -#include #include #include #include @@ -60,11 +49,22 @@ static char *RCSid = "@(#) $Id: scsp_print.c,v 1.5 1998/08/13 20:11:16 johnc Exp #include #include +#include #include +#include +#include +#include +#include +#include + #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, &->sa_key); fprintf(fp, "%sOriginator ID:\n", indent); print_scsp_id(fp, &->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 83f41cd5f75a..aa6e040175c4 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 #include - -#include -#include -#include -#include -#include -#include #include #include #include @@ -61,11 +49,23 @@ static char *RCSid = "@(#) $Id: scsp_socket.c,v 1.6 1998/08/21 18:08:24 johnc Ex #include #include +#include +#include #include +#include +#include +#include +#include +#include + #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 c14195bd4a0e..354069478e5d 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 #include - -#include -#include -#include -#include -#include #include #include #include @@ -61,12 +50,23 @@ static char *RCSid = "@(#) $Id: scsp_subr.c,v 1.5 1998/08/13 20:11:16 johnc Exp #include #include #include - + +#include #include +#include +#include +#include +#include +#include + #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 0ec6169dade4..d61dad30dd9f 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 #include - -#include -#include -#include #include #include #include @@ -54,12 +46,20 @@ static char *RCSid = "@(#) $Id: scsp_timer.c,v 1.2 1998/07/16 15:59:50 johnc Exp #include #include #include - + +#include #include +#include +#include + #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 ba383d5fc0d1..707b688b62f5 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 74fe868addb8..932fdef600a5 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 #include - -#include -#include -#include -#include -#include #include +#include +#include #include #include -#include #include #include #include @@ -60,11 +50,22 @@ static char *RCSid = "@(#) $Id: scspd.c,v 1.6 1998/08/21 18:08:25 johnc Exp $"; #include #include +#include +#include #include +#include +#include +#include +#include + #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 @@ start_daemon() * 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); } }