Add #include "opt_iso.h" if not already there.
Make these compile cleanly when TPCONS is defined.
This commit is contained in:
parent
961e6cb2e5
commit
fd2a977729
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_cons.c,v 1.16 2004/04/19 05:16:45 matt Exp $ */
|
||||
/* $NetBSD: if_cons.c,v 1.17 2004/04/21 23:19:49 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -64,7 +64,9 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(1, "$NetBSD: if_cons.c,v 1.16 2004/04/19 05:16:45 matt Exp $");
|
||||
__KERNEL_RCSID(1, "$NetBSD: if_cons.c,v 1.17 2004/04/21 23:19:49 matt Exp $");
|
||||
|
||||
#include "opt_iso.h"
|
||||
|
||||
#ifdef TPCONS
|
||||
#ifdef _KERNEL
|
||||
@ -159,15 +161,15 @@ unsigned LAST_CALL_PCB;
|
||||
|
||||
Static int make_partial_x25_packet (struct isopcb *, struct pklcd *);
|
||||
Static int NSAPtoDTE (struct sockaddr_iso *, struct sockaddr_x25 *);
|
||||
Static int FACILtoNSAP (struct sockaddr_iso *, u_char *);
|
||||
Static int FACILtoNSAP (struct sockaddr_iso *, const u_char *);
|
||||
Static void init_siso (struct sockaddr_iso *);
|
||||
Static int DTEtoNSAP (struct sockaddr_iso *, struct sockaddr_x25 *);
|
||||
Static int parse_facil (struct pklcd *, struct isopcb *, caddr_t, u_char);
|
||||
|
||||
/* protosw pointers for getting to higher layer */
|
||||
Static struct protosw *CLNP_proto;
|
||||
Static struct protosw *TP_proto;
|
||||
Static struct protosw *X25_proto;
|
||||
Static const struct protosw *CLNP_proto;
|
||||
Static const struct protosw *TP_proto;
|
||||
Static const struct protosw *X25_proto;
|
||||
|
||||
extern struct isopcb tp_isopcb; /* chain of all TP pcbs */
|
||||
|
||||
@ -195,7 +197,7 @@ nibble_copy(char *src_octet, unsigned int src_nibble, char *dst_octet,
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("nibble_copy ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n",
|
||||
printf("nibble_copy ( %p, %#x, %p, %#x %#x)\n",
|
||||
src_octet, src_nibble, dst_octet, dst_nibble, len);
|
||||
}
|
||||
#endif
|
||||
@ -242,7 +244,7 @@ nibble_match(char *src_octet, unsigned int src_nibble, char *dst_octet,
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("nibble_match ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n",
|
||||
printf("nibble_match ( %p, %#x, %p, %#x %#x)\n",
|
||||
src_octet, src_nibble, dst_octet, dst_nibble, len);
|
||||
}
|
||||
#endif
|
||||
@ -290,8 +292,8 @@ cons_init(void)
|
||||
TP_proto = pffindproto(AF_ISO, ISOPROTO_TP0, SOCK_SEQPACKET);
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CCONS]) {
|
||||
printf("cons_init end : cnlp_proto 0x%x cons proto 0x%x tp proto 0x%x\n",
|
||||
CLNP_proto, X25_proto, TP_proto);
|
||||
printf("cons_init end : cnlp_proto %p cons proto %p"
|
||||
" tp proto %p\n", CLNP_proto, X25_proto, TP_proto);
|
||||
}
|
||||
#endif
|
||||
#ifdef notdef
|
||||
@ -393,7 +395,7 @@ cons_connect(struct isopcb *isop)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CCONN]) {
|
||||
printf("cons_connect(0x%x): ", isop);
|
||||
printf("cons_connect(%p): ", isop);
|
||||
dump_isoaddr(isop->isop_faddr);
|
||||
printf("myaddr: ");
|
||||
dump_isoaddr(isop->isop_laddr);
|
||||
@ -406,7 +408,7 @@ cons_connect(struct isopcb *isop)
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CCONN]) {
|
||||
printf(
|
||||
"calling make_partial_x25_packet( 0x%x, 0x%x, 0x%x)\n",
|
||||
"calling make_partial_x25_packet( %p, %p, %#x)\n",
|
||||
&lcp->lcd_faddr, &lcp->lcd_laddr,
|
||||
isop->isop_socket->so_proto->pr_protocol);
|
||||
}
|
||||
@ -554,7 +556,7 @@ make_partial_x25_packet(struct isopcb *isop, struct pklcd *lcp)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CCONN]) {
|
||||
printf("make_partial_x25_packet(0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n",
|
||||
printf("make_partial_x25_packet(%p, %p, %#x, %p, %#x)\n",
|
||||
isop->isop_laddr, isop->isop_faddr, proto, m, flag);
|
||||
}
|
||||
#endif
|
||||
@ -583,7 +585,7 @@ make_partial_x25_packet(struct isopcb *isop, struct pklcd *lcp)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("make_partial calling: ptr 0x%x, len 0x%x\n", ptr,
|
||||
printf("make_partial calling: ptr %p, len %#x\n", ptr,
|
||||
isop->isop_laddr->siso_addr.isoa_len);
|
||||
}
|
||||
#endif
|
||||
@ -606,7 +608,7 @@ make_partial_x25_packet(struct isopcb *isop, struct pklcd *lcp)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("make_partial called: ptr 0x%x, len 0x%x\n", ptr,
|
||||
printf("make_partial called: ptr %p, len %#x\n", ptr,
|
||||
isop->isop_faddr->siso_addr.isoa_len);
|
||||
}
|
||||
#endif
|
||||
@ -636,10 +638,10 @@ make_partial_x25_packet(struct isopcb *isop, struct pklcd *lcp)
|
||||
if (argo_debug[D_CDUMP_REQ]) {
|
||||
int i;
|
||||
|
||||
printf("ECN_CONNECT DATA buf 0x%x len %d (0x%x)\n",
|
||||
printf("ECN_CONNECT DATA buf %p len %d (%#x)\n",
|
||||
buf, buflen, buflen);
|
||||
for (i = 0; i < buflen;) {
|
||||
printf("+%d: %x %x %x %x %x %x %x %x\n",
|
||||
printf("+%d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
i,
|
||||
*(buf + i), *(buf + i + 1), *(buf + i + 2), *(buf + i + 3),
|
||||
*(buf + i + 4), *(buf + i + 5), *(buf + i + 6), *(buf + i + 7));
|
||||
@ -649,7 +651,7 @@ make_partial_x25_packet(struct isopcb *isop, struct pklcd *lcp)
|
||||
#endif
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("make_partial returns buf 0x%x size 0x%x bytes\n",
|
||||
printf("make_partial returns buf %p size %#x bytes\n",
|
||||
mtod(m, caddr_t), buflen);
|
||||
}
|
||||
#endif
|
||||
@ -756,15 +758,14 @@ NSAPtoDTE(struct sockaddr_iso *siso, struct sockaddr_x25 *sx25)
|
||||
*/
|
||||
|
||||
Static int
|
||||
FACILtoNSAP(u_char *buf, struct sockaddr_iso *addr)
|
||||
FACILtoNSAP(struct sockaddr_iso *addr, const u_char *buf)
|
||||
{
|
||||
int len_in_nibbles = *++buf & 0x3f;
|
||||
u_char buf_len = (len_in_nibbles + 1) >> 1;; /* in bytes */
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("FACILtoNSAP( 0x%x, 0x%x, 0x%x )\n",
|
||||
buf, buf_len, addr);
|
||||
printf("FACILtoNSAP( %p, %#x, %p )\n", buf, buf_len, addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -867,7 +868,7 @@ parse_facil(struct pklcd *lcp, struct isopcb *isop, caddr_t buf, u_char buf_len)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_CADDR]) {
|
||||
printf("parse_facil(0x%x, 0x%x, 0x%x, 0x%x)\n",
|
||||
printf("parse_facil(%p, %p, %p, %#x)\n",
|
||||
lcp, isop, buf, buf_len);
|
||||
dump_buf(buf, buf_len);
|
||||
}
|
||||
@ -942,8 +943,8 @@ parse_facil(struct pklcd *lcp, struct isopcb *isop, caddr_t buf, u_char buf_len)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf(
|
||||
"BOGUS FACILITY CODE facil_lim 0x%x facil_len %d, ptr 0x%x *ptr 0x%x\n",
|
||||
printf("BOGUS FACILITY CODE facil_lim %p"
|
||||
" facil_len %d, ptr %p *ptr %#x\n",
|
||||
facil_lim, facil_len, ptr - 1, ptr[-1]);
|
||||
/*
|
||||
* facil that we don't handle return E_CO_HLI_REJI;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tp_cons.c,v 1.17 2004/04/19 05:16:46 matt Exp $ */
|
||||
/* $NetBSD: tp_cons.c,v 1.18 2004/04/21 23:19:49 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -68,7 +68,7 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_cons.c,v 1.17 2004/04/19 05:16:46 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_cons.c,v 1.18 2004/04/21 23:19:49 matt Exp $");
|
||||
|
||||
#include "opt_iso.h"
|
||||
|
||||
@ -111,9 +111,6 @@ __KERNEL_RCSID(0, "$NetBSD: tp_cons.c,v 1.17 2004/04/19 05:16:46 matt Exp $");
|
||||
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
#include <netiso/if_cons.c>
|
||||
|
||||
|
||||
/*
|
||||
* CALLED FROM:
|
||||
* tp_route_to() for PRU_CONNECT
|
||||
@ -189,10 +186,10 @@ tpcons_ctlinput(int cmd, struct sockaddr *siso, void *v)
|
||||
printf("FAKE ACK seq 0x%x cdt 1\n", seq);
|
||||
}
|
||||
#endif
|
||||
E.TP_ATTR(AK_TPDU).e_cdt = 1;
|
||||
E.TP_ATTR(AK_TPDU).e_seq = seq;
|
||||
E.TP_ATTR(AK_TPDU).e_subseq = 0;
|
||||
E.TP_ATTR(AK_TPDU).e_fcc_present = 0;
|
||||
E.ev_union.EV_AK_TPDU.e_cdt = 1;
|
||||
E.ev_union.EV_AK_TPDU.e_seq = seq;
|
||||
E.ev_union.EV_AK_TPDU.e_subseq = 0;
|
||||
E.ev_union.EV_AK_TPDU.e_fcc_present = 0;
|
||||
error = DoEvent(AK_TPDU);
|
||||
if (error) {
|
||||
tpcb->tp_sock->so_error = error;
|
||||
@ -238,7 +235,7 @@ tpcons_input(struct mbuf *m, ...)
|
||||
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_TPINPUT]) {
|
||||
printf("tpcons_input before tp_input(m 0x%x)\n", m);
|
||||
printf("tpcons_input before tp_input(m %p)\n", m);
|
||||
dump_buf(m, 12 + m->m_len);
|
||||
}
|
||||
#endif
|
||||
@ -277,7 +274,7 @@ tpcons_output(struct mbuf *m0, ...)
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_EMIT]) {
|
||||
printf(
|
||||
"tpcons_output(isop 0x%x, m 0x%x, len 0x%x socket 0x%x\n",
|
||||
"tpcons_output(isop=%p, m=%p, len=%#x socket=%p\n",
|
||||
isop, m0, datalen, isop->isop_socket);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tp_emit.c,v 1.19 2004/04/19 05:16:46 matt Exp $ */
|
||||
/* $NetBSD: tp_emit.c,v 1.20 2004/04/21 23:19:49 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -72,7 +72,9 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_emit.c,v 1.19 2004/04/19 05:16:46 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_emit.c,v 1.20 2004/04/21 23:19:49 matt Exp $");
|
||||
|
||||
#include "opt_iso.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -1067,7 +1069,7 @@ tp_error_emit(
|
||||
lcp->lcd_flags |= X25_DG_CIRCUIT;
|
||||
#ifdef ARGO_DEBUG
|
||||
if (argo_debug[D_ERROR_EMIT]) {
|
||||
printf("OUTPUT: dutype 0x%x channel 0x%x\n",
|
||||
printf("OUTPUT: dutype %#x channel %p\n",
|
||||
dutype, cons_channel);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tp_input.c,v 1.19 2004/04/20 02:13:26 matt Exp $ */
|
||||
/* $NetBSD: tp_input.c,v 1.20 2004/04/21 23:19:49 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -79,7 +79,9 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_input.c,v 1.19 2004/04/20 02:13:26 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tp_input.c,v 1.20 2004/04/21 23:19:49 matt Exp $");
|
||||
|
||||
#include "opt_iso.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
Loading…
Reference in New Issue
Block a user