diff options
-rw-r--r-- | sys/netipx/ipx.h | 20 | ||||
-rw-r--r-- | sys/netipx/ipx_pcb.h | 6 | ||||
-rw-r--r-- | sys/netipx/ipx_proto.c | 16 | ||||
-rw-r--r-- | sys/netipx/ipx_usrreq.c | 42 | ||||
-rw-r--r-- | sys/netipx/ipx_var.h | 16 | ||||
-rw-r--r-- | sys/netipx/spx.h | 3 | ||||
-rw-r--r-- | sys/netipx/spx_usrreq.c | 22 | ||||
-rw-r--r-- | sys/netipx/spx_var.h | 13 |
8 files changed, 118 insertions, 20 deletions
diff --git a/sys/netipx/ipx.h b/sys/netipx/ipx.h index 278087be34b..0ee082d6d21 100644 --- a/sys/netipx/ipx.h +++ b/sys/netipx/ipx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx.h,v 1.3 1996/10/26 09:40:30 mickey Exp $ */ +/* $OpenBSD: ipx.h,v 1.4 1996/11/25 08:19:58 mickey Exp $ */ /*- * @@ -168,6 +168,23 @@ struct ipx { #define ipx_wildhost(x) (((x).ipx_host.s_host[0]==0xffff) && \ ((x).ipx_host.s_host[1]==0xffff) && ((x).ipx_host.s_host[2]==0xffff)) +/* + * Definitions for inet sysctl operations. + * + * Third level is protocol number. + * Fourth level is desired variable within that protocol. + */ +#define IPXPROTO_MAXID (IPXPROTO_SPX + 1) /* don't list to IPPROTO_MAX */ + +#define CTL_IPXPROTO_NAMES { \ + { "ipx", CTLTYPE_NODE }, \ + { 0, 0 }, \ + { 0, 0 }, \ + { 0, 0 }, \ + { 0, 0 }, \ + { "spx", CTLTYPE_NODE }, \ +}; + #ifdef _KERNEL #define satosipx(a) ((struct sockaddr_ipx *)(a)) @@ -212,6 +229,7 @@ void ipx_undo_route __P((struct route *ro)); int ipx_usrreq __P((struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control)); void ipx_watch_output __P((struct mbuf *m, struct ifnet *ifp)); +int ipx_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); #ifdef IPXDEBUG struct ipx_addr ipx_addr __P((const char *)); diff --git a/sys/netipx/ipx_pcb.h b/sys/netipx/ipx_pcb.h index 5e8b1dca79d..c55700088e4 100644 --- a/sys/netipx/ipx_pcb.h +++ b/sys/netipx/ipx_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_pcb.h,v 1.2 1996/10/26 09:34:53 mickey Exp $ */ +/* $OpenBSD: ipx_pcb.h,v 1.3 1996/11/25 08:20:00 mickey Exp $ */ /*- * @@ -85,8 +85,8 @@ struct ipxpcbtable { /* * Nominal space allocated to a IPX socket. */ -#define IPXSNDQ 2048 -#define IPXRCVQ 2048 +#define IPXSNDQ 16384 +#define IPXRCVQ 40960 #ifdef _KERNEL extern struct ipxpcbtable ipxcbtable, ipxrawcbtable; /* head of list */ diff --git a/sys/netipx/ipx_proto.c b/sys/netipx/ipx_proto.c index 6849d859fc4..6c6494acb85 100644 --- a/sys/netipx/ipx_proto.c +++ b/sys/netipx/ipx_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_proto.c,v 1.2 1996/10/26 09:34:54 mickey Exp $ */ +/* $OpenBSD: ipx_proto.c,v 1.3 1996/11/25 08:20:00 mickey Exp $ */ /*- * @@ -60,38 +60,38 @@ struct protosw ipxsw[] = { { 0, &ipxdomain, 0, 0, 0, ipx_output, 0, 0, 0, - ipx_init, 0, 0, 0 + ipx_init, 0, 0, 0, ipx_sysctl }, { SOCK_DGRAM, &ipxdomain, 0, PR_ATOMIC|PR_ADDR, 0, 0, ipx_ctlinput, ipx_ctloutput, ipx_usrreq, - 0, 0, 0, 0 + 0, 0, 0, 0, ipx_sysctl }, { SOCK_STREAM, &ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD, spx_input, 0, spx_ctlinput, spx_ctloutput, spx_usrreq, - spx_init, spx_fasttimo, spx_slowtimo, 0 + spx_init, spx_fasttimo, spx_slowtimo, 0, spx_sysctl }, { SOCK_SEQPACKET,&ipxdomain, IPXPROTO_SPX, PR_CONNREQUIRED|PR_WANTRCVD|PR_ATOMIC, spx_input, 0, spx_ctlinput, spx_ctloutput, spx_usrreq_sp, - 0, 0, 0, 0 + 0, 0, 0, 0, spx_sysctl }, { SOCK_RAW, &ipxdomain, IPXPROTO_RAW, PR_ATOMIC|PR_ADDR, ipx_input, ipx_output, 0, ipx_ctloutput, ipx_raw_usrreq, - 0, 0, 0, 0 + 0, 0, 0, 0, ipx_sysctl }, { SOCK_RAW, &ipxdomain, IPXPROTO_ERROR, PR_ATOMIC|PR_ADDR, 0, ipx_output, ipx_ctlinput, ipx_ctloutput, ipx_raw_usrreq, - 0, 0, 0, 0 + 0, 0, 0, 0, ipx_sysctl }, #ifdef IPTUNNEL { SOCK_RAW, &ipxdomain, IPPROTO_IPX, PR_ATOMIC|PR_ADDR, iptun_input, rip_output, iptun_ctlinput, 0, rip_usrreq, - 0, 0, 0, 0, + 0, 0, 0, 0, ipx_sysctl, }, #endif }; diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index d6c3446a519..ad39a273dfe 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_usrreq.c,v 1.2 1996/10/26 09:34:55 mickey Exp $ */ +/* $OpenBSD: ipx_usrreq.c,v 1.3 1996/11/25 08:20:01 mickey Exp $ */ /*- * @@ -43,6 +43,7 @@ #include <sys/param.h> #include <sys/queue.h> #include <sys/systm.h> +#include <sys/kernel.h> #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/protosw.h> @@ -50,6 +51,9 @@ #include <sys/socketvar.h> #include <sys/errno.h> #include <sys/stat.h> +#include <sys/proc.h> +#include <vm/vm.h> +#include <sys/sysctl.h> #include <net/if.h> #include <net/route.h> @@ -71,6 +75,9 @@ int noipxRoute; +int ipxsendspace = IPXSNDQ; +int ipxrecvspace = IPXRCVQ; + /* * This may also be called for raw listeners. */ @@ -291,7 +298,8 @@ ipx_output(m0, va_alist) } ipxp->ipxp_lastdst = ipx->ipx_dna; #endif /* ancient_history */ - if (noipxRoute) ro = 0; + if (noipxRoute) + ro = 0; return (ipx_outputfl(m, ro, so->so_options & SO_BROADCAST)); } @@ -442,7 +450,7 @@ ipx_usrreq(so, req, m, nam, control) error = ipx_pcballoc(so, &ipxcbtable); if (error) break; - error = soreserve(so, (u_long) 2048, (u_long) 2048); + error = soreserve(so, ipxsendspace, ipxrecvspace); if (error) break; break; @@ -574,6 +582,7 @@ release: m_freem(m); return (error); } + /*ARGSUSED*/ int ipx_raw_usrreq(so, req, m, nam, control) @@ -596,7 +605,7 @@ ipx_raw_usrreq(so, req, m, nam, control) error = ipx_pcballoc(so, &ipxrawcbtable); if (error) break; - error = soreserve(so, (u_long) 2048, (u_long) 2048); + error = soreserve(so, ipxsendspace, ipxrecvspace); if (error) break; ipxp = sotoipxpcb(so); @@ -609,3 +618,28 @@ ipx_raw_usrreq(so, req, m, nam, control) return (error); } +int +ipx_sysctl(name, namelen, oldp, oldlenp, newp, newlen) + int *name; + u_int namelen; + void *oldp; + size_t *oldlenp; + void *newp; + size_t newlen; +{ + /* All sysctl names at this level are terminal. */ + if (namelen != 1) + return (ENOTDIR); + + switch (name[0]) { + case IPXCTL_RECVSPACE: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &ipxrecvspace)); + case IPXCTL_SENDSPACE: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &ipxsendspace)); + default: + return (ENOPROTOOPT); + } + /* NOT REACHED */ +} diff --git a/sys/netipx/ipx_var.h b/sys/netipx/ipx_var.h index 7aae1111ca4..ada67246fd7 100644 --- a/sys/netipx/ipx_var.h +++ b/sys/netipx/ipx_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_var.h,v 1.2 1996/10/26 09:34:55 mickey Exp $ */ +/* $OpenBSD: ipx_var.h,v 1.3 1996/11/25 08:20:02 mickey Exp $ */ /*- * @@ -54,6 +54,20 @@ struct ipxstat { int ipxs_badlen; /* ip length < ip header length */ }; +/* + * Names for IPX sysctl objects. + */ + +#define IPXCTL_RECVSPACE 1 +#define IPXCTL_SENDSPACE 2 +#define IPXCTL_MAXID 3 + +#define IPXCTL_NAMES { \ + { 0, 0}, \ + { "recvspace", CTLTYPE_INT }, \ + { "sendspace", CTLTYPE_INT }, \ +} + #ifdef _KERNEL extern struct ipxstat ipxstat; #endif diff --git a/sys/netipx/spx.h b/sys/netipx/spx.h index f0e00af057c..46f72df40a2 100644 --- a/sys/netipx/spx.h +++ b/sys/netipx/spx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: spx.h,v 1.2 1996/10/26 09:34:55 mickey Exp $ */ +/* $OpenBSD: spx.h,v 1.3 1996/11/25 08:20:02 mickey Exp $ */ /*- * @@ -201,6 +201,7 @@ int spx_usrreq __P((struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *controlp)); int spx_usrreq_sp __P((struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *controlp)); +int spx_sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); #endif /* _KERNEL */ diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index b246f2a0d4e..48e2fe6631a 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_usrreq.c,v 1.3 1996/10/26 09:34:57 mickey Exp $ */ +/* $OpenBSD: spx_usrreq.c,v 1.4 1996/11/25 08:20:03 mickey Exp $ */ /*- * @@ -1843,3 +1843,23 @@ spx_timers(cb, timer) } return (cb); } + +int +spx_sysctl(name, namelen, oldp, oldlenp, newp, newlen) + int *name; + u_int namelen; + void *oldp; + size_t *oldlenp; + void *newp; + size_t newlen; +{ + /* All sysctl names at this level are terminal. */ + if (namelen != 1) + return (ENOTDIR); + + switch (name[0]) { + default: + return (ENOPROTOOPT); + } + /* NOT REACHED */ +} diff --git a/sys/netipx/spx_var.h b/sys/netipx/spx_var.h index dd282e7ab7d..b87e8ef9e1c 100644 --- a/sys/netipx/spx_var.h +++ b/sys/netipx/spx_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: spx_var.h,v 1.2 1996/10/26 09:34:58 mickey Exp $ */ +/* $OpenBSD: spx_var.h,v 1.3 1996/11/25 08:20:03 mickey Exp $ */ /*- * @@ -134,4 +134,15 @@ extern u_short spx_iss; #define SSEQ_GT(a,b) (((short)((a)-(b))) > 0) #define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0) +/* + * Names for SPX sysctl objects. + */ + +#define SPXCTL_MAXID 1 + +#define SPXCTL_NAMES { \ + { 0, 0}, \ +} + + #endif |