From 56acf6178a1e7b3c75577e6168af324ddba7e056 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Thu, 24 Jul 2003 09:13:03 +0000 Subject: [PATCH] Constify the arguments to several pdu_print functions. --- sys/netatm/atm_device.c | 8 ++------ sys/netatm/atm_subr.c | 11 ++++------- sys/netatm/atm_var.h | 5 +++-- sys/netatm/uni/sscf_uni.c | 6 +----- sys/netatm/uni/sscf_uni_var.h | 3 ++- sys/netatm/uni/sscop_pdu.c | 6 +----- sys/netatm/uni/sscop_var.h | 3 ++- sys/netatm/uni/uniarp_input.c | 6 +----- sys/netatm/uni/uniip_var.h | 3 ++- 9 files changed, 18 insertions(+), 33 deletions(-) diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c index cbfdaa6c8c7d..34c62539a302 100644 --- a/sys/netatm/atm_device.c +++ b/sys/netatm/atm_device.c @@ -804,11 +804,8 @@ atm_unload() * */ void -atm_dev_pdu_print(cup, cvp, m, msg) - Cmn_unit *cup; - Cmn_vcc *cvp; - KBuffer *m; - char *msg; +atm_dev_pdu_print(const Cmn_unit *cup, const Cmn_vcc *cvp, + const KBuffer *m, const char *msg) { char buf[128]; @@ -818,4 +815,3 @@ atm_dev_pdu_print(cup, cvp, m, msg) atm_pdu_print(m, buf); } - diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c index 4e72a035085a..0a6b55b55144 100644 --- a/sys/netatm/atm_subr.c +++ b/sys/netatm/atm_subr.c @@ -575,23 +575,21 @@ atm_intr(struct mbuf *m) * */ void -atm_pdu_print(m, msg) - KBuffer *m; - char *msg; +atm_pdu_print(const KBuffer *m, const char *msg) { - caddr_t cp; + const u_char *cp; int i; char c = ' '; printf("%s:", msg); while (m) { - KB_DATASTART(m, cp, caddr_t); + KB_DATASTART(m, cp, const u_char *); printf("%cbfr=%p data=%p len=%d: ", c, m, cp, KB_LEN(m)); c = '\t'; if (atm_print_data) { for (i = 0; i < KB_LEN(m); i++) { - printf("%2x ", (u_char)*cp++); + printf("%2x ", *cp++); } printf("\n"); } else { @@ -600,4 +598,3 @@ atm_pdu_print(m, msg) m = KB_NEXT(m); } } - diff --git a/sys/netatm/atm_var.h b/sys/netatm/atm_var.h index 022f2e3fc923..c4c632a5cad1 100644 --- a/sys/netatm/atm_var.h +++ b/sys/netatm/atm_var.h @@ -109,7 +109,8 @@ void * atm_dev_alloc(u_int, u_int, u_int); void atm_dev_free(volatile void *); KBuffer * atm_dev_compress(KBuffer *); Cmn_vcc * atm_dev_vcc_find(Cmn_unit *, u_int, u_int, u_int); -void atm_dev_pdu_print(Cmn_unit *, Cmn_vcc *, KBuffer *, char *); +void atm_dev_pdu_print(const Cmn_unit *, const Cmn_vcc *, + const KBuffer *, const char *); /* atm_if.c */ int atm_physif_register(Cmn_unit *, char *, @@ -172,6 +173,6 @@ int atm_untimeout(struct atm_time *); int atm_stack_enq(int, void (*)(int, void *, intptr_t, intptr_t), void *, Atm_connvc *, intptr_t, intptr_t); void atm_stack_drain(void); -void atm_pdu_print(KBuffer *, char *); +void atm_pdu_print(const KBuffer *, const char *); #endif /* _KERNEL */ #endif /* _NETATM_ATM_VAR_H */ diff --git a/sys/netatm/uni/sscf_uni.c b/sys/netatm/uni/sscf_uni.c index 47ed863a4eed..8911ee911565 100644 --- a/sys/netatm/uni/sscf_uni.c +++ b/sys/netatm/uni/sscf_uni.c @@ -305,10 +305,7 @@ sscf_uni_abort(uvp, msg) * */ void -sscf_uni_pdu_print(uvp, m, msg) - struct univcc *uvp; - KBuffer *m; - char *msg; +sscf_uni_pdu_print(const struct univcc *uvp, const KBuffer *m, const char *msg) { char buf[128]; struct vccb *vcp; @@ -318,4 +315,3 @@ sscf_uni_pdu_print(uvp, m, msg) msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } - diff --git a/sys/netatm/uni/sscf_uni_var.h b/sys/netatm/uni/sscf_uni_var.h index 4eb938aaa4e4..934bdaa0be58 100644 --- a/sys/netatm/uni/sscf_uni_var.h +++ b/sys/netatm/uni/sscf_uni_var.h @@ -95,7 +95,8 @@ struct univcc { int sscf_uni_start(void); int sscf_uni_stop(void); void sscf_uni_abort(struct univcc *, char *); -void sscf_uni_pdu_print(struct univcc *, KBuffer *, char *); +void sscf_uni_pdu_print(const struct univcc *, + const KBuffer *, const char *); /* sscf_uni_lower.c */ void sscf_uni_lower(int, void *, intptr_t, intptr_t); diff --git a/sys/netatm/uni/sscop_pdu.c b/sys/netatm/uni/sscop_pdu.c index e66606522090..eeed1a033b25 100644 --- a/sys/netatm/uni/sscop_pdu.c +++ b/sys/netatm/uni/sscop_pdu.c @@ -1232,10 +1232,7 @@ sscop_send_ud(sop, m) * */ void -sscop_pdu_print(sop, m, msg) - struct sscop *sop; - KBuffer *m; - char *msg; +sscop_pdu_print(const struct sscop *sop, const KBuffer *m, const char *msg) { char buf[128]; struct vccb *vcp; @@ -1245,4 +1242,3 @@ sscop_pdu_print(sop, m, msg) "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } - diff --git a/sys/netatm/uni/sscop_var.h b/sys/netatm/uni/sscop_var.h index e4ddc42af553..9ba9ca6a8d0c 100644 --- a/sys/netatm/uni/sscop_var.h +++ b/sys/netatm/uni/sscop_var.h @@ -168,7 +168,8 @@ int sscop_send_poll(struct sscop *); int sscop_send_stat(struct sscop *, sscop_seq); int sscop_send_ustat(struct sscop *, sscop_seq); int sscop_send_ud(struct sscop *, KBuffer *); -void sscop_pdu_print(struct sscop *, KBuffer *, char *); +void sscop_pdu_print(const struct sscop *, + const KBuffer *, const char *); /* sscop_sigaa.c */ void sscop_estreq_idle(struct sscop *, intptr_t, intptr_t); diff --git a/sys/netatm/uni/uniarp_input.c b/sys/netatm/uni/uniarp_input.c index 2beda86e9d8b..b729c630be88 100644 --- a/sys/netatm/uni/uniarp_input.c +++ b/sys/netatm/uni/uniarp_input.c @@ -852,10 +852,7 @@ proc_inarp_rsp(ivp, m) * */ void -uniarp_pdu_print(ivp, m, msg) - struct ipvcc *ivp; - KBuffer *m; - char *msg; +uniarp_pdu_print(const struct ipvcc *ivp, const KBuffer *m, const char *msg) { char buf[128]; struct vccb *vcp; @@ -865,4 +862,3 @@ uniarp_pdu_print(ivp, m, msg) "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } - diff --git a/sys/netatm/uni/uniip_var.h b/sys/netatm/uni/uniip_var.h index 768790a4718a..7d7ef3d4774d 100644 --- a/sys/netatm/uni/uniip_var.h +++ b/sys/netatm/uni/uniip_var.h @@ -281,7 +281,8 @@ int uniarp_validate_ip(struct uniip *, struct in_addr *, u_int); /* uniarp_input.c */ void uniarp_cpcs_data(void *, KBuffer *); -void uniarp_pdu_print(struct ipvcc *, KBuffer *, char *); +void uniarp_pdu_print(const struct ipvcc *, + const KBuffer *, const char *); /* uniarp_output.c */ int uniarp_arp_req(struct uniip *, struct in_addr *);