ANSI function decls and application of static.
This commit is contained in:
parent
2fb8046d6d
commit
63eac52bac
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bsd-comp.c,v 1.13 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: bsd-comp.c,v 1.14 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
/* Id: bsd-comp.c,v 1.6 1996/08/28 06:31:58 paulus Exp */
|
||||
|
||||
/* Because this code is derived from the 4.3BSD compress source:
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bsd-comp.c,v 1.13 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bsd-comp.c,v 1.14 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -129,20 +129,20 @@ struct bsd_db {
|
|||
#define BSD_OVHD 2 /* BSD compress overhead/packet */
|
||||
#define BSD_INIT_BITS BSD_MIN_BITS
|
||||
|
||||
static void *bsd_comp_alloc __P((u_char *options, int opt_len));
|
||||
static void *bsd_decomp_alloc __P((u_char *options, int opt_len));
|
||||
static void bsd_free __P((void *state));
|
||||
static int bsd_comp_init __P((void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int debug));
|
||||
static int bsd_decomp_init __P((void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int mru, int debug));
|
||||
static int bsd_compress __P((void *state, struct mbuf **mret,
|
||||
struct mbuf *mp, int slen, int maxolen));
|
||||
static void bsd_incomp __P((void *state, struct mbuf *dmsg));
|
||||
static int bsd_decompress __P((void *state, struct mbuf *cmp,
|
||||
struct mbuf **dmpp));
|
||||
static void bsd_reset __P((void *state));
|
||||
static void bsd_comp_stats __P((void *state, struct compstat *stats));
|
||||
static void *bsd_comp_alloc(u_char *options, int opt_len);
|
||||
static void *bsd_decomp_alloc(u_char *options, int opt_len);
|
||||
static void bsd_free(void *state);
|
||||
static int bsd_comp_init(void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int debug);
|
||||
static int bsd_decomp_init(void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int mru, int debug);
|
||||
static int bsd_compress(void *state, struct mbuf **mret,
|
||||
struct mbuf *mp, int slen, int maxolen);
|
||||
static void bsd_incomp(void *state, struct mbuf *dmsg);
|
||||
static int bsd_decompress(void *state, struct mbuf *cmp,
|
||||
struct mbuf **dmpp);
|
||||
static void bsd_reset(void *state);
|
||||
static void bsd_comp_stats(void *state, struct compstat *stats);
|
||||
|
||||
/*
|
||||
* Procedures exported to if_ppp.c.
|
||||
|
@ -186,18 +186,17 @@ struct compressor ppp_bsd_compress = {
|
|||
#define RATIO_SCALE (1<<RATIO_SCALE_LOG)
|
||||
#define RATIO_MAX (0x7fffffff>>RATIO_SCALE_LOG)
|
||||
|
||||
static void bsd_clear __P((struct bsd_db *));
|
||||
static int bsd_check __P((struct bsd_db *));
|
||||
static void *bsd_alloc __P((u_char *, int, int));
|
||||
static int bsd_init __P((struct bsd_db *, u_char *, int, int, int, int,
|
||||
int, int));
|
||||
static void bsd_clear(struct bsd_db *);
|
||||
static int bsd_check(struct bsd_db *);
|
||||
static void *bsd_alloc(u_char *, int, int);
|
||||
static int bsd_init(struct bsd_db *, u_char *, int, int, int, int,
|
||||
int, int);
|
||||
|
||||
/*
|
||||
* clear the dictionary
|
||||
*/
|
||||
static void
|
||||
bsd_clear(db)
|
||||
struct bsd_db *db;
|
||||
bsd_clear(struct bsd_db *db)
|
||||
{
|
||||
db->clear_count++;
|
||||
db->max_ent = FIRST-1;
|
||||
|
@ -222,8 +221,7 @@ bsd_clear(db)
|
|||
* must compute the same ratio.
|
||||
*/
|
||||
static int /* 1=output CLEAR */
|
||||
bsd_check(db)
|
||||
struct bsd_db *db;
|
||||
bsd_check(struct bsd_db *db)
|
||||
{
|
||||
u_int new_ratio;
|
||||
|
||||
|
@ -263,9 +261,7 @@ bsd_check(db)
|
|||
* Return statistics.
|
||||
*/
|
||||
static void
|
||||
bsd_comp_stats(state, stats)
|
||||
void *state;
|
||||
struct compstat *stats;
|
||||
bsd_comp_stats(void *state, struct compstat *stats)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
u_int out;
|
||||
|
@ -290,8 +286,7 @@ bsd_comp_stats(state, stats)
|
|||
* Reset state, as on a CCP ResetReq.
|
||||
*/
|
||||
static void
|
||||
bsd_reset(state)
|
||||
void *state;
|
||||
bsd_reset(void *state)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
|
||||
|
@ -304,9 +299,7 @@ bsd_reset(state)
|
|||
* Allocate space for a (de) compressor.
|
||||
*/
|
||||
static void *
|
||||
bsd_alloc(options, opt_len, decomp)
|
||||
u_char *options;
|
||||
int opt_len, decomp;
|
||||
bsd_alloc(u_char *options, int opt_len, int decomp)
|
||||
{
|
||||
int bits;
|
||||
u_int newlen, hsize, hshift, maxmaxcode;
|
||||
|
@ -373,8 +366,7 @@ bsd_alloc(options, opt_len, decomp)
|
|||
}
|
||||
|
||||
static void
|
||||
bsd_free(state)
|
||||
void *state;
|
||||
bsd_free(void *state)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
|
||||
|
@ -384,17 +376,13 @@ bsd_free(state)
|
|||
}
|
||||
|
||||
static void *
|
||||
bsd_comp_alloc(options, opt_len)
|
||||
u_char *options;
|
||||
int opt_len;
|
||||
bsd_comp_alloc(u_char *options, int opt_len)
|
||||
{
|
||||
return bsd_alloc(options, opt_len, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
bsd_decomp_alloc(options, opt_len)
|
||||
u_char *options;
|
||||
int opt_len;
|
||||
bsd_decomp_alloc(u_char *options, int opt_len)
|
||||
{
|
||||
return bsd_alloc(options, opt_len, 1);
|
||||
}
|
||||
|
@ -403,10 +391,8 @@ bsd_decomp_alloc(options, opt_len)
|
|||
* Initialize the database.
|
||||
*/
|
||||
static int
|
||||
bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
|
||||
struct bsd_db *db;
|
||||
u_char *options;
|
||||
int opt_len, unit, hdrlen, mru, debug, decomp;
|
||||
bsd_init(struct bsd_db *db, u_char *options, int opt_len, int unit, int hdrlen,
|
||||
int mru, int debug, int decomp)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -442,20 +428,16 @@ bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
|
|||
}
|
||||
|
||||
static int
|
||||
bsd_comp_init(state, options, opt_len, unit, hdrlen, debug)
|
||||
void *state;
|
||||
u_char *options;
|
||||
int opt_len, unit, hdrlen, debug;
|
||||
bsd_comp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
|
||||
int debug)
|
||||
{
|
||||
return bsd_init((struct bsd_db *) state, options, opt_len,
|
||||
unit, hdrlen, 0, debug, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
|
||||
void *state;
|
||||
u_char *options;
|
||||
int opt_len, unit, hdrlen, mru, debug;
|
||||
bsd_decomp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
|
||||
int mru, int debug)
|
||||
{
|
||||
return bsd_init((struct bsd_db *) state, options, opt_len,
|
||||
unit, hdrlen, mru, debug, 1);
|
||||
|
@ -468,12 +450,10 @@ bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
|
|||
* code size expands, we do not output a bunch of padding.
|
||||
*/
|
||||
int /* new slen */
|
||||
bsd_compress(state, mret, mp, slen, maxolen)
|
||||
void *state;
|
||||
struct mbuf **mret; /* return compressed mbuf chain here */
|
||||
struct mbuf *mp; /* from here */
|
||||
int slen; /* uncompressed length */
|
||||
int maxolen; /* max compressed length */
|
||||
bsd_compress(void *state,
|
||||
struct mbuf **mret /* return compressed mbuf chain here */,
|
||||
struct mbuf *mp /* from here */,
|
||||
int slen, int maxolen)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
int hshift = db->hshift;
|
||||
|
@ -685,9 +665,7 @@ bsd_compress(state, mret, mp, slen, maxolen)
|
|||
* incompressible data by pretending to compress the incoming data.
|
||||
*/
|
||||
static void
|
||||
bsd_incomp(state, dmsg)
|
||||
void *state;
|
||||
struct mbuf *dmsg;
|
||||
bsd_incomp(void *state, struct mbuf *dmsg)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
u_int hshift = db->hshift;
|
||||
|
@ -815,9 +793,7 @@ bsd_incomp(state, dmsg)
|
|||
* compression, even though they are detected by inspecting the input.
|
||||
*/
|
||||
int
|
||||
bsd_decompress(state, cmp, dmpp)
|
||||
void *state;
|
||||
struct mbuf *cmp, **dmpp;
|
||||
bsd_decompress(void *state, struct mbuf *cmp, struct mbuf **dmpp)
|
||||
{
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
u_int max_ent = db->max_ent;
|
||||
|
|
147
sys/net/if.c
147
sys/net/if.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if.c,v 1.162 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if.c,v 1.163 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -97,7 +97,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.162 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.163 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -159,13 +159,13 @@ struct callout if_slowtimo_ch;
|
|||
|
||||
int netisr; /* scheduling bits for network */
|
||||
|
||||
int if_rt_walktree __P((struct radix_node *, void *));
|
||||
static int if_rt_walktree(struct radix_node *, void *);
|
||||
|
||||
struct if_clone *if_clone_lookup __P((const char *, int *));
|
||||
int if_clone_list __P((struct if_clonereq *));
|
||||
static struct if_clone *if_clone_lookup(const char *, int *);
|
||||
static int if_clone_list(struct if_clonereq *);
|
||||
|
||||
LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
|
||||
int if_cloners_count;
|
||||
static LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
|
||||
static int if_cloners_count;
|
||||
|
||||
#ifdef PFIL_HOOKS
|
||||
struct pfil_head if_pfil; /* packet filtering hook for interfaces */
|
||||
|
@ -173,7 +173,7 @@ struct pfil_head if_pfil; /* packet filtering hook for interfaces */
|
|||
|
||||
#if defined(INET) || defined(INET6) || defined(NETATALK) || defined(NS) || \
|
||||
defined(ISO) || defined(CCITT) || defined(NATM)
|
||||
static void if_detach_queues __P((struct ifnet *, struct ifqueue *));
|
||||
static void if_detach_queues(struct ifnet *, struct ifqueue *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -183,7 +183,7 @@ static void if_detach_queues __P((struct ifnet *, struct ifqueue *));
|
|||
* parameters.
|
||||
*/
|
||||
void
|
||||
ifinit()
|
||||
ifinit(void)
|
||||
{
|
||||
|
||||
callout_init(&if_slowtimo_ch);
|
||||
|
@ -202,71 +202,57 @@ ifinit()
|
|||
*/
|
||||
|
||||
int
|
||||
if_nulloutput(ifp, m, so, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *so;
|
||||
struct rtentry *rt;
|
||||
if_nulloutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *so,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
void
|
||||
if_nullinput(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
if_nullinput(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
|
||||
/* Nothing. */
|
||||
}
|
||||
|
||||
void
|
||||
if_nullstart(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_nullstart(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
/* Nothing. */
|
||||
}
|
||||
|
||||
int
|
||||
if_nullioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
if_nullioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
int
|
||||
if_nullinit(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_nullinit(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
void
|
||||
if_nullstop(ifp, disable)
|
||||
struct ifnet *ifp;
|
||||
int disable;
|
||||
if_nullstop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
|
||||
/* Nothing. */
|
||||
}
|
||||
|
||||
void
|
||||
if_nullwatchdog(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_nullwatchdog(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
/* Nothing. */
|
||||
}
|
||||
|
||||
void
|
||||
if_nulldrain(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_nulldrain(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
/* Nothing. */
|
||||
|
@ -370,8 +356,7 @@ if_free_sadl(struct ifnet *ifp)
|
|||
* list of "active" interfaces.
|
||||
*/
|
||||
void
|
||||
if_attach(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_attach(struct ifnet *ifp)
|
||||
{
|
||||
int indexlim = 0;
|
||||
|
||||
|
@ -494,7 +479,7 @@ if_attach(ifp)
|
|||
}
|
||||
|
||||
void
|
||||
if_attachdomain()
|
||||
if_attachdomain(void)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
int s;
|
||||
|
@ -506,8 +491,7 @@ if_attachdomain()
|
|||
}
|
||||
|
||||
void
|
||||
if_attachdomain1(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_attachdomain1(struct ifnet *ifp)
|
||||
{
|
||||
struct domain *dp;
|
||||
int s;
|
||||
|
@ -530,8 +514,7 @@ if_attachdomain1(ifp)
|
|||
* handles at error stubs. May be called from interrupt context.
|
||||
*/
|
||||
void
|
||||
if_deactivate(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_deactivate(struct ifnet *ifp)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -560,8 +543,7 @@ if_deactivate(ifp)
|
|||
* as it may block.
|
||||
*/
|
||||
void
|
||||
if_detach(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_detach(struct ifnet *ifp)
|
||||
{
|
||||
struct socket so;
|
||||
struct ifaddr *ifa, **ifap;
|
||||
|
@ -743,9 +725,7 @@ do { \
|
|||
#if defined(INET) || defined(INET6) || defined(NETATALK) || defined(NS) || \
|
||||
defined(ISO) || defined(CCITT) || defined(NATM) || defined(DECNET)
|
||||
static void
|
||||
if_detach_queues(ifp, q)
|
||||
struct ifnet *ifp;
|
||||
struct ifqueue *q;
|
||||
if_detach_queues(struct ifnet *ifp, struct ifqueue *q)
|
||||
{
|
||||
struct mbuf *m, *prev, *next;
|
||||
|
||||
|
@ -782,10 +762,8 @@ if_detach_queues(ifp, q)
|
|||
* Callback for a radix tree walk to delete all references to an
|
||||
* ifnet.
|
||||
*/
|
||||
int
|
||||
if_rt_walktree(rn, v)
|
||||
struct radix_node *rn;
|
||||
void *v;
|
||||
static int
|
||||
if_rt_walktree(struct radix_node *rn, void *v)
|
||||
{
|
||||
struct ifnet *ifp = (struct ifnet *)v;
|
||||
struct rtentry *rt = (struct rtentry *)rn;
|
||||
|
@ -806,8 +784,7 @@ if_rt_walktree(rn, v)
|
|||
* Create a clone network interface.
|
||||
*/
|
||||
int
|
||||
if_clone_create(name)
|
||||
const char *name;
|
||||
if_clone_create(const char *name)
|
||||
{
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
|
@ -826,8 +803,7 @@ if_clone_create(name)
|
|||
* Destroy a clone network interface.
|
||||
*/
|
||||
int
|
||||
if_clone_destroy(name)
|
||||
const char *name;
|
||||
if_clone_destroy(const char *name)
|
||||
{
|
||||
struct if_clone *ifc;
|
||||
struct ifnet *ifp;
|
||||
|
@ -849,10 +825,8 @@ if_clone_destroy(name)
|
|||
/*
|
||||
* Look up a network interface cloner.
|
||||
*/
|
||||
struct if_clone *
|
||||
if_clone_lookup(name, unitp)
|
||||
const char *name;
|
||||
int *unitp;
|
||||
static struct if_clone *
|
||||
if_clone_lookup(const char *name, int *unitp)
|
||||
{
|
||||
struct if_clone *ifc;
|
||||
const char *cp;
|
||||
|
@ -894,8 +868,7 @@ if_clone_lookup(name, unitp)
|
|||
* Register a network interface cloner.
|
||||
*/
|
||||
void
|
||||
if_clone_attach(ifc)
|
||||
struct if_clone *ifc;
|
||||
if_clone_attach(struct if_clone *ifc)
|
||||
{
|
||||
|
||||
LIST_INSERT_HEAD(&if_cloners, ifc, ifc_list);
|
||||
|
@ -906,8 +879,7 @@ if_clone_attach(ifc)
|
|||
* Unregister a network interface cloner.
|
||||
*/
|
||||
void
|
||||
if_clone_detach(ifc)
|
||||
struct if_clone *ifc;
|
||||
if_clone_detach(struct if_clone *ifc)
|
||||
{
|
||||
|
||||
LIST_REMOVE(ifc, ifc_list);
|
||||
|
@ -917,9 +889,8 @@ if_clone_detach(ifc)
|
|||
/*
|
||||
* Provide list of interface cloners to userspace.
|
||||
*/
|
||||
int
|
||||
if_clone_list(ifcr)
|
||||
struct if_clonereq *ifcr;
|
||||
static int
|
||||
if_clone_list(struct if_clonereq *ifcr)
|
||||
{
|
||||
char outbuf[IFNAMSIZ], *dst;
|
||||
struct if_clone *ifc;
|
||||
|
@ -954,8 +925,7 @@ if_clone_list(ifcr)
|
|||
*/
|
||||
/*ARGSUSED*/
|
||||
struct ifaddr *
|
||||
ifa_ifwithaddr(addr)
|
||||
const struct sockaddr *addr;
|
||||
ifa_ifwithaddr(const struct sockaddr *addr)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifaddr *ifa;
|
||||
|
@ -989,8 +959,7 @@ ifa_ifwithaddr(addr)
|
|||
*/
|
||||
/*ARGSUSED*/
|
||||
struct ifaddr *
|
||||
ifa_ifwithdstaddr(addr)
|
||||
const struct sockaddr *addr;
|
||||
ifa_ifwithdstaddr(const struct sockaddr *addr)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifaddr *ifa;
|
||||
|
@ -1019,8 +988,7 @@ ifa_ifwithdstaddr(addr)
|
|||
* is most specific found.
|
||||
*/
|
||||
struct ifaddr *
|
||||
ifa_ifwithnet(addr)
|
||||
const struct sockaddr *addr;
|
||||
ifa_ifwithnet(const struct sockaddr *addr)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifaddr *ifa;
|
||||
|
@ -1093,8 +1061,7 @@ ifa_ifwithnet(addr)
|
|||
* Find the interface of the addresss.
|
||||
*/
|
||||
struct ifaddr *
|
||||
ifa_ifwithladdr(addr)
|
||||
const struct sockaddr *addr;
|
||||
ifa_ifwithladdr(const struct sockaddr *addr)
|
||||
{
|
||||
struct ifaddr *ia;
|
||||
|
||||
|
@ -1108,8 +1075,7 @@ ifa_ifwithladdr(addr)
|
|||
* Find an interface using a specific address family
|
||||
*/
|
||||
struct ifaddr *
|
||||
ifa_ifwithaf(af)
|
||||
int af;
|
||||
ifa_ifwithaf(int af)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifaddr *ifa;
|
||||
|
@ -1132,9 +1098,7 @@ ifa_ifwithaf(af)
|
|||
* a given address.
|
||||
*/
|
||||
struct ifaddr *
|
||||
ifaof_ifpforaddr(addr, ifp)
|
||||
const struct sockaddr *addr;
|
||||
struct ifnet *ifp;
|
||||
ifaof_ifpforaddr(const struct sockaddr *addr, struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
const char *cp, *cp2, *cp3;
|
||||
|
@ -1180,10 +1144,7 @@ ifaof_ifpforaddr(addr, ifp)
|
|||
* This should be moved to /sys/net/link.c eventually.
|
||||
*/
|
||||
void
|
||||
link_rtrequest(cmd, rt, info)
|
||||
int cmd;
|
||||
struct rtentry *rt;
|
||||
struct rt_addrinfo *info;
|
||||
link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct sockaddr *dst;
|
||||
|
@ -1222,8 +1183,7 @@ if_link_state_change(struct ifnet *ifp, int link_state)
|
|||
* NOTE: must be called at splsoftnet or equivalent.
|
||||
*/
|
||||
void
|
||||
if_down(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_down(struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
|
||||
|
@ -1242,8 +1202,7 @@ if_down(ifp)
|
|||
* NOTE: must be called at splsoftnet or equivalent.
|
||||
*/
|
||||
void
|
||||
if_up(ifp)
|
||||
struct ifnet *ifp;
|
||||
if_up(struct ifnet *ifp)
|
||||
{
|
||||
#ifdef notyet
|
||||
struct ifaddr *ifa;
|
||||
|
@ -1269,8 +1228,7 @@ if_up(ifp)
|
|||
* call the appropriate interface routine on expiration.
|
||||
*/
|
||||
void
|
||||
if_slowtimo(arg)
|
||||
void *arg;
|
||||
if_slowtimo(void *arg)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
int s = splnet();
|
||||
|
@ -1294,9 +1252,7 @@ if_slowtimo(arg)
|
|||
* Results are undefined if the "off" and "on" requests are not matched.
|
||||
*/
|
||||
int
|
||||
ifpromisc(ifp, pswitch)
|
||||
struct ifnet *ifp;
|
||||
int pswitch;
|
||||
ifpromisc(struct ifnet *ifp, int pswitch)
|
||||
{
|
||||
int pcount, ret;
|
||||
short flags;
|
||||
|
@ -1344,8 +1300,7 @@ ifpromisc(ifp, pswitch)
|
|||
* interface structure pointer.
|
||||
*/
|
||||
struct ifnet *
|
||||
ifunit(name)
|
||||
const char *name;
|
||||
ifunit(const char *name)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
const char *cp = name;
|
||||
|
@ -1385,11 +1340,7 @@ ifunit(name)
|
|||
* Interface ioctls.
|
||||
*/
|
||||
int
|
||||
ifioctl(so, cmd, data, l)
|
||||
struct socket *so;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
struct lwp *l;
|
||||
ifioctl(struct socket *so, u_long cmd, caddr_t data, struct lwp *l)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifreq *ifr;
|
||||
|
@ -1655,9 +1606,7 @@ ifioctl(so, cmd, data, l)
|
|||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
ifconf(cmd, data)
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
ifconf(u_long cmd, caddr_t data)
|
||||
{
|
||||
struct ifconf *ifc = (struct ifconf *)data;
|
||||
struct ifnet *ifp;
|
||||
|
|
122
sys/net/if.h
122
sys/net/if.h
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if.h,v 1.113 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if.h,v 1.114 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -255,22 +255,22 @@ struct ifnet { /* and the entries */
|
|||
* corresponding NULL stub in if.c.
|
||||
*/
|
||||
int (*if_output) /* output routine (enqueue) */
|
||||
__P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
void (*if_input) /* input routine (from h/w driver) */
|
||||
__P((struct ifnet *, struct mbuf *));
|
||||
(struct ifnet *, struct mbuf *);
|
||||
void (*if_start) /* initiate output routine */
|
||||
__P((struct ifnet *));
|
||||
(struct ifnet *);
|
||||
int (*if_ioctl) /* ioctl routine */
|
||||
__P((struct ifnet *, u_long, caddr_t));
|
||||
(struct ifnet *, u_long, caddr_t);
|
||||
int (*if_init) /* init routine */
|
||||
__P((struct ifnet *));
|
||||
(struct ifnet *);
|
||||
void (*if_stop) /* stop routine */
|
||||
__P((struct ifnet *, int));
|
||||
(struct ifnet *, int);
|
||||
void (*if_watchdog) /* timer routine */
|
||||
__P((struct ifnet *));
|
||||
(struct ifnet *);
|
||||
void (*if_drain) /* routine to release resources */
|
||||
__P((struct ifnet *));
|
||||
(struct ifnet *);
|
||||
struct ifaltq if_snd; /* output queue (includes altq) */
|
||||
struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */
|
||||
const uint8_t *if_broadcastaddr;/* linklevel broadcast bytestring */
|
||||
|
@ -453,7 +453,7 @@ struct ifaddr {
|
|||
TAILQ_ENTRY(ifaddr) ifa_list; /* list of addresses for interface */
|
||||
struct ifaddr_data ifa_data; /* statistics on the address */
|
||||
void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
|
||||
__P((int, struct rtentry *, struct rt_addrinfo *));
|
||||
(int, struct rtentry *, struct rt_addrinfo *);
|
||||
u_int ifa_flags; /* mostly rt_flags for cloning */
|
||||
int ifa_refcnt; /* count of references */
|
||||
int ifa_metric; /* cost of going out this interface */
|
||||
|
@ -776,66 +776,66 @@ extern struct ifnet **ifindex2ifnet;
|
|||
extern struct ifnet *lo0ifp;
|
||||
extern size_t if_indexlim;
|
||||
|
||||
char *ether_sprintf __P((const u_char *));
|
||||
char *ether_sprintf(const u_char *);
|
||||
|
||||
void if_alloc_sadl __P((struct ifnet *));
|
||||
void if_free_sadl __P((struct ifnet *));
|
||||
void if_attach __P((struct ifnet *));
|
||||
void if_attachdomain __P((void));
|
||||
void if_attachdomain1 __P((struct ifnet *));
|
||||
void if_deactivate __P((struct ifnet *));
|
||||
void if_detach __P((struct ifnet *));
|
||||
void if_down __P((struct ifnet *));
|
||||
void if_alloc_sadl(struct ifnet *);
|
||||
void if_free_sadl(struct ifnet *);
|
||||
void if_attach(struct ifnet *);
|
||||
void if_attachdomain(void);
|
||||
void if_attachdomain1(struct ifnet *);
|
||||
void if_deactivate(struct ifnet *);
|
||||
void if_detach(struct ifnet *);
|
||||
void if_down(struct ifnet *);
|
||||
void if_link_state_change(struct ifnet *, int);
|
||||
void if_slowtimo __P((void *));
|
||||
void if_up __P((struct ifnet *));
|
||||
int ifconf __P((u_long, caddr_t));
|
||||
void ifinit __P((void));
|
||||
int ifioctl __P((struct socket *, u_long, caddr_t, struct lwp *));
|
||||
int ifpromisc __P((struct ifnet *, int));
|
||||
struct ifnet *ifunit __P((const char *));
|
||||
void if_slowtimo(void *);
|
||||
void if_up(struct ifnet *);
|
||||
int ifconf(u_long, caddr_t);
|
||||
void ifinit(void);
|
||||
int ifioctl(struct socket *, u_long, caddr_t, struct lwp *);
|
||||
int ifpromisc(struct ifnet *, int);
|
||||
struct ifnet *ifunit(const char *);
|
||||
|
||||
struct ifaddr *ifa_ifwithaddr __P((const struct sockaddr *));
|
||||
struct ifaddr *ifa_ifwithaf __P((int));
|
||||
struct ifaddr *ifa_ifwithdstaddr __P((const struct sockaddr *));
|
||||
struct ifaddr *ifa_ifwithnet __P((const struct sockaddr *));
|
||||
struct ifaddr *ifa_ifwithladdr __P((const struct sockaddr *));
|
||||
struct ifaddr *ifa_ifwithroute __P((int, const struct sockaddr *,
|
||||
const struct sockaddr *));
|
||||
struct ifaddr *ifaof_ifpforaddr __P((const struct sockaddr *, struct ifnet *));
|
||||
void ifafree __P((struct ifaddr *));
|
||||
void link_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
|
||||
struct ifaddr *ifa_ifwithaddr(const struct sockaddr *);
|
||||
struct ifaddr *ifa_ifwithaf(int);
|
||||
struct ifaddr *ifa_ifwithdstaddr(const struct sockaddr *);
|
||||
struct ifaddr *ifa_ifwithnet(const struct sockaddr *);
|
||||
struct ifaddr *ifa_ifwithladdr(const struct sockaddr *);
|
||||
struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *,
|
||||
const struct sockaddr *);
|
||||
struct ifaddr *ifaof_ifpforaddr(const struct sockaddr *, struct ifnet *);
|
||||
void ifafree(struct ifaddr *);
|
||||
void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
|
||||
void if_clone_attach __P((struct if_clone *));
|
||||
void if_clone_detach __P((struct if_clone *));
|
||||
void if_clone_attach(struct if_clone *);
|
||||
void if_clone_detach(struct if_clone *);
|
||||
|
||||
int if_clone_create __P((const char *));
|
||||
int if_clone_destroy __P((const char *));
|
||||
int if_clone_create(const char *);
|
||||
int if_clone_destroy(const char *);
|
||||
|
||||
int ifq_enqueue(struct ifnet *, struct mbuf * ALTQ_COMMA
|
||||
ALTQ_DECL(struct altq_pktattr *));
|
||||
int ifq_enqueue2(struct ifnet *, struct ifqueue *, struct mbuf * ALTQ_COMMA
|
||||
ALTQ_DECL(struct altq_pktattr *));
|
||||
|
||||
int loioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
void loopattach __P((int));
|
||||
int looutput __P((struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct rtentry *));
|
||||
void lortrequest __P((int, struct rtentry *, struct rt_addrinfo *));
|
||||
int loioctl(struct ifnet *, u_long, caddr_t);
|
||||
void loopattach(int);
|
||||
int looutput(struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct rtentry *);
|
||||
void lortrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
|
||||
/*
|
||||
* These are exported because they're an easy way to tell if
|
||||
* an interface is going away without having to burn a flag.
|
||||
*/
|
||||
int if_nulloutput __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
void if_nullinput __P((struct ifnet *, struct mbuf *));
|
||||
void if_nullstart __P((struct ifnet *));
|
||||
int if_nullioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int if_nullinit __P((struct ifnet *));
|
||||
void if_nullstop __P((struct ifnet *, int));
|
||||
void if_nullwatchdog __P((struct ifnet *));
|
||||
void if_nulldrain __P((struct ifnet *));
|
||||
int if_nulloutput(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
void if_nullinput(struct ifnet *, struct mbuf *);
|
||||
void if_nullstart(struct ifnet *);
|
||||
int if_nullioctl(struct ifnet *, u_long, caddr_t);
|
||||
int if_nullinit(struct ifnet *);
|
||||
void if_nullstop(struct ifnet *, int);
|
||||
void if_nullwatchdog(struct ifnet *);
|
||||
void if_nulldrain(struct ifnet *);
|
||||
#else
|
||||
struct if_nameindex {
|
||||
unsigned int if_index; /* 1, 2, ... */
|
||||
|
@ -844,10 +844,10 @@ struct if_nameindex {
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
__BEGIN_DECLS
|
||||
unsigned int if_nametoindex __P((const char *));
|
||||
char * if_indextoname __P((unsigned int, char *));
|
||||
struct if_nameindex * if_nameindex __P((void));
|
||||
void if_freenameindex __P((struct if_nameindex *));
|
||||
unsigned int if_nametoindex(const char *);
|
||||
char * if_indextoname(unsigned int, char *);
|
||||
struct if_nameindex * if_nameindex(void);
|
||||
void if_freenameindex(struct if_nameindex *);
|
||||
__END_DECLS
|
||||
#endif /* _KERNEL */ /* XXX really ALTQ? */
|
||||
|
||||
|
@ -855,9 +855,9 @@ __END_DECLS
|
|||
/*
|
||||
* ifq sysctl support
|
||||
*/
|
||||
int sysctl_ifq __P((int *name, u_int namelen, void *oldp,
|
||||
int sysctl_ifq(int *name, u_int namelen, void *oldp,
|
||||
size_t *oldlenp, void *newp, size_t newlen,
|
||||
struct ifqueue *ifq));
|
||||
struct ifqueue *ifq);
|
||||
/* symbolic names for terminal (per-protocol) CTL_IFQ_ nodes */
|
||||
#define IFQCTL_LEN 1
|
||||
#define IFQCTL_MAXLEN 2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arc.h,v 1.17 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_arc.h,v 1.18 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
|
@ -118,10 +118,10 @@ struct arccom {
|
|||
extern u_int8_t arcbroadcastaddr;
|
||||
extern int arc_ipmtu; /* XXX new ip only, no RFC 1051! */
|
||||
|
||||
void arc_ifattach __P((struct ifnet *, u_int8_t));
|
||||
void arc_storelladdr __P((struct ifnet *, u_int8_t));
|
||||
char *arc_sprintf __P((u_int8_t *));
|
||||
int arc_isphds __P((int));
|
||||
void arc_ifattach(struct ifnet *, u_int8_t);
|
||||
void arc_storelladdr(struct ifnet *, u_int8_t);
|
||||
char *arc_sprintf(u_int8_t *);
|
||||
int arc_isphds(int);
|
||||
#endif
|
||||
|
||||
#endif /* !_NET_IF_ARC_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arcsubr.c,v 1.50 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_arcsubr.c,v 1.51 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Ignatios Souvatzis
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.50 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.51 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -87,7 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.50 2005/12/11 12:24:51 christos Exp
|
|||
#define ARC_IPMTU 1500
|
||||
#endif
|
||||
|
||||
static struct mbuf *arc_defrag __P((struct ifnet *, struct mbuf *));
|
||||
static struct mbuf *arc_defrag(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* RC1201 requires us to have this configurable. We have it only per
|
||||
|
@ -104,9 +104,9 @@ u_int8_t arcbroadcastaddr = 0;
|
|||
#define senderr(e) { error = (e); goto bad;}
|
||||
#define SIN(s) ((struct sockaddr_in *)s)
|
||||
|
||||
static int arc_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void arc_input __P((struct ifnet *, struct mbuf *));
|
||||
static int arc_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static void arc_input(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* ARCnet output routine.
|
||||
|
@ -114,11 +114,8 @@ static void arc_input __P((struct ifnet *, struct mbuf *));
|
|||
* Assumes that ifp is actually pointer to arccom structure.
|
||||
*/
|
||||
static int
|
||||
arc_output(ifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt0;
|
||||
arc_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt0)
|
||||
{
|
||||
struct mbuf *m, *m1, *mcopy;
|
||||
struct rtentry *rt;
|
||||
|
@ -362,10 +359,8 @@ bad:
|
|||
* NULL. frees imcoming mbuf as necessary.
|
||||
*/
|
||||
|
||||
__inline struct mbuf *
|
||||
arc_defrag(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
static struct mbuf *
|
||||
arc_defrag(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
struct arc_header *ah, *ah1;
|
||||
struct arccom *ac;
|
||||
|
@ -513,8 +508,7 @@ outofseq:
|
|||
* Easiest is to assume that everybody else uses that, too.
|
||||
*/
|
||||
int
|
||||
arc_isphds(type)
|
||||
u_int8_t type;
|
||||
arc_isphds(uint8_t type)
|
||||
{
|
||||
return (type != ARCTYPE_IP_OLD &&
|
||||
type != ARCTYPE_ARP_OLD &&
|
||||
|
@ -527,9 +521,7 @@ arc_isphds(type)
|
|||
* the ARCnet header.
|
||||
*/
|
||||
static void
|
||||
arc_input(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
arc_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
struct arc_header *ah;
|
||||
struct ifqueue *inq;
|
||||
|
@ -613,8 +605,7 @@ arc_input(ifp, m)
|
|||
* Convert Arcnet address to printable (loggable) representation.
|
||||
*/
|
||||
char *
|
||||
arc_sprintf(ap)
|
||||
u_int8_t *ap;
|
||||
arc_sprintf(uint8_t *ap)
|
||||
{
|
||||
static char arcbuf[3];
|
||||
char *cp = arcbuf;
|
||||
|
@ -629,9 +620,7 @@ arc_sprintf(ap)
|
|||
* Register (new) link level address.
|
||||
*/
|
||||
void
|
||||
arc_storelladdr(ifp, lla)
|
||||
struct ifnet *ifp;
|
||||
u_int8_t lla;
|
||||
arc_storelladdr(struct ifnet *ifp, uint8_t lla)
|
||||
{
|
||||
|
||||
*(LLADDR(ifp->if_sadl)) = lla;
|
||||
|
@ -642,9 +631,7 @@ arc_storelladdr(ifp, lla)
|
|||
* Perform common duties while attaching to interface list
|
||||
*/
|
||||
void
|
||||
arc_ifattach(ifp, lla)
|
||||
struct ifnet *ifp;
|
||||
u_int8_t lla;
|
||||
arc_ifattach(struct ifnet *ifp, uint8_t lla)
|
||||
{
|
||||
struct arccom *ac;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_atm.h,v 1.14 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_atm.h,v 1.15 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -137,11 +137,11 @@ struct atmllc {
|
|||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
void atm_ifattach __P((struct ifnet *));
|
||||
void atm_input __P((struct ifnet *, struct atm_pseudohdr *,
|
||||
struct mbuf *, void *));
|
||||
int atm_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
void atm_ifattach(struct ifnet *);
|
||||
void atm_input(struct ifnet *, struct atm_pseudohdr *,
|
||||
struct mbuf *, void *);
|
||||
int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
#endif
|
||||
#ifdef ATM_PVCEXT
|
||||
#ifdef _KERNEL
|
||||
|
@ -163,7 +163,7 @@ struct pvcsif {
|
|||
int sif_vci; /* vci no */
|
||||
LIST_ENTRY(pvcsif) sif_links;
|
||||
};
|
||||
struct ifnet *pvcsif_alloc __P((void));
|
||||
struct ifnet *pvcsif_alloc(void);
|
||||
#endif
|
||||
#endif /* ATM_PVCEXT */
|
||||
#endif /* !_NET_IF_ATM_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_atmsubr.c,v 1.36 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_atmsubr.c,v 1.37 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.36 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.37 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_gateway.h"
|
||||
|
@ -98,11 +98,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.36 2005/12/11 12:24:51 christos Exp
|
|||
*/
|
||||
|
||||
int
|
||||
atm_output(ifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt0;
|
||||
atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt0)
|
||||
{
|
||||
u_int16_t etype = 0; /* if using LLC/SNAP */
|
||||
int error = 0, sz;
|
||||
|
@ -236,11 +233,8 @@ bad:
|
|||
* the packet is in the mbuf chain m.
|
||||
*/
|
||||
void
|
||||
atm_input(ifp, ah, m, rxhand)
|
||||
struct ifnet *ifp;
|
||||
struct atm_pseudohdr *ah;
|
||||
struct mbuf *m;
|
||||
void *rxhand;
|
||||
atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
|
||||
void *rxhand)
|
||||
{
|
||||
struct ifqueue *inq;
|
||||
u_int16_t etype = ETHERTYPE_IP; /* default */
|
||||
|
@ -326,8 +320,7 @@ atm_input(ifp, ah, m, rxhand)
|
|||
* Perform common duties while attaching to interface list
|
||||
*/
|
||||
void
|
||||
atm_ifattach(ifp)
|
||||
struct ifnet *ifp;
|
||||
atm_ifattach(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
ifp->if_type = IFT_ATM;
|
||||
|
@ -354,7 +347,7 @@ static int pvc_max_number = 16; /* max number of PVCs */
|
|||
static int pvc_number = 0; /* pvc unit number */
|
||||
|
||||
struct ifnet *
|
||||
pvcsif_alloc()
|
||||
pvcsif_alloc(void)
|
||||
{
|
||||
struct pvcsif *pvcsif;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_bridge.c,v 1.32 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_bridge.c,v 1.33 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
|
@ -80,7 +80,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.32 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.33 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include "opt_bridge_ipf.h"
|
||||
#include "opt_inet.h"
|
||||
|
@ -164,77 +164,81 @@ __KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.32 2005/12/11 12:24:51 christos Exp
|
|||
|
||||
int bridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD;
|
||||
|
||||
struct pool bridge_rtnode_pool;
|
||||
static struct pool bridge_rtnode_pool;
|
||||
|
||||
void bridgeattach(int);
|
||||
|
||||
int bridge_clone_create(struct if_clone *, int);
|
||||
int bridge_clone_destroy(struct ifnet *);
|
||||
static int bridge_clone_create(struct if_clone *, int);
|
||||
static int bridge_clone_destroy(struct ifnet *);
|
||||
|
||||
int bridge_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int bridge_init(struct ifnet *);
|
||||
void bridge_stop(struct ifnet *, int);
|
||||
void bridge_start(struct ifnet *);
|
||||
static int bridge_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int bridge_init(struct ifnet *);
|
||||
static void bridge_stop(struct ifnet *, int);
|
||||
static void bridge_start(struct ifnet *);
|
||||
|
||||
void bridge_forward(struct bridge_softc *, struct mbuf *m);
|
||||
static void bridge_forward(struct bridge_softc *, struct mbuf *m);
|
||||
|
||||
void bridge_timer(void *);
|
||||
static void bridge_timer(void *);
|
||||
|
||||
void bridge_broadcast(struct bridge_softc *, struct ifnet *, struct mbuf *);
|
||||
static void bridge_broadcast(struct bridge_softc *, struct ifnet *,
|
||||
struct mbuf *);
|
||||
|
||||
int bridge_rtupdate(struct bridge_softc *, const uint8_t *,
|
||||
struct ifnet *, int, uint8_t);
|
||||
struct ifnet *bridge_rtlookup(struct bridge_softc *, const uint8_t *);
|
||||
void bridge_rttrim(struct bridge_softc *);
|
||||
void bridge_rtage(struct bridge_softc *);
|
||||
void bridge_rtflush(struct bridge_softc *, int);
|
||||
int bridge_rtdaddr(struct bridge_softc *, const uint8_t *);
|
||||
void bridge_rtdelete(struct bridge_softc *, struct ifnet *ifp);
|
||||
static int bridge_rtupdate(struct bridge_softc *, const uint8_t *,
|
||||
struct ifnet *, int, uint8_t);
|
||||
static struct ifnet *bridge_rtlookup(struct bridge_softc *, const uint8_t *);
|
||||
static void bridge_rttrim(struct bridge_softc *);
|
||||
static void bridge_rtage(struct bridge_softc *);
|
||||
static void bridge_rtflush(struct bridge_softc *, int);
|
||||
static int bridge_rtdaddr(struct bridge_softc *, const uint8_t *);
|
||||
static void bridge_rtdelete(struct bridge_softc *, struct ifnet *ifp);
|
||||
|
||||
int bridge_rtable_init(struct bridge_softc *);
|
||||
void bridge_rtable_fini(struct bridge_softc *);
|
||||
static int bridge_rtable_init(struct bridge_softc *);
|
||||
static void bridge_rtable_fini(struct bridge_softc *);
|
||||
|
||||
struct bridge_rtnode *bridge_rtnode_lookup(struct bridge_softc *,
|
||||
const uint8_t *);
|
||||
int bridge_rtnode_insert(struct bridge_softc *, struct bridge_rtnode *);
|
||||
void bridge_rtnode_destroy(struct bridge_softc *, struct bridge_rtnode *);
|
||||
static struct bridge_rtnode *bridge_rtnode_lookup(struct bridge_softc *,
|
||||
const uint8_t *);
|
||||
static int bridge_rtnode_insert(struct bridge_softc *,
|
||||
struct bridge_rtnode *);
|
||||
static void bridge_rtnode_destroy(struct bridge_softc *,
|
||||
struct bridge_rtnode *);
|
||||
|
||||
struct bridge_iflist *bridge_lookup_member(struct bridge_softc *,
|
||||
const char *name);
|
||||
struct bridge_iflist *bridge_lookup_member_if(struct bridge_softc *,
|
||||
struct ifnet *ifp);
|
||||
void bridge_delete_member(struct bridge_softc *, struct bridge_iflist *);
|
||||
static struct bridge_iflist *bridge_lookup_member(struct bridge_softc *,
|
||||
const char *name);
|
||||
static struct bridge_iflist *bridge_lookup_member_if(struct bridge_softc *,
|
||||
struct ifnet *ifp);
|
||||
static void bridge_delete_member(struct bridge_softc *,
|
||||
struct bridge_iflist *);
|
||||
|
||||
int bridge_ioctl_add(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_del(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gifflags(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sifflags(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_scache(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gcache(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gifs(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_rts(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_saddr(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sto(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gto(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_daddr(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_flush(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gpri(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_spri(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_ght(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sht(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gfd(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sfd(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_gma(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sma(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sifprio(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sifcost(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_add(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_del(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gifflags(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sifflags(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_scache(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gcache(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gifs(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_rts(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_saddr(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sto(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gto(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_daddr(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_flush(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gpri(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_spri(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_ght(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sht(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gfd(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sfd(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_gma(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sma(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sifprio(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sifcost(struct bridge_softc *, void *);
|
||||
#if defined(BRIDGE_IPF) && defined(PFIL_HOOKS)
|
||||
int bridge_ioctl_gfilt(struct bridge_softc *, void *);
|
||||
int bridge_ioctl_sfilt(struct bridge_softc *, void *);
|
||||
static int bridge_ipf(void *, struct mbuf **, struct ifnet *, int);
|
||||
static int bridge_ip_checkbasic(struct mbuf **mp);
|
||||
static int bridge_ioctl_gfilt(struct bridge_softc *, void *);
|
||||
static int bridge_ioctl_sfilt(struct bridge_softc *, void *);
|
||||
static int bridge_ipf(void *, struct mbuf **, struct ifnet *, int);
|
||||
static int bridge_ip_checkbasic(struct mbuf **mp);
|
||||
# ifdef INET6
|
||||
static int bridge_ip6_checkbasic(struct mbuf **mp);
|
||||
static int bridge_ip6_checkbasic(struct mbuf **mp);
|
||||
# endif /* INET6 */
|
||||
#endif /* BRIDGE_IPF && PFIL_HOOKS */
|
||||
|
||||
|
@ -248,7 +252,7 @@ struct bridge_control {
|
|||
#define BC_F_COPYOUT 0x02 /* copy arguments out */
|
||||
#define BC_F_SUSER 0x04 /* do super-user check */
|
||||
|
||||
const struct bridge_control bridge_control_table[] = {
|
||||
static const struct bridge_control bridge_control_table[] = {
|
||||
{ bridge_ioctl_add, sizeof(struct ifbreq),
|
||||
BC_F_COPYIN|BC_F_SUSER },
|
||||
{ bridge_ioctl_del, sizeof(struct ifbreq),
|
||||
|
@ -315,12 +319,12 @@ const struct bridge_control bridge_control_table[] = {
|
|||
BC_F_COPYIN|BC_F_SUSER },
|
||||
#endif /* BRIDGE_IPF && PFIL_HOOKS */
|
||||
};
|
||||
const int bridge_control_table_size =
|
||||
static const int bridge_control_table_size =
|
||||
sizeof(bridge_control_table) / sizeof(bridge_control_table[0]);
|
||||
|
||||
LIST_HEAD(, bridge_softc) bridge_list;
|
||||
static LIST_HEAD(, bridge_softc) bridge_list;
|
||||
|
||||
struct if_clone bridge_cloner =
|
||||
static struct if_clone bridge_cloner =
|
||||
IF_CLONE_INITIALIZER("bridge", bridge_clone_create, bridge_clone_destroy);
|
||||
|
||||
/*
|
||||
|
@ -344,7 +348,7 @@ bridgeattach(int n)
|
|||
*
|
||||
* Create a new bridge instance.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct bridge_softc *sc;
|
||||
|
@ -402,7 +406,7 @@ bridge_clone_create(struct if_clone *ifc, int unit)
|
|||
*
|
||||
* Destroy a bridge instance.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct bridge_softc *sc = ifp->if_softc;
|
||||
|
@ -435,7 +439,7 @@ bridge_clone_destroy(struct ifnet *ifp)
|
|||
*
|
||||
* Handle a control request from the operator.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct bridge_softc *sc = ifp->if_softc;
|
||||
|
@ -531,7 +535,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
*
|
||||
* Lookup a bridge member interface. Must be called at splnet().
|
||||
*/
|
||||
struct bridge_iflist *
|
||||
static struct bridge_iflist *
|
||||
bridge_lookup_member(struct bridge_softc *sc, const char *name)
|
||||
{
|
||||
struct bridge_iflist *bif;
|
||||
|
@ -551,7 +555,7 @@ bridge_lookup_member(struct bridge_softc *sc, const char *name)
|
|||
*
|
||||
* Lookup a bridge member interface by ifnet*. Must be called at splnet().
|
||||
*/
|
||||
struct bridge_iflist *
|
||||
static struct bridge_iflist *
|
||||
bridge_lookup_member_if(struct bridge_softc *sc, struct ifnet *member_ifp)
|
||||
{
|
||||
struct bridge_iflist *bif;
|
||||
|
@ -569,7 +573,7 @@ bridge_lookup_member_if(struct bridge_softc *sc, struct ifnet *member_ifp)
|
|||
*
|
||||
* Delete the specified member interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif)
|
||||
{
|
||||
struct ifnet *ifs = bif->bif_ifp;
|
||||
|
@ -603,7 +607,7 @@ bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif)
|
|||
bstp_initialization(sc);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_add(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -667,7 +671,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
|
|||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_del(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -682,7 +686,7 @@ bridge_ioctl_del(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -701,7 +705,7 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -731,7 +735,7 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_scache(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -742,7 +746,7 @@ bridge_ioctl_scache(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gcache(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -752,7 +756,7 @@ bridge_ioctl_gcache(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gifs(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbifconf *bifc = arg;
|
||||
|
@ -793,7 +797,7 @@ bridge_ioctl_gifs(struct bridge_softc *sc, void *arg)
|
|||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_rts(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbaconf *bac = arg;
|
||||
|
@ -828,7 +832,7 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg)
|
|||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_saddr(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbareq *req = arg;
|
||||
|
@ -845,7 +849,7 @@ bridge_ioctl_saddr(struct bridge_softc *sc, void *arg)
|
|||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sto(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -855,7 +859,7 @@ bridge_ioctl_sto(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gto(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -865,7 +869,7 @@ bridge_ioctl_gto(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_daddr(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbareq *req = arg;
|
||||
|
@ -873,7 +877,7 @@ bridge_ioctl_daddr(struct bridge_softc *sc, void *arg)
|
|||
return (bridge_rtdaddr(sc, req->ifba_dst));
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_flush(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -883,7 +887,7 @@ bridge_ioctl_flush(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gpri(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -893,7 +897,7 @@ bridge_ioctl_gpri(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_spri(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -906,7 +910,7 @@ bridge_ioctl_spri(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_ght(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -916,7 +920,7 @@ bridge_ioctl_ght(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sht(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -931,7 +935,7 @@ bridge_ioctl_sht(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gfd(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -941,7 +945,7 @@ bridge_ioctl_gfd(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sfd(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -956,7 +960,7 @@ bridge_ioctl_sfd(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gma(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -966,7 +970,7 @@ bridge_ioctl_gma(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sma(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -981,7 +985,7 @@ bridge_ioctl_sma(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sifprio(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -1000,7 +1004,7 @@ bridge_ioctl_sifprio(struct bridge_softc *sc, void *arg)
|
|||
}
|
||||
|
||||
#if defined(BRIDGE_IPF) && defined(PFIL_HOOKS)
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_gfilt(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -1010,7 +1014,7 @@ bridge_ioctl_gfilt(struct bridge_softc *sc, void *arg)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sfilt(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbrparam *param = arg;
|
||||
|
@ -1037,7 +1041,7 @@ bridge_ioctl_sfilt(struct bridge_softc *sc, void *arg)
|
|||
}
|
||||
#endif /* BRIDGE_IPF && PFIL_HOOKS */
|
||||
|
||||
int
|
||||
static int
|
||||
bridge_ioctl_sifcost(struct bridge_softc *sc, void *arg)
|
||||
{
|
||||
struct ifbreq *req = arg;
|
||||
|
@ -1078,7 +1082,7 @@ bridge_ifdetach(struct ifnet *ifp)
|
|||
*
|
||||
* Initialize a bridge interface.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_init(struct ifnet *ifp)
|
||||
{
|
||||
struct bridge_softc *sc = ifp->if_softc;
|
||||
|
@ -1099,7 +1103,7 @@ bridge_init(struct ifnet *ifp)
|
|||
*
|
||||
* Stop the bridge interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct bridge_softc *sc = ifp->if_softc;
|
||||
|
@ -1124,7 +1128,7 @@ bridge_stop(struct ifnet *ifp, int disable)
|
|||
*
|
||||
* NOTE: must be called at splnet().
|
||||
*/
|
||||
__inline void
|
||||
void
|
||||
bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m,
|
||||
int runfilt)
|
||||
{
|
||||
|
@ -1304,7 +1308,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
|
|||
*
|
||||
* NOTE: This routine should never be called in this implementation.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_start(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
|
@ -1316,7 +1320,7 @@ bridge_start(struct ifnet *ifp)
|
|||
*
|
||||
* The forwarding function of the bridge.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_forward(struct bridge_softc *sc, struct mbuf *m)
|
||||
{
|
||||
struct bridge_iflist *bif;
|
||||
|
@ -1562,7 +1566,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
|
|||
* the bridge, except for the one on which the packet
|
||||
* arrived.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
|
||||
struct mbuf *m)
|
||||
{
|
||||
|
@ -1613,7 +1617,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
|
|||
*
|
||||
* Add a bridge routing entry.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst,
|
||||
struct ifnet *dst_if, int setflags, uint8_t flags)
|
||||
{
|
||||
|
@ -1663,7 +1667,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst,
|
|||
*
|
||||
* Lookup the destination interface for an address.
|
||||
*/
|
||||
struct ifnet *
|
||||
static struct ifnet *
|
||||
bridge_rtlookup(struct bridge_softc *sc, const uint8_t *addr)
|
||||
{
|
||||
struct bridge_rtnode *brt;
|
||||
|
@ -1681,7 +1685,7 @@ bridge_rtlookup(struct bridge_softc *sc, const uint8_t *addr)
|
|||
* of routing entries less than or equal to the
|
||||
* maximum number.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rttrim(struct bridge_softc *sc)
|
||||
{
|
||||
struct bridge_rtnode *brt, *nbrt;
|
||||
|
@ -1710,7 +1714,7 @@ bridge_rttrim(struct bridge_softc *sc)
|
|||
*
|
||||
* Aging timer for the bridge.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_timer(void *arg)
|
||||
{
|
||||
struct bridge_softc *sc = arg;
|
||||
|
@ -1730,7 +1734,7 @@ bridge_timer(void *arg)
|
|||
*
|
||||
* Perform an aging cycle.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rtage(struct bridge_softc *sc)
|
||||
{
|
||||
struct bridge_rtnode *brt, *nbrt;
|
||||
|
@ -1749,7 +1753,7 @@ bridge_rtage(struct bridge_softc *sc)
|
|||
*
|
||||
* Remove all dynamic addresses from the bridge.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rtflush(struct bridge_softc *sc, int full)
|
||||
{
|
||||
struct bridge_rtnode *brt, *nbrt;
|
||||
|
@ -1766,7 +1770,7 @@ bridge_rtflush(struct bridge_softc *sc, int full)
|
|||
*
|
||||
* Remove an address from the table.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_rtdaddr(struct bridge_softc *sc, const uint8_t *addr)
|
||||
{
|
||||
struct bridge_rtnode *brt;
|
||||
|
@ -1783,7 +1787,7 @@ bridge_rtdaddr(struct bridge_softc *sc, const uint8_t *addr)
|
|||
*
|
||||
* Delete routes to a speicifc member interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp)
|
||||
{
|
||||
struct bridge_rtnode *brt, *nbrt;
|
||||
|
@ -1800,7 +1804,7 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp)
|
|||
*
|
||||
* Initialize the route table for this bridge.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_rtable_init(struct bridge_softc *sc)
|
||||
{
|
||||
int i;
|
||||
|
@ -1825,7 +1829,7 @@ bridge_rtable_init(struct bridge_softc *sc)
|
|||
*
|
||||
* Deconstruct the route table for this bridge.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rtable_fini(struct bridge_softc *sc)
|
||||
{
|
||||
|
||||
|
@ -1873,7 +1877,7 @@ bridge_rthash(struct bridge_softc *sc, const uint8_t *addr)
|
|||
*
|
||||
* Look up a bridge route node for the specified destination.
|
||||
*/
|
||||
struct bridge_rtnode *
|
||||
static struct bridge_rtnode *
|
||||
bridge_rtnode_lookup(struct bridge_softc *sc, const uint8_t *addr)
|
||||
{
|
||||
struct bridge_rtnode *brt;
|
||||
|
@ -1898,7 +1902,7 @@ bridge_rtnode_lookup(struct bridge_softc *sc, const uint8_t *addr)
|
|||
* Insert the specified bridge node into the route table. We
|
||||
* assume the entry is not already in the table.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
bridge_rtnode_insert(struct bridge_softc *sc, struct bridge_rtnode *brt)
|
||||
{
|
||||
struct bridge_rtnode *lbrt;
|
||||
|
@ -1944,7 +1948,7 @@ bridge_rtnode_insert(struct bridge_softc *sc, struct bridge_rtnode *brt)
|
|||
*
|
||||
* Destroy a bridge rtnode.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
bridge_rtnode_destroy(struct bridge_softc *sc, struct bridge_rtnode *brt)
|
||||
{
|
||||
|
||||
|
@ -1964,7 +1968,8 @@ extern struct pfil_head inet6_pfil_hook; /* XXX */
|
|||
* with, or if they are ARP or REVARP. (IPF will pass ARP and REVARP without
|
||||
* question.)
|
||||
*/
|
||||
static int bridge_ipf(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
|
||||
static int
|
||||
bridge_ipf(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
|
||||
{
|
||||
int snap, error;
|
||||
struct ether_header *eh1, eh2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_dl.h,v 1.17 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_dl.h,v 1.18 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990, 1993
|
||||
|
@ -83,8 +83,8 @@ struct sockaddr_dl {
|
|||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
void link_addr __P((const char *, struct sockaddr_dl *));
|
||||
char *link_ntoa __P((const struct sockaddr_dl *));
|
||||
void link_addr(const char *, struct sockaddr_dl *);
|
||||
char *link_ntoa(const struct sockaddr_dl *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_KERNEL */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ethersubr.c,v 1.127 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_ethersubr.c,v 1.128 2005/12/11 23:05:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.127 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.128 2005/12/11 23:05:24 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -196,9 +196,9 @@ const uint8_t ethermulticastaddr_slowprotocols[ETHER_ADDR_LEN] =
|
|||
|
||||
#define SIN(x) ((struct sockaddr_in *)x)
|
||||
|
||||
static int ether_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void ether_input __P((struct ifnet *, struct mbuf *));
|
||||
static int ether_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static void ether_input(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* Ethernet output routine.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_faith.c,v 1.31 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_faith.c,v 1.32 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_faith.c,v 1.21 2001/02/20 07:59:26 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.31 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.32 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -88,37 +88,34 @@ struct faith_softc {
|
|||
LIST_ENTRY(faith_softc) sc_list;
|
||||
};
|
||||
|
||||
static int faithioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int faithoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
static void faithrtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
|
||||
static int faithioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
|
||||
void faithattach __P((int));
|
||||
void faithattach(int);
|
||||
|
||||
LIST_HEAD(, faith_softc) faith_softc_list;
|
||||
static LIST_HEAD(, faith_softc) faith_softc_list;
|
||||
|
||||
int faith_clone_create __P((struct if_clone *, int));
|
||||
int faith_clone_destroy __P((struct ifnet *));
|
||||
static int faith_clone_create(struct if_clone *, int);
|
||||
static int faith_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone faith_cloner =
|
||||
static struct if_clone faith_cloner =
|
||||
IF_CLONE_INITIALIZER("faith", faith_clone_create, faith_clone_destroy);
|
||||
|
||||
#define FAITHMTU 1500
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
faithattach(count)
|
||||
int count;
|
||||
faithattach(int count)
|
||||
{
|
||||
|
||||
LIST_INIT(&faith_softc_list);
|
||||
if_clone_attach(&faith_cloner);
|
||||
}
|
||||
|
||||
int
|
||||
faith_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int
|
||||
faith_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct faith_softc *sc;
|
||||
|
||||
|
@ -147,8 +144,7 @@ faith_clone_create(ifc, unit)
|
|||
}
|
||||
|
||||
int
|
||||
faith_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
faith_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct faith_softc *sc = (void *) ifp;
|
||||
|
||||
|
@ -163,11 +159,8 @@ faith_clone_destroy(ifp)
|
|||
}
|
||||
|
||||
int
|
||||
faithoutput(ifp, m, dst, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt;
|
||||
faithoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
int s, isr;
|
||||
struct ifqueue *ifq = 0;
|
||||
|
@ -232,10 +225,7 @@ faithoutput(ifp, m, dst, rt)
|
|||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
faithrtrequest(cmd, rt, info)
|
||||
int cmd;
|
||||
struct rtentry *rt;
|
||||
struct rt_addrinfo *info;
|
||||
faithrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
|
||||
{
|
||||
if (rt)
|
||||
rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
|
||||
|
@ -246,10 +236,7 @@ faithrtrequest(cmd, rt, info)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
faithioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
faithioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
|
@ -308,8 +295,7 @@ faithioctl(ifp, cmd, data)
|
|||
* XXX could be layer violation to call sys/net from sys/netinet6
|
||||
*/
|
||||
int
|
||||
faithprefix(in6)
|
||||
struct in6_addr *in6;
|
||||
faithprefix(struct in6_addr *in6)
|
||||
{
|
||||
struct rtentry *rt;
|
||||
struct sockaddr_in6 sin6;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_faith.h,v 1.2 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_faith.h,v 1.3 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_faith.h,v 1.1 2000/07/26 05:49:21 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
#ifdef _KERNEL
|
||||
struct in6_addr;
|
||||
int faithprefix __P((struct in6_addr *));
|
||||
int faithprefix(struct in6_addr *);
|
||||
#endif
|
||||
|
||||
#endif /* !_NET_IF_FAITH_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_fddi.h,v 1.10 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_fddi.h,v 1.11 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Matt Thomas (thomas@lkg.dec.com)
|
||||
|
@ -88,9 +88,9 @@ struct fddi_header {
|
|||
#define fddi_sprintf ether_sprintf
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
void fddi_ifattach __P((struct ifnet *, caddr_t));
|
||||
void fddi_ifattach(struct ifnet *, caddr_t);
|
||||
#else
|
||||
void fddi_ifattach __P((struct ifnet *));
|
||||
void fddi_ifattach(struct ifnet *);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_fddisubr.c,v 1.57 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_fddisubr.c,v 1.58 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -96,7 +96,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.57 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.58 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -204,9 +204,9 @@ extern struct ifqueue pkintrq;
|
|||
|
||||
#define FDDIADDR(ifp) LLADDR((ifp)->if_sadl)
|
||||
|
||||
static int fddi_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void fddi_input __P((struct ifnet *, struct mbuf *));
|
||||
static int fddi_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static void fddi_input(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* FDDI output routine.
|
||||
|
@ -214,11 +214,8 @@ static void fddi_input __P((struct ifnet *, struct mbuf *));
|
|||
* Assumes that ifp is actually pointer to ethercom structure.
|
||||
*/
|
||||
static int
|
||||
fddi_output(ifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt0;
|
||||
fddi_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt0)
|
||||
{
|
||||
u_int16_t etype;
|
||||
int error = 0, hdrcmplt = 0;
|
||||
|
@ -570,9 +567,7 @@ bad:
|
|||
* the fddi header.
|
||||
*/
|
||||
static void
|
||||
fddi_input(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
fddi_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK)
|
||||
struct ifqueue *inq;
|
||||
|
@ -813,9 +808,7 @@ fddi_input(ifp, m)
|
|||
* Perform common duties while attaching to interface list
|
||||
*/
|
||||
void
|
||||
fddi_ifattach(ifp, lla)
|
||||
struct ifnet *ifp;
|
||||
caddr_t lla;
|
||||
fddi_ifattach(struct ifnet *ifp, caddr_t lla)
|
||||
{
|
||||
struct ethercom *ec = (struct ethercom *)ifp;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gif.c,v 1.55 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_gif.c,v 1.56 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.55 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.56 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_iso.h"
|
||||
|
@ -91,26 +91,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.55 2005/12/11 12:24:51 christos Exp $")
|
|||
|
||||
#include <net/net_osdep.h>
|
||||
|
||||
void gifattach __P((int));
|
||||
void gifattach(int);
|
||||
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void gifnetisr __P((void));
|
||||
static void gifnetisr(void);
|
||||
#endif
|
||||
void gifintr __P((void *));
|
||||
void gif_start __P((struct ifnet *));
|
||||
static void gifintr(void *);
|
||||
static void gif_start(struct ifnet *);
|
||||
#ifdef ISO
|
||||
static struct mbuf *gif_eon_encap __P((struct mbuf *));
|
||||
static struct mbuf *gif_eon_decap __P((struct ifnet *, struct mbuf *));
|
||||
static struct mbuf *gif_eon_encap(struct mbuf *);
|
||||
static struct mbuf *gif_eon_decap(struct ifnet *, struct mbuf *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gif global variable definitions
|
||||
*/
|
||||
LIST_HEAD(, gif_softc) gif_softc_list;
|
||||
LIST_HEAD(, gif_softc) gif_softc_list; /* XXX should be static */
|
||||
|
||||
int gif_clone_create __P((struct if_clone *, int));
|
||||
int gif_clone_destroy __P((struct ifnet *));
|
||||
static int gif_clone_create(struct if_clone *, int);
|
||||
static int gif_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone gif_cloner =
|
||||
static struct if_clone gif_cloner =
|
||||
IF_CLONE_INITIALIZER("gif", gif_clone_create, gif_clone_destroy);
|
||||
|
||||
#ifndef MAX_GIF_NEST
|
||||
|
@ -128,18 +128,15 @@ static int max_gif_nesting = MAX_GIF_NEST;
|
|||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
gifattach(count)
|
||||
int count;
|
||||
gifattach(int count)
|
||||
{
|
||||
|
||||
LIST_INIT(&gif_softc_list);
|
||||
if_clone_attach(&gif_cloner);
|
||||
}
|
||||
|
||||
int
|
||||
gif_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int
|
||||
gif_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct gif_softc *sc;
|
||||
|
||||
|
@ -156,8 +153,7 @@ gif_clone_create(ifc, unit)
|
|||
}
|
||||
|
||||
void
|
||||
gifattach0(sc)
|
||||
struct gif_softc *sc;
|
||||
gifattach0(struct gif_softc *sc)
|
||||
{
|
||||
|
||||
sc->encap_cookie4 = sc->encap_cookie6 = NULL;
|
||||
|
@ -178,9 +174,8 @@ gifattach0(sc)
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
gif_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
static int
|
||||
gif_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct gif_softc *sc = (void *) ifp;
|
||||
|
||||
|
@ -203,9 +198,8 @@ gif_clone_destroy(ifp)
|
|||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
gif_start(ifp)
|
||||
struct ifnet *ifp;
|
||||
static void
|
||||
gif_start(struct ifnet *ifp)
|
||||
{
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
softintr_schedule(((struct gif_softc*)ifp)->gif_si);
|
||||
|
@ -217,11 +211,7 @@ gif_start(ifp)
|
|||
|
||||
#ifdef GIF_ENCAPCHECK
|
||||
int
|
||||
gif_encapcheck(m, off, proto, arg)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
int proto;
|
||||
void *arg;
|
||||
gif_encapcheck(struct mbuf *m, int off, int proto, void *arg)
|
||||
{
|
||||
struct ip ip;
|
||||
struct gif_softc *sc;
|
||||
|
@ -289,11 +279,8 @@ gif_encapcheck(m, off, proto, arg)
|
|||
#endif
|
||||
|
||||
int
|
||||
gif_output(ifp, m, dst, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt; /* added in net2 */
|
||||
gif_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
struct gif_softc *sc = (struct gif_softc*)ifp;
|
||||
int error = 0;
|
||||
|
@ -376,8 +363,8 @@ gif_output(ifp, m, dst, rt)
|
|||
}
|
||||
|
||||
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void
|
||||
gifnetisr()
|
||||
static void
|
||||
gifnetisr(void)
|
||||
{
|
||||
struct gif_softc *sc;
|
||||
|
||||
|
@ -388,9 +375,8 @@ gifnetisr()
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gifintr(arg)
|
||||
void *arg;
|
||||
static void
|
||||
gifintr(void *arg)
|
||||
{
|
||||
struct gif_softc *sc;
|
||||
struct ifnet *ifp;
|
||||
|
@ -467,10 +453,7 @@ gifintr(arg)
|
|||
}
|
||||
|
||||
void
|
||||
gif_input(m, af, ifp)
|
||||
struct mbuf *m;
|
||||
int af;
|
||||
struct ifnet *ifp;
|
||||
gif_input(struct mbuf *m, int af, struct ifnet *ifp)
|
||||
{
|
||||
int s, isr;
|
||||
struct ifqueue *ifq = NULL;
|
||||
|
@ -577,10 +560,7 @@ gif_input(m, af, ifp)
|
|||
|
||||
/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
|
||||
int
|
||||
gif_ioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct gif_softc *sc = (struct gif_softc*)ifp;
|
||||
|
@ -834,10 +814,7 @@ gif_ioctl(ifp, cmd, data)
|
|||
}
|
||||
|
||||
int
|
||||
gif_set_tunnel(ifp, src, dst)
|
||||
struct ifnet *ifp;
|
||||
struct sockaddr *src;
|
||||
struct sockaddr *dst;
|
||||
gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
|
||||
{
|
||||
struct gif_softc *sc = (struct gif_softc *)ifp;
|
||||
struct gif_softc *sc2;
|
||||
|
@ -955,8 +932,7 @@ gif_set_tunnel(ifp, src, dst)
|
|||
}
|
||||
|
||||
void
|
||||
gif_delete_tunnel(ifp)
|
||||
struct ifnet *ifp;
|
||||
gif_delete_tunnel(struct ifnet *ifp)
|
||||
{
|
||||
struct gif_softc *sc = (struct gif_softc *)ifp;
|
||||
int s;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gif.h,v 1.12 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_gif.h,v 1.13 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_gif.h,v 1.23 2001/07/27 09:21:42 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -79,15 +79,15 @@ struct gif_softc {
|
|||
#define GIF_MTU_MAX (8192) /* Maximum MTU */
|
||||
|
||||
/* Prototypes */
|
||||
void gifattach0 __P((struct gif_softc *));
|
||||
void gif_input __P((struct mbuf *, int, struct ifnet *));
|
||||
int gif_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
int gif_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int gif_set_tunnel __P((struct ifnet *, struct sockaddr *, struct sockaddr *));
|
||||
void gif_delete_tunnel __P((struct ifnet *));
|
||||
void gifattach0(struct gif_softc *);
|
||||
void gif_input(struct mbuf *, int, struct ifnet *);
|
||||
int gif_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
int gif_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
|
||||
void gif_delete_tunnel(struct ifnet *);
|
||||
#ifdef GIF_ENCAPCHECK
|
||||
int gif_encapcheck __P((struct mbuf *, int, int, void *));
|
||||
int gif_encapcheck(struct mbuf *, int, int, void *);
|
||||
#endif
|
||||
|
||||
#endif /* !_NET_IF_GIF_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gre.c,v 1.58 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_gre.c,v 1.59 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -48,7 +48,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.58 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.59 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -113,18 +113,20 @@ __KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.58 2005/12/11 12:24:51 christos Exp $")
|
|||
struct gre_softc_head gre_softc_list;
|
||||
int ip_gre_ttl = GRE_TTL;
|
||||
|
||||
int gre_clone_create __P((struct if_clone *, int));
|
||||
int gre_clone_destroy __P((struct ifnet *));
|
||||
static int gre_clone_create(struct if_clone *, int);
|
||||
static int gre_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone gre_cloner =
|
||||
static struct if_clone gre_cloner =
|
||||
IF_CLONE_INITIALIZER("gre", gre_clone_create, gre_clone_destroy);
|
||||
|
||||
int gre_compute_route(struct gre_softc *sc);
|
||||
static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
static int gre_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
|
||||
int
|
||||
gre_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int gre_compute_route(struct gre_softc *sc);
|
||||
|
||||
static int
|
||||
gre_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct gre_softc *sc;
|
||||
|
||||
|
@ -154,9 +156,8 @@ gre_clone_create(ifc, unit)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
gre_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
static int
|
||||
gre_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct gre_softc *sc = ifp->if_softc;
|
||||
|
||||
|
@ -174,7 +175,7 @@ gre_clone_destroy(ifp)
|
|||
* The output routine. Takes a packet and encapsulates it in the protocol
|
||||
* given by sc->g_proto. See also RFC 1701 and RFC 2004
|
||||
*/
|
||||
int
|
||||
static int
|
||||
gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
|
@ -340,7 +341,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
|
@ -517,7 +518,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
* a-->b. We know that this one exists as in normal operation we have
|
||||
* at least a default route which matches.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
gre_compute_route(struct gre_softc *sc)
|
||||
{
|
||||
struct route *ro;
|
||||
|
@ -613,12 +614,11 @@ gre_in_cksum(u_int16_t *p, u_int len)
|
|||
}
|
||||
#endif
|
||||
|
||||
void greattach __P((int));
|
||||
void greattach(int);
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
greattach(count)
|
||||
int count;
|
||||
greattach(int count)
|
||||
{
|
||||
#ifdef INET
|
||||
LIST_INIT(&gre_softc_list);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_gre.h,v 1.15 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_gre.h,v 1.16 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -151,9 +151,6 @@ extern int ip_gre_ttl;
|
|||
LIST_HEAD(gre_softc_head, gre_softc);
|
||||
extern struct gre_softc_head gre_softc_list;
|
||||
|
||||
int gre_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int gre_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
u_int16_t gre_in_cksum(u_short *, u_int);
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_hippi.h,v 1.8 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_hippi.h,v 1.9 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -81,7 +81,7 @@ struct hippi_header {
|
|||
|
||||
|
||||
#ifdef _KERNEL
|
||||
void hippi_ifattach __P((struct ifnet *, caddr_t));
|
||||
void hippi_ip_input __P((struct ifnet *, struct mbuf *));
|
||||
void hippi_ifattach(struct ifnet *, caddr_t);
|
||||
void hippi_ip_input(struct ifnet *, struct mbuf *);
|
||||
#endif /* _KERNEL */
|
||||
#endif /* !_NET_IF_HIPPI_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_hippisubr.c,v 1.21 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_hippisubr.c,v 1.22 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1989, 1993
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_hippisubr.c,v 1.21 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_hippisubr.c,v 1.22 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -76,9 +76,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_hippisubr.c,v 1.21 2005/12/11 12:24:51 christos E
|
|||
#define llc_snap llc_un.type_snap
|
||||
#endif
|
||||
|
||||
static int hippi_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void hippi_input __P((struct ifnet *, struct mbuf *));
|
||||
static int hippi_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static void hippi_input(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* HIPPI output routine.
|
||||
|
@ -88,11 +88,8 @@ static void hippi_input __P((struct ifnet *, struct mbuf *));
|
|||
*/
|
||||
|
||||
static int
|
||||
hippi_output(ifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt0;
|
||||
hippi_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt0)
|
||||
{
|
||||
u_int16_t htype;
|
||||
u_int32_t ifield = 0;
|
||||
|
@ -241,9 +238,7 @@ hippi_output(ifp, m0, dst, rt0)
|
|||
*/
|
||||
|
||||
static void
|
||||
hippi_input(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
hippi_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
struct ifqueue *inq;
|
||||
struct llc *l;
|
||||
|
@ -314,9 +309,7 @@ hippi_input(ifp, m)
|
|||
|
||||
#ifdef INET
|
||||
void
|
||||
hippi_ip_input(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
hippi_ip_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
struct ifqueue *inq;
|
||||
int s;
|
||||
|
@ -338,9 +331,7 @@ hippi_ip_input(ifp, m)
|
|||
* Perform common duties while attaching to interface list
|
||||
*/
|
||||
void
|
||||
hippi_ifattach(ifp, lla)
|
||||
struct ifnet *ifp;
|
||||
caddr_t lla;
|
||||
hippi_ifattach(struct ifnet *ifp, caddr_t lla)
|
||||
{
|
||||
|
||||
ifp->if_type = IFT_HIPPI;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_loop.c,v 1.56 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_loop.c,v 1.57 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -65,7 +65,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.56 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.57 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -140,7 +140,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.56 2005/12/11 12:24:51 christos Exp $"
|
|||
#endif
|
||||
|
||||
#ifdef ALTQ
|
||||
void lostart(struct ifnet *);
|
||||
static void lostart(struct ifnet *);
|
||||
#endif
|
||||
|
||||
struct loop_softc {
|
||||
|
@ -148,12 +148,12 @@ struct loop_softc {
|
|||
struct ifnet sc_if;
|
||||
};
|
||||
|
||||
LIST_HEAD(, loop_softc) loop_softc_list;
|
||||
static LIST_HEAD(, loop_softc) loop_softc_list;
|
||||
|
||||
int loop_clone_create(struct if_clone *, int);
|
||||
int loop_clone_destroy(struct ifnet *);
|
||||
static int loop_clone_create(struct if_clone *, int);
|
||||
static int loop_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone loop_cloner =
|
||||
static struct if_clone loop_cloner =
|
||||
IF_CLONE_INITIALIZER("lo", loop_clone_create, loop_clone_destroy);
|
||||
|
||||
void
|
||||
|
@ -165,7 +165,7 @@ loopattach(int n)
|
|||
if_clone_attach(&loop_cloner);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
loop_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct loop_softc *sc;
|
||||
|
@ -207,7 +207,7 @@ loop_clone_create(struct if_clone *ifc, int unit)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
loop_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct loop_softc *sc = ifp->if_softc;
|
||||
|
@ -348,7 +348,7 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||
}
|
||||
|
||||
#ifdef ALTQ
|
||||
void
|
||||
static void
|
||||
lostart(struct ifnet *ifp)
|
||||
{
|
||||
struct ifqueue *ifq;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ppp.c,v 1.102 2005/11/27 05:35:52 thorpej Exp $ */
|
||||
/* $NetBSD: if_ppp.c,v 1.103 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -102,7 +102,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.102 2005/11/27 05:35:52 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.103 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "ppp.h"
|
||||
|
||||
|
@ -167,20 +167,20 @@ __KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.102 2005/11/27 05:35:52 thorpej Exp $")
|
|||
#include <net/ppp-comp.h>
|
||||
#endif
|
||||
|
||||
static int pppsioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
static void ppp_requeue __P((struct ppp_softc *));
|
||||
static void ppp_ccp __P((struct ppp_softc *, struct mbuf *m, int rcvd));
|
||||
static void ppp_ccp_closed __P((struct ppp_softc *));
|
||||
static void ppp_inproc __P((struct ppp_softc *, struct mbuf *));
|
||||
static void pppdumpm __P((struct mbuf *m0));
|
||||
static int pppsioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void ppp_requeue(struct ppp_softc *);
|
||||
static void ppp_ccp(struct ppp_softc *, struct mbuf *m, int rcvd);
|
||||
static void ppp_ccp_closed(struct ppp_softc *);
|
||||
static void ppp_inproc(struct ppp_softc *, struct mbuf *);
|
||||
static void pppdumpm(struct mbuf *m0);
|
||||
#ifdef ALTQ
|
||||
static void ppp_ifstart __P((struct ifnet *ifp));
|
||||
static void ppp_ifstart(struct ifnet *ifp);
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void pppnetisr(void);
|
||||
#endif
|
||||
void pppintr(void *);
|
||||
static void pppintr(void *);
|
||||
|
||||
/*
|
||||
* Some useful mbuf macros not in mbuf.h.
|
||||
|
@ -354,8 +354,7 @@ ppp_clone_destroy(struct ifnet *ifp)
|
|||
* Allocate a ppp interface unit and initialize it.
|
||||
*/
|
||||
struct ppp_softc *
|
||||
pppalloc(pid)
|
||||
pid_t pid;
|
||||
pppalloc(pid_t pid)
|
||||
{
|
||||
struct ppp_softc *sc = NULL, *scf;
|
||||
int i;
|
||||
|
@ -410,8 +409,7 @@ pppalloc(pid)
|
|||
* Deallocate a ppp unit. Must be called at splsoftnet or higher.
|
||||
*/
|
||||
void
|
||||
pppdealloc(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppdealloc(struct ppp_softc *sc)
|
||||
{
|
||||
struct mbuf *m;
|
||||
|
||||
|
@ -488,12 +486,8 @@ pppdealloc(sc)
|
|||
* Ioctl routine for generic ppp devices.
|
||||
*/
|
||||
int
|
||||
pppioctl(sc, cmd, data, flag, p)
|
||||
struct ppp_softc *sc;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, int flag,
|
||||
struct proc *p)
|
||||
{
|
||||
int s, error, flags, mru, npx;
|
||||
u_int nb;
|
||||
|
@ -747,10 +741,7 @@ pppioctl(sc, cmd, data, flag, p)
|
|||
* Process an ioctl request to the ppp network interface.
|
||||
*/
|
||||
static int
|
||||
pppsioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct ppp_softc *sc = ifp->if_softc;
|
||||
|
@ -872,11 +863,8 @@ pppsioctl(ifp, cmd, data)
|
|||
* Packet is placed in Information field of PPP frame.
|
||||
*/
|
||||
int
|
||||
pppoutput(ifp, m0, dst, rtp)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rtp;
|
||||
pppoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rtp)
|
||||
{
|
||||
struct ppp_softc *sc = ifp->if_softc;
|
||||
int protocol, address, control;
|
||||
|
@ -1056,8 +1044,7 @@ bad:
|
|||
* Should be called at splnet, since we muck with the queues.
|
||||
*/
|
||||
static void
|
||||
ppp_requeue(sc)
|
||||
struct ppp_softc *sc;
|
||||
ppp_requeue(struct ppp_softc *sc)
|
||||
{
|
||||
struct mbuf *m, **mpp;
|
||||
struct ifqueue *ifq;
|
||||
|
@ -1110,8 +1097,7 @@ ppp_requeue(sc)
|
|||
* remember to call sc->sc_start later at splsoftnet.
|
||||
*/
|
||||
void
|
||||
ppp_restart(sc)
|
||||
struct ppp_softc *sc;
|
||||
ppp_restart(struct ppp_softc *sc)
|
||||
{
|
||||
int s = splhigh(); /* XXX IMP ME HARDER */
|
||||
|
||||
|
@ -1131,8 +1117,7 @@ ppp_restart(sc)
|
|||
* protocol field compression to the packet.
|
||||
*/
|
||||
struct mbuf *
|
||||
ppp_dequeue(sc)
|
||||
struct ppp_softc *sc;
|
||||
ppp_dequeue(struct ppp_softc *sc)
|
||||
{
|
||||
struct mbuf *m, *mp;
|
||||
u_char *cp;
|
||||
|
@ -1274,7 +1259,7 @@ pppnetisr(void)
|
|||
/*
|
||||
* Software interrupt routine, called at splsoftnet.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pppintr(void *arg)
|
||||
{
|
||||
struct ppp_softc *sc = arg;
|
||||
|
@ -1305,10 +1290,7 @@ pppintr(void *arg)
|
|||
* 0 if it is about to be transmitted.
|
||||
*/
|
||||
static void
|
||||
ppp_ccp(sc, m, rcvd)
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf *m;
|
||||
int rcvd;
|
||||
ppp_ccp(struct ppp_softc *sc, struct mbuf *m, int rcvd)
|
||||
{
|
||||
u_char *dp, *ep;
|
||||
struct mbuf *mp;
|
||||
|
@ -1402,8 +1384,7 @@ ppp_ccp(sc, m, rcvd)
|
|||
* CCP is down; free (de)compressor state if necessary.
|
||||
*/
|
||||
static void
|
||||
ppp_ccp_closed(sc)
|
||||
struct ppp_softc *sc;
|
||||
ppp_ccp_closed(struct ppp_softc *sc)
|
||||
{
|
||||
if (sc->sc_xc_state) {
|
||||
(*sc->sc_xcomp->comp_free)(sc->sc_xc_state);
|
||||
|
@ -1423,10 +1404,7 @@ ppp_ccp_closed(sc)
|
|||
* were omitted.
|
||||
*/
|
||||
void
|
||||
ppppktin(sc, m, lost)
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf *m;
|
||||
int lost;
|
||||
ppppktin(struct ppp_softc *sc, struct mbuf *m, int lost)
|
||||
{
|
||||
int s = splhigh(); /* XXX IMP ME HARDER */
|
||||
|
||||
|
@ -1449,9 +1427,7 @@ ppppktin(sc, m, lost)
|
|||
TYPE_UNCOMPRESSED_TCP)
|
||||
|
||||
static void
|
||||
ppp_inproc(sc, m)
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf *m;
|
||||
ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_if;
|
||||
struct ifqueue *inq;
|
||||
|
@ -1755,8 +1731,7 @@ ppp_inproc(sc, m)
|
|||
#define MAX_DUMP_BYTES 128
|
||||
|
||||
static void
|
||||
pppdumpm(m0)
|
||||
struct mbuf *m0;
|
||||
pppdumpm(struct mbuf *m0)
|
||||
{
|
||||
char buf[3*MAX_DUMP_BYTES+4];
|
||||
char *bp = buf;
|
||||
|
@ -1793,8 +1768,7 @@ done:
|
|||
* if_start to send a packet.
|
||||
*/
|
||||
static void
|
||||
ppp_ifstart(ifp)
|
||||
struct ifnet *ifp;
|
||||
ppp_ifstart(struct ifnet *ifp)
|
||||
{
|
||||
struct ppp_softc *sc;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ppp.h,v 1.22 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_ppp.h,v 1.23 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: if_ppp.h,v 1.16 1997/04/30 05:46:04 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -172,6 +172,6 @@ struct ppp_rawin {
|
|||
#endif
|
||||
|
||||
#if defined(_KERNEL) || defined(KERNEL)
|
||||
void pppattach __P((void));
|
||||
void pppattach(void);
|
||||
#endif
|
||||
#endif /* !_NET_IF_PPP_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_pppoe.c,v 1.62 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_pppoe.c,v 1.63 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.62 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.63 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "pppoe.h"
|
||||
#include "bpfilter.h"
|
||||
|
@ -202,18 +202,17 @@ static struct mbuf *pppoe_get_mbuf(size_t len);
|
|||
static int pppoe_ifattach_hook(void *, struct mbuf **, struct ifnet *, int);
|
||||
#endif
|
||||
|
||||
LIST_HEAD(pppoe_softc_head, pppoe_softc) pppoe_softc_list;
|
||||
static LIST_HEAD(pppoe_softc_head, pppoe_softc) pppoe_softc_list;
|
||||
|
||||
int pppoe_clone_create __P((struct if_clone *, int));
|
||||
int pppoe_clone_destroy __P((struct ifnet *));
|
||||
static int pppoe_clone_create(struct if_clone *, int);
|
||||
static int pppoe_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone pppoe_cloner =
|
||||
static struct if_clone pppoe_cloner =
|
||||
IF_CLONE_INITIALIZER("pppoe", pppoe_clone_create, pppoe_clone_destroy);
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
pppoeattach(count)
|
||||
int count;
|
||||
pppoeattach(int count)
|
||||
{
|
||||
LIST_INIT(&pppoe_softc_list);
|
||||
if_clone_attach(&pppoe_cloner);
|
||||
|
@ -226,10 +225,8 @@ pppoeattach(count)
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
pppoe_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int
|
||||
pppoe_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct pppoe_softc *sc;
|
||||
|
||||
|
@ -275,9 +272,8 @@ pppoe_clone_create(ifc, unit)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
pppoe_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
static int
|
||||
pppoe_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct pppoe_softc * sc = ifp->if_softc;
|
||||
|
||||
|
@ -369,13 +365,15 @@ pppoe_find_softc_by_hunique(u_int8_t *token, size_t len, struct ifnet *rcvif)
|
|||
}
|
||||
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
static void pppoe_softintr_handler(void *dummy)
|
||||
static void
|
||||
pppoe_softintr_handler(void *dummy)
|
||||
{
|
||||
/* called at splsoftnet() */
|
||||
pppoe_input();
|
||||
}
|
||||
#else
|
||||
void pppoe_softintr_handler(void *dummy)
|
||||
void
|
||||
pppoe_softintr_handler(void *dummy)
|
||||
{
|
||||
int s = splnet();
|
||||
pppoe_input();
|
||||
|
@ -385,7 +383,7 @@ void pppoe_softintr_handler(void *dummy)
|
|||
|
||||
/* called at appropriate protection level */
|
||||
static void
|
||||
pppoe_input()
|
||||
pppoe_input(void)
|
||||
{
|
||||
struct mbuf *m;
|
||||
int s, disc_done, data_done;
|
||||
|
@ -414,7 +412,8 @@ pppoe_input()
|
|||
}
|
||||
|
||||
/* analyze and handle a single received packet while not in session state */
|
||||
static void pppoe_dispatch_disc_pkt(struct mbuf *m, int off)
|
||||
static void
|
||||
pppoe_dispatch_disc_pkt(struct mbuf *m, int off)
|
||||
{
|
||||
u_int16_t tag, len;
|
||||
u_int16_t session, plen;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_pppvar.h,v 1.20 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_pppvar.h,v 1.21 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: if_pppvar.h,v 1.3 1996/07/01 01:04:37 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -95,9 +95,9 @@ struct ppp_softc {
|
|||
int sc_unit; /* XXX unit number */
|
||||
u_int sc_flags; /* control/status bits; see if_ppp.h */
|
||||
void *sc_devp; /* pointer to device-dep structure */
|
||||
void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
|
||||
void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
|
||||
void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
|
||||
void (*sc_start)(struct ppp_softc *); /* start output proc */
|
||||
void (*sc_ctlp)(struct ppp_softc *); /* rcvd control pkt */
|
||||
void (*sc_relinq)(struct ppp_softc *); /* relinquish ifunit */
|
||||
struct callout sc_timo_ch; /* timeout callout */
|
||||
u_int16_t sc_mru; /* max receive unit */
|
||||
pid_t sc_xfer; /* used in transferring unit */
|
||||
|
@ -148,14 +148,14 @@ struct ppp_softc {
|
|||
|
||||
#ifdef _KERNEL
|
||||
|
||||
struct ppp_softc *pppalloc __P((pid_t));
|
||||
void pppdealloc __P((struct ppp_softc *));
|
||||
int pppioctl __P((struct ppp_softc *, u_long, caddr_t, int, struct proc *));
|
||||
void ppp_restart __P((struct ppp_softc *));
|
||||
void ppppktin __P((struct ppp_softc *, struct mbuf *, int));
|
||||
struct mbuf *ppp_dequeue __P((struct ppp_softc *));
|
||||
int pppoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
struct ppp_softc *pppalloc(pid_t);
|
||||
void pppdealloc(struct ppp_softc *);
|
||||
int pppioctl(struct ppp_softc *, u_long, caddr_t, int, struct proc *);
|
||||
void ppp_restart(struct ppp_softc *);
|
||||
void ppppktin(struct ppp_softc *, struct mbuf *, int);
|
||||
struct mbuf *ppp_dequeue(struct ppp_softc *);
|
||||
int pppoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_NET_IF_PPPVAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_sl.c,v 1.94 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_sl.c,v 1.95 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1989, 1992, 1993
|
||||
|
@ -60,7 +60,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.94 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.95 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "bpfilter.h"
|
||||
|
@ -187,10 +187,19 @@ struct if_clone sl_cloner =
|
|||
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void slnetisr(void);
|
||||
#endif
|
||||
void slintr(void *);
|
||||
static void slintr(void *);
|
||||
|
||||
static int slinit __P((struct sl_softc *));
|
||||
static struct mbuf *sl_btom __P((struct sl_softc *, int));
|
||||
static int slinit(struct sl_softc *);
|
||||
static struct mbuf *sl_btom(struct sl_softc *, int);
|
||||
|
||||
static int slclose(struct tty *, int);
|
||||
static int slinput(int, struct tty *);
|
||||
static int slioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int slopen(dev_t, struct tty *);
|
||||
static int sloutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
static int slstart(struct tty *);
|
||||
static int sltioctl(struct tty *, u_long, caddr_t, int, struct lwp *);
|
||||
|
||||
static struct linesw slip_disc = {
|
||||
.l_name = "slip",
|
||||
|
@ -205,6 +214,8 @@ static struct linesw slip_disc = {
|
|||
.l_poll = ttyerrpoll
|
||||
};
|
||||
|
||||
void slattach(void);
|
||||
|
||||
void
|
||||
slattach(void)
|
||||
{
|
||||
|
@ -261,8 +272,7 @@ sl_clone_destroy(struct ifnet *ifp)
|
|||
}
|
||||
|
||||
static int
|
||||
slinit(sc)
|
||||
struct sl_softc *sc;
|
||||
slinit(struct sl_softc *sc)
|
||||
{
|
||||
|
||||
if (sc->sc_mbuf == NULL) {
|
||||
|
@ -286,10 +296,8 @@ slinit(sc)
|
|||
* Attach the given tty to the first available sl unit.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
slopen(dev, tp)
|
||||
dev_t dev;
|
||||
struct tty *tp;
|
||||
static int
|
||||
slopen(dev_t dev, struct tty *tp)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct sl_softc *sc;
|
||||
|
@ -364,10 +372,8 @@ slopen(dev, tp)
|
|||
* Line specific close routine.
|
||||
* Detach the tty from the sl unit.
|
||||
*/
|
||||
int
|
||||
slclose(tp, flag)
|
||||
struct tty *tp;
|
||||
int flag;
|
||||
static int
|
||||
slclose(struct tty *tp, int flag)
|
||||
{
|
||||
struct sl_softc *sc;
|
||||
int s;
|
||||
|
@ -417,13 +423,8 @@ slclose(tp, flag)
|
|||
* Provide a way to get the sl unit number.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sltioctl(tp, cmd, data, flag, l)
|
||||
struct tty *tp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct lwp *l;
|
||||
static int
|
||||
sltioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct lwp *l)
|
||||
{
|
||||
struct sl_softc *sc = (struct sl_softc *)tp->t_sc;
|
||||
|
||||
|
@ -444,12 +445,9 @@ sltioctl(tp, cmd, data, flag, l)
|
|||
* will cause us to not compress "background" packets, because
|
||||
* ordering gets trashed. It can be done for all packets in slintr().
|
||||
*/
|
||||
int
|
||||
sloutput(ifp, m, dst, rtp)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rtp;
|
||||
static int
|
||||
sloutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rtp)
|
||||
{
|
||||
struct sl_softc *sc = ifp->if_softc;
|
||||
struct ip *ip;
|
||||
|
@ -528,9 +526,8 @@ sloutput(ifp, m, dst, rtp)
|
|||
* to send from the interface queue and map it to
|
||||
* the interface before starting output.
|
||||
*/
|
||||
int
|
||||
slstart(tp)
|
||||
struct tty *tp;
|
||||
static int
|
||||
slstart(struct tty *tp)
|
||||
{
|
||||
struct sl_softc *sc = tp->t_sc;
|
||||
|
||||
|
@ -566,9 +563,7 @@ slstart(tp)
|
|||
* Copy data buffer to mbuf chain; add ifnet pointer.
|
||||
*/
|
||||
static struct mbuf *
|
||||
sl_btom(sc, len)
|
||||
struct sl_softc *sc;
|
||||
int len;
|
||||
sl_btom(struct sl_softc *sc, int len)
|
||||
{
|
||||
struct mbuf *m;
|
||||
|
||||
|
@ -600,10 +595,8 @@ sl_btom(sc, len)
|
|||
/*
|
||||
* tty interface receiver interrupt.
|
||||
*/
|
||||
int
|
||||
slinput(c, tp)
|
||||
int c;
|
||||
struct tty *tp;
|
||||
static int
|
||||
slinput(int c, struct tty *tp)
|
||||
{
|
||||
struct sl_softc *sc;
|
||||
struct mbuf *m;
|
||||
|
@ -723,7 +716,7 @@ slnetisr(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
static void
|
||||
slintr(void *arg)
|
||||
{
|
||||
struct sl_softc *sc = arg;
|
||||
|
@ -1020,11 +1013,8 @@ slintr(void *arg)
|
|||
/*
|
||||
* Process an ioctl request.
|
||||
*/
|
||||
int
|
||||
slioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
static int
|
||||
slioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_slvar.h,v 1.30 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_slvar.h,v 1.31 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
|
@ -79,16 +79,4 @@ struct sl_softc {
|
|||
#define SC_NOICMP IFF_LINK1 /* supress ICMP traffic */
|
||||
#define SC_AUTOCOMP IFF_LINK2 /* auto-enable TCP compression */
|
||||
|
||||
#ifdef _KERNEL
|
||||
void slattach __P((void));
|
||||
int slclose __P((struct tty *, int));
|
||||
int slinput __P((int, struct tty *));
|
||||
int slioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int slopen __P((dev_t, struct tty *));
|
||||
int sloutput __P((struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct rtentry *));
|
||||
int slstart __P((struct tty *));
|
||||
int sltioctl __P((struct tty *, u_long, caddr_t, int, struct lwp *));
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_NET_IF_SLVAR_H_ */
|
||||
#endif /* _NET_IF_SLVAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_stf.c,v 1.49 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_stf.c,v 1.50 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -75,7 +75,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.49 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.50 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -142,10 +142,10 @@ struct stf_softc {
|
|||
LIST_ENTRY(stf_softc) sc_list;
|
||||
};
|
||||
|
||||
LIST_HEAD(, stf_softc) stf_softc_list;
|
||||
static LIST_HEAD(, stf_softc) stf_softc_list;
|
||||
|
||||
int stf_clone_create __P((struct if_clone *, int));
|
||||
int stf_clone_destroy __P((struct ifnet *));
|
||||
static int stf_clone_create(struct if_clone *, int);
|
||||
static int stf_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone stf_cloner =
|
||||
IF_CLONE_INITIALIZER("stf", stf_clone_create, stf_clone_destroy);
|
||||
|
@ -157,40 +157,38 @@ static int ip_gif_ttl = 40; /*XXX*/
|
|||
#endif
|
||||
|
||||
extern struct domain inetdomain;
|
||||
const struct protosw in_stf_protosw =
|
||||
static const struct protosw in_stf_protosw =
|
||||
{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
|
||||
in_stf_input, rip_output, 0, rip_ctloutput,
|
||||
rip_usrreq,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
void stfattach __P((int));
|
||||
static int stf_encapcheck __P((struct mbuf *, int, int, void *));
|
||||
static struct in6_ifaddr *stf_getsrcifa6 __P((struct ifnet *));
|
||||
static int stf_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *));
|
||||
static int isrfc1918addr __P((struct in_addr *));
|
||||
static int stf_checkaddr4 __P((struct stf_softc *, struct in_addr *,
|
||||
struct ifnet *));
|
||||
static int stf_checkaddr6 __P((struct stf_softc *, struct in6_addr *,
|
||||
struct ifnet *));
|
||||
static void stf_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
|
||||
static int stf_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
void stfattach(int);
|
||||
|
||||
static int stf_encapcheck(struct mbuf *, int, int, void *);
|
||||
static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *);
|
||||
static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *);
|
||||
static int isrfc1918addr(struct in_addr *);
|
||||
static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
|
||||
struct ifnet *);
|
||||
static int stf_checkaddr6(struct stf_softc *, struct in6_addr *,
|
||||
struct ifnet *);
|
||||
static void stf_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
static int stf_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
stfattach(count)
|
||||
int count;
|
||||
stfattach(int count)
|
||||
{
|
||||
|
||||
LIST_INIT(&stf_softc_list);
|
||||
if_clone_attach(&stf_cloner);
|
||||
}
|
||||
|
||||
int
|
||||
stf_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int
|
||||
stf_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct stf_softc *sc;
|
||||
|
||||
|
@ -228,9 +226,8 @@ stf_clone_create(ifc, unit)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
stf_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
static int
|
||||
stf_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct stf_softc *sc = (void *) ifp;
|
||||
|
||||
|
@ -246,11 +243,7 @@ stf_clone_destroy(ifp)
|
|||
}
|
||||
|
||||
static int
|
||||
stf_encapcheck(m, off, proto, arg)
|
||||
struct mbuf *m;
|
||||
int off;
|
||||
int proto;
|
||||
void *arg;
|
||||
stf_encapcheck(struct mbuf *m, int off, int proto, void *arg)
|
||||
{
|
||||
struct ip ip;
|
||||
struct in6_ifaddr *ia6;
|
||||
|
@ -308,8 +301,7 @@ stf_encapcheck(m, off, proto, arg)
|
|||
}
|
||||
|
||||
static struct in6_ifaddr *
|
||||
stf_getsrcifa6(ifp)
|
||||
struct ifnet *ifp;
|
||||
stf_getsrcifa6(struct ifnet *ifp)
|
||||
{
|
||||
struct ifaddr *ifa;
|
||||
struct in_ifaddr *ia4;
|
||||
|
@ -338,11 +330,8 @@ stf_getsrcifa6(ifp)
|
|||
}
|
||||
|
||||
static int
|
||||
stf_output(ifp, m, dst, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt;
|
||||
stf_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
struct stf_softc *sc;
|
||||
struct sockaddr_in6 *dst6;
|
||||
|
@ -453,8 +442,7 @@ stf_output(ifp, m, dst, rt)
|
|||
}
|
||||
|
||||
static int
|
||||
isrfc1918addr(in)
|
||||
struct in_addr *in;
|
||||
isrfc1918addr(struct in_addr *in)
|
||||
{
|
||||
/*
|
||||
* returns 1 if private address range:
|
||||
|
@ -469,10 +457,8 @@ isrfc1918addr(in)
|
|||
}
|
||||
|
||||
static int
|
||||
stf_checkaddr4(sc, in, inifp)
|
||||
struct stf_softc *sc;
|
||||
struct in_addr *in;
|
||||
struct ifnet *inifp; /* incoming interface */
|
||||
stf_checkaddr4(struct stf_softc *sc, struct in_addr *in,
|
||||
struct ifnet *inifp /*incoming interface*/)
|
||||
{
|
||||
struct in_ifaddr *ia4;
|
||||
|
||||
|
@ -542,10 +528,8 @@ stf_checkaddr4(sc, in, inifp)
|
|||
}
|
||||
|
||||
static int
|
||||
stf_checkaddr6(sc, in6, inifp)
|
||||
struct stf_softc *sc;
|
||||
struct in6_addr *in6;
|
||||
struct ifnet *inifp; /* incoming interface */
|
||||
stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6,
|
||||
struct ifnet *inifp /*incoming interface*/)
|
||||
{
|
||||
|
||||
/*
|
||||
|
@ -684,10 +668,7 @@ in_stf_input(struct mbuf *m, ...)
|
|||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
stf_rtrequest(cmd, rt, info)
|
||||
int cmd;
|
||||
struct rtentry *rt;
|
||||
struct rt_addrinfo *info;
|
||||
stf_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
|
||||
{
|
||||
if (rt != NULL) {
|
||||
struct stf_softc *sc;
|
||||
|
@ -698,10 +679,7 @@ stf_rtrequest(cmd, rt, info)
|
|||
}
|
||||
|
||||
static int
|
||||
stf_ioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct ifaddr *ifa;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_stf.h,v 1.3 2005/12/10 23:21:38 elad Exp $ */
|
||||
/* $NetBSD: if_stf.h,v 1.4 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* $KAME: if_stf.h,v 1.3 2000/03/25 07:23:33 sumikawa Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -37,6 +37,6 @@
|
|||
#define STF_MTU_MIN (1280) /* Minimum MTU */
|
||||
#define STF_MTU_MAX (8192) /* Maximum MTU */
|
||||
|
||||
void in_stf_input __P((struct mbuf *, ...));
|
||||
void in_stf_input(struct mbuf *, ...);
|
||||
|
||||
#endif /* !_NET_IF_STF_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_strip.c,v 1.63 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_strip.c,v 1.64 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -87,7 +87,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.63 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.64 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "bpfilter.h"
|
||||
|
@ -223,10 +223,10 @@ struct if_clone strip_cloner =
|
|||
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void stripnetisr(void);
|
||||
#endif
|
||||
void stripintr(void *);
|
||||
static void stripintr(void *);
|
||||
|
||||
static int stripinit __P((struct strip_softc *));
|
||||
static struct mbuf *strip_btom __P((struct strip_softc *, int));
|
||||
static int stripinit(struct strip_softc *);
|
||||
static struct mbuf *strip_btom(struct strip_softc *, int);
|
||||
|
||||
/*
|
||||
* STRIP header: '*' + modem address (dddd-dddd) + '*' + mactype ('SIP0')
|
||||
|
@ -255,23 +255,23 @@ struct st_header {
|
|||
* different STRIP implementations: *BSD, Linux, etc.
|
||||
*
|
||||
*/
|
||||
static u_char* UnStuffData __P((u_char *src, u_char *end, u_char
|
||||
*dest, u_long dest_length));
|
||||
static u_char* UnStuffData(u_char *src, u_char *end, u_char
|
||||
*dest, u_long dest_length);
|
||||
|
||||
static u_char* StuffData __P((u_char *src, u_long length, u_char *dest,
|
||||
u_char **code_ptr_ptr));
|
||||
static u_char* StuffData(u_char *src, u_long length, u_char *dest,
|
||||
u_char **code_ptr_ptr);
|
||||
|
||||
static void RecvErr __P((const char *msg, struct strip_softc *sc));
|
||||
static void RecvErr_Message __P((struct strip_softc *strip_info,
|
||||
u_char *sendername, const u_char *msg));
|
||||
void strip_resetradio __P((struct strip_softc *sc, struct tty *tp));
|
||||
void strip_proberadio __P((struct strip_softc *sc, struct tty *tp));
|
||||
void strip_watchdog __P((struct ifnet *ifp));
|
||||
void strip_sendbody __P((struct strip_softc *sc, struct mbuf *m));
|
||||
int strip_newpacket __P((struct strip_softc *sc, u_char *ptr, u_char *end));
|
||||
void strip_send __P((struct strip_softc *sc, struct mbuf *m0));
|
||||
static void RecvErr(const char *msg, struct strip_softc *sc);
|
||||
static void RecvErr_Message(struct strip_softc *strip_info,
|
||||
u_char *sendername, const u_char *msg);
|
||||
void strip_resetradio(struct strip_softc *sc, struct tty *tp);
|
||||
void strip_proberadio(struct strip_softc *sc, struct tty *tp);
|
||||
void strip_watchdog(struct ifnet *ifp);
|
||||
void strip_sendbody(struct strip_softc *sc, struct mbuf *m);
|
||||
int strip_newpacket(struct strip_softc *sc, u_char *ptr, u_char *end);
|
||||
void strip_send(struct strip_softc *sc, struct mbuf *m0);
|
||||
|
||||
void strip_timeout __P((void *x));
|
||||
void strip_timeout(void *x);
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DPRINTF(x) printf x
|
||||
|
@ -330,6 +330,15 @@ void strip_timeout __P((void *x));
|
|||
#define RADIO_PROBE_TIMEOUT(sc) \
|
||||
((sc)-> sc_statetimo > time.tv_sec)
|
||||
|
||||
static int stripclose(struct tty *, int);
|
||||
static int stripinput(int, struct tty *);
|
||||
static int stripioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int stripopen(dev_t, struct tty *);
|
||||
static int stripoutput(struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct rtentry *);
|
||||
static int stripstart(struct tty *);
|
||||
static int striptioctl(struct tty *, u_long, caddr_t, int, struct lwp *);
|
||||
|
||||
static struct linesw strip_disc = {
|
||||
.l_name = "strip",
|
||||
.l_open = stripopen,
|
||||
|
@ -406,8 +415,7 @@ strip_clone_destroy(struct ifnet *ifp)
|
|||
}
|
||||
|
||||
static int
|
||||
stripinit(sc)
|
||||
struct strip_softc *sc;
|
||||
stripinit(struct strip_softc *sc)
|
||||
{
|
||||
u_char *p;
|
||||
|
||||
|
@ -464,9 +472,7 @@ stripinit(sc)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
stripopen(dev, tp)
|
||||
dev_t dev;
|
||||
struct tty *tp;
|
||||
stripopen(dev_t dev, struct tty *tp)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct strip_softc *sc;
|
||||
|
@ -549,10 +555,8 @@ stripopen(dev, tp)
|
|||
* Line specific close routine.
|
||||
* Detach the tty from the strip unit.
|
||||
*/
|
||||
int
|
||||
stripclose(tp, flag)
|
||||
struct tty *tp;
|
||||
int flag;
|
||||
static int
|
||||
stripclose(struct tty *tp, int flag)
|
||||
{
|
||||
struct strip_softc *sc;
|
||||
int s;
|
||||
|
@ -621,12 +625,7 @@ stripclose(tp, flag)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
striptioctl(tp, cmd, data, flag, l)
|
||||
struct tty *tp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct lwp *l;
|
||||
striptioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct lwp *l)
|
||||
{
|
||||
struct strip_softc *sc = (struct strip_softc *)tp->t_sc;
|
||||
|
||||
|
@ -646,9 +645,7 @@ striptioctl(tp, cmd, data, flag, l)
|
|||
* byte-stuff (escape) it, and enqueue it on the tty send queue.
|
||||
*/
|
||||
void
|
||||
strip_sendbody(sc, m)
|
||||
struct strip_softc *sc;
|
||||
struct mbuf *m;
|
||||
strip_sendbody(struct strip_softc *sc, struct mbuf *m)
|
||||
{
|
||||
struct tty *tp = sc->sc_ttyp;
|
||||
u_char *dp = sc->sc_txbuf;
|
||||
|
@ -689,9 +686,7 @@ strip_sendbody(sc, m)
|
|||
* Send a STRIP packet. Must be called at spltty().
|
||||
*/
|
||||
void
|
||||
strip_send(sc, m0)
|
||||
struct strip_softc *sc;
|
||||
struct mbuf *m0;
|
||||
strip_send(struct strip_softc *sc, struct mbuf *m0)
|
||||
{
|
||||
struct tty *tp = sc->sc_ttyp;
|
||||
struct st_header *hdr;
|
||||
|
@ -744,11 +739,8 @@ strip_send(sc, m0)
|
|||
* ordering gets trashed. It can be done for all packets in stripintr().
|
||||
*/
|
||||
int
|
||||
stripoutput(ifp, m, dst, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt;
|
||||
stripoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
struct strip_softc *sc = ifp->if_softc;
|
||||
struct ip *ip;
|
||||
|
@ -910,8 +902,7 @@ stripoutput(ifp, m, dst, rt)
|
|||
*
|
||||
*/
|
||||
int
|
||||
stripstart(tp)
|
||||
struct tty *tp;
|
||||
stripstart(struct tty *tp)
|
||||
{
|
||||
struct strip_softc *sc = tp->t_sc;
|
||||
|
||||
|
@ -947,9 +938,7 @@ stripstart(tp)
|
|||
* Copy data buffer to mbuf chain; add ifnet pointer.
|
||||
*/
|
||||
static struct mbuf *
|
||||
strip_btom(sc, len)
|
||||
struct strip_softc *sc;
|
||||
int len;
|
||||
strip_btom(struct strip_softc *sc, int len)
|
||||
{
|
||||
struct mbuf *m;
|
||||
|
||||
|
@ -987,9 +976,7 @@ strip_btom(sc, len)
|
|||
* an mbuf, and put it on the protocol input queue.
|
||||
*/
|
||||
int
|
||||
stripinput(c, tp)
|
||||
int c;
|
||||
struct tty *tp;
|
||||
stripinput(int c, struct tty *tp)
|
||||
{
|
||||
struct strip_softc *sc;
|
||||
struct mbuf *m;
|
||||
|
@ -1109,7 +1096,7 @@ stripnetisr(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
static void
|
||||
stripintr(void *arg)
|
||||
{
|
||||
struct strip_softc *sc = arg;
|
||||
|
@ -1326,10 +1313,7 @@ stripintr(void *arg)
|
|||
* Process an ioctl request.
|
||||
*/
|
||||
int
|
||||
stripioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
stripioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr;
|
||||
|
@ -1388,9 +1372,7 @@ stripioctl(ifp, cmd, data)
|
|||
* Must be called at spltty().
|
||||
*/
|
||||
void
|
||||
strip_resetradio(sc, tp)
|
||||
struct strip_softc *sc;
|
||||
struct tty *tp;
|
||||
strip_resetradio(struct strip_softc *sc, struct tty *tp)
|
||||
{
|
||||
#if 0
|
||||
static ttychar_t InitString[] =
|
||||
|
@ -1438,9 +1420,7 @@ strip_resetradio(sc, tp)
|
|||
* should be caled at spl >= spltty.
|
||||
*/
|
||||
void
|
||||
strip_proberadio(sc, tp)
|
||||
struct strip_softc *sc;
|
||||
struct tty *tp;
|
||||
strip_proberadio(struct strip_softc *sc, struct tty *tp)
|
||||
{
|
||||
|
||||
int overflow;
|
||||
|
@ -1478,8 +1458,7 @@ static const char *strip_statenames[] = {
|
|||
* Will be needed to make strip work on ptys.
|
||||
*/
|
||||
void
|
||||
strip_timeout(x)
|
||||
void *x;
|
||||
strip_timeout(void *x)
|
||||
{
|
||||
struct strip_softc *sc = (struct strip_softc *) x;
|
||||
struct tty *tp = sc->sc_ttyp;
|
||||
|
@ -1514,8 +1493,7 @@ strip_timeout(x)
|
|||
* so we send a probe on its behalf.
|
||||
*/
|
||||
void
|
||||
strip_watchdog(ifp)
|
||||
struct ifnet *ifp;
|
||||
strip_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct strip_softc *sc = ifp->if_softc;
|
||||
struct tty *tp = sc->sc_ttyp;
|
||||
|
@ -1608,9 +1586,7 @@ strip_watchdog(ifp)
|
|||
* Process a received packet.
|
||||
*/
|
||||
int
|
||||
strip_newpacket(sc, ptr, end)
|
||||
struct strip_softc *sc;
|
||||
u_char *ptr, *end;
|
||||
strip_newpacket(struct strip_softc *sc, u_char *ptr, u_char *end)
|
||||
{
|
||||
int len = ptr - end;
|
||||
u_char *name, *name_end;
|
||||
|
@ -1955,9 +1931,7 @@ UnStuffData(u_char *src, u_char *end, u_char *dst, u_long dst_length)
|
|||
* from the STRIP driver.
|
||||
*/
|
||||
static void
|
||||
RecvErr(msg, sc)
|
||||
const char *msg;
|
||||
struct strip_softc *sc;
|
||||
RecvErr(const char *msg, struct strip_softc *sc)
|
||||
{
|
||||
#define MAX_RecErr 80
|
||||
u_char *ptr = sc->sc_pktstart;
|
||||
|
@ -1990,10 +1964,8 @@ RecvErr(msg, sc)
|
|||
* Parse an error message from the radio.
|
||||
*/
|
||||
static void
|
||||
RecvErr_Message(strip_info, sendername, msg)
|
||||
struct strip_softc *strip_info;
|
||||
u_char *sendername;
|
||||
const u_char *msg;
|
||||
RecvErr_Message(struct strip_softc *strip_info, u_char *sendername,
|
||||
const u_char *msg)
|
||||
{
|
||||
static const char ERR_001[] = "001"; /* Not in StarMode! */
|
||||
static const char ERR_002[] = "002"; /* Remap handle */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_stripvar.h,v 1.16 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_stripvar.h,v 1.17 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
#ifndef _NET_IF_STRIPVAR_H_
|
||||
#define _NET_IF_STRIPVAR_H_
|
||||
|
@ -56,15 +56,7 @@ struct strip_softc {
|
|||
#define SC_AUTOCOMP IFF_LINK2 /* auto-enable TCP compression */
|
||||
|
||||
#ifdef _KERNEL
|
||||
void stripattach __P((void));
|
||||
int stripclose __P((struct tty *, int));
|
||||
int stripinput __P((int, struct tty *));
|
||||
int stripioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int stripopen __P((dev_t, struct tty *));
|
||||
int stripoutput __P((struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct rtentry *));
|
||||
int stripstart __P((struct tty *));
|
||||
int striptioctl __P((struct tty *, u_long, caddr_t, int, struct lwp *));
|
||||
void stripattach(void);
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_NET_IF_STRIPVAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_token.h,v 1.11 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_token.h,v 1.12 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
|
@ -120,8 +120,8 @@ struct token_rif {
|
|||
#define token_delmulti ether_delmulti
|
||||
#define token_sprintf ether_sprintf
|
||||
|
||||
void token_ifattach __P((struct ifnet *, caddr_t));
|
||||
void token_ifdetach __P((struct ifnet *));
|
||||
void token_ifattach(struct ifnet *, caddr_t);
|
||||
void token_ifdetach(struct ifnet *);
|
||||
#endif
|
||||
|
||||
#endif /* !_NET_IF_TOKEN_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tokensubr.c,v 1.33 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_tokensubr.c,v 1.34 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1989, 1993
|
||||
|
@ -99,7 +99,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.33 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.34 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_atalk.h"
|
||||
|
@ -195,9 +195,9 @@ extern struct ifqueue pkintrq;
|
|||
#define RCF_ALLROUTES (2 << 8) | TOKEN_RCF_FRAME2 | TOKEN_RCF_BROADCAST_ALL
|
||||
#define RCF_SINGLEROUTE (2 << 8) | TOKEN_RCF_FRAME2 | TOKEN_RCF_BROADCAST_SINGLE
|
||||
|
||||
static int token_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void token_input __P((struct ifnet *, struct mbuf *));
|
||||
static int token_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static void token_input(struct ifnet *, struct mbuf *);
|
||||
|
||||
/*
|
||||
* Token Ring output routine.
|
||||
|
@ -206,11 +206,8 @@ static void token_input __P((struct ifnet *, struct mbuf *));
|
|||
* XXX route info has to go into the same mbuf as the header
|
||||
*/
|
||||
static int
|
||||
token_output(ifp, m0, dst, rt0)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt0;
|
||||
token_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt0)
|
||||
{
|
||||
u_int16_t etype;
|
||||
int error = 0;
|
||||
|
@ -529,9 +526,7 @@ bad:
|
|||
* the token ring header.
|
||||
*/
|
||||
static void
|
||||
token_input(ifp, m)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
token_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
struct ifqueue *inq;
|
||||
struct llc *l;
|
||||
|
@ -730,9 +725,7 @@ token_input(ifp, m)
|
|||
* Perform common duties while attaching to interface list
|
||||
*/
|
||||
void
|
||||
token_ifattach(ifp, lla)
|
||||
struct ifnet *ifp;
|
||||
caddr_t lla;
|
||||
token_ifattach(struct ifnet *ifp, caddr_t lla)
|
||||
{
|
||||
|
||||
ifp->if_type = IFT_ISO88025;
|
||||
|
@ -756,8 +749,7 @@ token_ifattach(ifp, lla)
|
|||
}
|
||||
|
||||
void
|
||||
token_ifdetach(ifp)
|
||||
struct ifnet *ifp;
|
||||
token_ifdetach(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
#if NBPFILTER > 0
|
||||
|
|
129
sys/net/if_tun.c
129
sys/net/if_tun.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tun.c,v 1.77 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: if_tun.c,v 1.78 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
|
||||
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.77 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.78 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -69,35 +69,36 @@ __KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.77 2005/12/11 12:24:51 christos Exp $")
|
|||
int tundebug = 0;
|
||||
|
||||
extern int ifqmaxlen;
|
||||
void tunattach __P((int));
|
||||
LIST_HEAD(, tun_softc) tun_softc_list;
|
||||
LIST_HEAD(, tun_softc) tunz_softc_list;
|
||||
void tunattach(int);
|
||||
|
||||
static LIST_HEAD(, tun_softc) tun_softc_list;
|
||||
static LIST_HEAD(, tun_softc) tunz_softc_list;
|
||||
static struct simplelock tun_softc_lock;
|
||||
|
||||
int tun_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
int tun_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *rt));
|
||||
int tun_clone_create __P((struct if_clone *, int));
|
||||
int tun_clone_destroy __P((struct ifnet *));
|
||||
static int tun_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int tun_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct rtentry *rt);
|
||||
static int tun_clone_create(struct if_clone *, int);
|
||||
static int tun_clone_destroy(struct ifnet *);
|
||||
|
||||
struct if_clone tun_cloner =
|
||||
static struct if_clone tun_cloner =
|
||||
IF_CLONE_INITIALIZER("tun", tun_clone_create, tun_clone_destroy);
|
||||
|
||||
static void tunattach0 __P((struct tun_softc *));
|
||||
static void tuninit __P((struct tun_softc *));
|
||||
static void tunattach0(struct tun_softc *);
|
||||
static void tuninit(struct tun_softc *);
|
||||
#ifdef ALTQ
|
||||
static void tunstart __P((struct ifnet *));
|
||||
static void tunstart(struct ifnet *);
|
||||
#endif
|
||||
static struct tun_softc *tun_find_unit __P((dev_t));
|
||||
static struct tun_softc *tun_find_zunit __P((int));
|
||||
static struct tun_softc *tun_find_unit(dev_t);
|
||||
static struct tun_softc *tun_find_zunit(int);
|
||||
|
||||
dev_type_open(tunopen);
|
||||
dev_type_close(tunclose);
|
||||
dev_type_read(tunread);
|
||||
dev_type_write(tunwrite);
|
||||
dev_type_ioctl(tunioctl);
|
||||
dev_type_poll(tunpoll);
|
||||
dev_type_kqfilter(tunkqfilter);
|
||||
static dev_type_open(tunopen);
|
||||
static dev_type_close(tunclose);
|
||||
static dev_type_read(tunread);
|
||||
static dev_type_write(tunwrite);
|
||||
static dev_type_ioctl(tunioctl);
|
||||
static dev_type_poll(tunpoll);
|
||||
static dev_type_kqfilter(tunkqfilter);
|
||||
|
||||
const struct cdevsw tun_cdevsw = {
|
||||
tunopen, tunclose, tunread, tunwrite, tunioctl,
|
||||
|
@ -105,8 +106,7 @@ const struct cdevsw tun_cdevsw = {
|
|||
};
|
||||
|
||||
void
|
||||
tunattach(unused)
|
||||
int unused;
|
||||
tunattach(int unused)
|
||||
{
|
||||
|
||||
simple_lock_init(&tun_softc_lock);
|
||||
|
@ -121,8 +121,7 @@ tunattach(unused)
|
|||
* Returns with tp locked (if found).
|
||||
*/
|
||||
static struct tun_softc *
|
||||
tun_find_unit(dev)
|
||||
dev_t dev;
|
||||
tun_find_unit(dev_t dev)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
int unit = minor(dev);
|
||||
|
@ -144,8 +143,7 @@ tun_find_unit(dev)
|
|||
* Remove tp from list and return it unlocked (if found).
|
||||
*/
|
||||
static struct tun_softc *
|
||||
tun_find_zunit(unit)
|
||||
int unit;
|
||||
tun_find_zunit(int unit)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
|
||||
|
@ -164,10 +162,8 @@ tun_find_zunit(unit)
|
|||
return (tp);
|
||||
}
|
||||
|
||||
int
|
||||
tun_clone_create(ifc, unit)
|
||||
struct if_clone *ifc;
|
||||
int unit;
|
||||
static int
|
||||
tun_clone_create(struct if_clone *ifc, int unit)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
|
||||
|
@ -195,9 +191,8 @@ tun_clone_create(ifc, unit)
|
|||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
tunattach0(tp)
|
||||
struct tun_softc *tp;
|
||||
static void
|
||||
tunattach0(struct tun_softc *tp)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
|
||||
|
@ -228,9 +223,8 @@ tunattach0(tp)
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
tun_clone_destroy(ifp)
|
||||
struct ifnet *ifp;
|
||||
static int
|
||||
tun_clone_destroy(struct ifnet *ifp)
|
||||
{
|
||||
struct tun_softc *tp = (void *)ifp;
|
||||
int s, zombie = 0;
|
||||
|
@ -277,11 +271,8 @@ tun_clone_destroy(ifp)
|
|||
* tunnel open - must be superuser & the device must be
|
||||
* configured in
|
||||
*/
|
||||
int
|
||||
tunopen(dev, flag, mode, l)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct lwp *l;
|
||||
static int
|
||||
tunopen(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
struct proc *p = l->l_proc;
|
||||
struct ifnet *ifp;
|
||||
|
@ -323,11 +314,7 @@ out_nolock:
|
|||
* routing info
|
||||
*/
|
||||
int
|
||||
tunclose(dev, flag, mode, l)
|
||||
dev_t dev;
|
||||
int flag;
|
||||
int mode;
|
||||
struct lwp *l;
|
||||
tunclose(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
int s;
|
||||
struct tun_softc *tp;
|
||||
|
@ -383,8 +370,7 @@ out_nolock:
|
|||
* Call at splnet() with tp locked.
|
||||
*/
|
||||
static void
|
||||
tuninit(tp)
|
||||
struct tun_softc *tp;
|
||||
tuninit(struct tun_softc *tp)
|
||||
{
|
||||
struct ifnet *ifp = &tp->tun_if;
|
||||
struct ifaddr *ifa;
|
||||
|
@ -418,11 +404,8 @@ tuninit(tp)
|
|||
/*
|
||||
* Process an ioctl request.
|
||||
*/
|
||||
int
|
||||
tun_ioctl(ifp, cmd, data)
|
||||
struct ifnet *ifp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
static int
|
||||
tun_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
int error = 0, s;
|
||||
struct tun_softc *tp = (struct tun_softc *)(ifp->if_softc);
|
||||
|
@ -484,12 +467,9 @@ tun_ioctl(ifp, cmd, data)
|
|||
/*
|
||||
* tun_output - queue packets from higher level ready to put out.
|
||||
*/
|
||||
int
|
||||
tun_output(ifp, m0, dst, rt)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m0;
|
||||
struct sockaddr *dst;
|
||||
struct rtentry *rt;
|
||||
static int
|
||||
tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct rtentry *rt)
|
||||
{
|
||||
struct tun_softc *tp = ifp->if_softc;
|
||||
int s;
|
||||
|
@ -573,12 +553,7 @@ out:
|
|||
* the cdevsw interface is now pretty minimal.
|
||||
*/
|
||||
int
|
||||
tunioctl(dev, cmd, data, flag, l)
|
||||
dev_t dev;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct lwp *l;
|
||||
tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
int s, error = 0;
|
||||
|
@ -673,10 +648,7 @@ out_nolock:
|
|||
* least as much of a packet as can be read.
|
||||
*/
|
||||
int
|
||||
tunread(dev, uio, ioflag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int ioflag;
|
||||
tunread(dev_t dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
struct ifnet *ifp;
|
||||
|
@ -768,10 +740,7 @@ out_nolock:
|
|||
* the cdevsw write interface - an atomic write is a packet - or else!
|
||||
*/
|
||||
int
|
||||
tunwrite(dev, uio, ioflag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int ioflag;
|
||||
tunwrite(dev_t dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
struct ifnet *ifp;
|
||||
|
@ -915,8 +884,7 @@ out0:
|
|||
* Should be called at splnet.
|
||||
*/
|
||||
static void
|
||||
tunstart(ifp)
|
||||
struct ifnet *ifp;
|
||||
tunstart(struct ifnet *ifp)
|
||||
{
|
||||
struct tun_softc *tp = ifp->if_softc;
|
||||
|
||||
|
@ -944,10 +912,7 @@ tunstart(ifp)
|
|||
* anyway, it either accepts the packet or drops it.
|
||||
*/
|
||||
int
|
||||
tunpoll(dev, events, l)
|
||||
dev_t dev;
|
||||
int events;
|
||||
struct lwp *l;
|
||||
tunpoll(dev_t dev, int events, struct lwp *l)
|
||||
{
|
||||
struct tun_softc *tp;
|
||||
struct ifnet *ifp;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ppp-comp.h,v 1.12 2005/12/10 23:21:39 elad Exp $ */
|
||||
/* $NetBSD: ppp-comp.h,v 1.13 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* ppp-comp.h - Definitions for doing PPP packet compression.
|
||||
|
@ -66,32 +66,32 @@ struct compressor {
|
|||
int compress_proto; /* CCP compression protocol number */
|
||||
|
||||
/* Allocate space for a compressor (transmit side) */
|
||||
void *(*comp_alloc) __P((u_char *, int));
|
||||
void *(*comp_alloc)(u_char *, int);
|
||||
/* Free space used by a compressor */
|
||||
void (*comp_free) __P((void *));
|
||||
void (*comp_free)(void *);
|
||||
/* Initialize a compressor */
|
||||
int (*comp_init) __P((void *, u_char *, int, int, int, int));
|
||||
int (*comp_init)(void *, u_char *, int, int, int, int);
|
||||
/* Reset a compressor */
|
||||
void (*comp_reset) __P((void *));
|
||||
void (*comp_reset)(void *);
|
||||
/* Compress a packet */
|
||||
int (*compress) __P((void *, PACKETPTR *, PACKETPTR, int, int));
|
||||
int (*compress)(void *, PACKETPTR *, PACKETPTR, int, int);
|
||||
/* Return compression statistics */
|
||||
void (*comp_stat) __P((void *, struct compstat *));
|
||||
void (*comp_stat)(void *, struct compstat *);
|
||||
|
||||
/* Allocate space for a decompressor (receive side) */
|
||||
void *(*decomp_alloc) __P((u_char *, int));
|
||||
void *(*decomp_alloc)(u_char *, int);
|
||||
/* Free space used by a decompressor */
|
||||
void (*decomp_free) __P((void *));
|
||||
void (*decomp_free)(void *);
|
||||
/* Initialize a decompressor */
|
||||
int (*decomp_init) __P((void *, u_char *, int, int, int, int, int));
|
||||
int (*decomp_init)(void *, u_char *, int, int, int, int, int);
|
||||
/* Reset a decompressor */
|
||||
void (*decomp_reset) __P((void *));
|
||||
void (*decomp_reset)(void *);
|
||||
/* Decompress a packet. */
|
||||
int (*decompress) __P((void *, PACKETPTR, PACKETPTR *));
|
||||
int (*decompress)(void *, PACKETPTR, PACKETPTR *);
|
||||
/* Update state for an incompressible packet received */
|
||||
void (*incomp) __P((void *, PACKETPTR));
|
||||
void (*incomp)(void *, PACKETPTR);
|
||||
/* Return decompression statistics */
|
||||
void (*decomp_stat) __P((void *, struct compstat *));
|
||||
void (*decomp_stat)(void *, struct compstat *);
|
||||
};
|
||||
#endif /* PACKETPTR */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ppp-deflate.c,v 1.12 2002/09/13 14:32:11 itojun Exp $ */
|
||||
/* $NetBSD: ppp-deflate.c,v 1.13 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: ppp-deflate.c,v 1.5 1997/03/04 03:33:28 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ppp-deflate.c,v 1.12 2002/09/13 14:32:11 itojun Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ppp-deflate.c,v 1.13 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -70,24 +70,24 @@ struct deflate_state {
|
|||
|
||||
#define DEFLATE_OVHD 2 /* Deflate overhead/packet */
|
||||
|
||||
static void *zalloc __P((void *, u_int items, u_int size));
|
||||
static void zfree __P((void *, void *ptr));
|
||||
static void *z_comp_alloc __P((u_char *options, int opt_len));
|
||||
static void *z_decomp_alloc __P((u_char *options, int opt_len));
|
||||
static void z_comp_free __P((void *state));
|
||||
static void z_decomp_free __P((void *state));
|
||||
static int z_comp_init __P((void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int debug));
|
||||
static int z_decomp_init __P((void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int mru, int debug));
|
||||
static int z_compress __P((void *state, struct mbuf **mret,
|
||||
struct mbuf *mp, int slen, int maxolen));
|
||||
static void z_incomp __P((void *state, struct mbuf *dmsg));
|
||||
static int z_decompress __P((void *state, struct mbuf *cmp,
|
||||
struct mbuf **dmpp));
|
||||
static void z_comp_reset __P((void *state));
|
||||
static void z_decomp_reset __P((void *state));
|
||||
static void z_comp_stats __P((void *state, struct compstat *stats));
|
||||
static void *zalloc(void *, u_int items, u_int size);
|
||||
static void zfree(void *, void *ptr);
|
||||
static void *z_comp_alloc(u_char *options, int opt_len);
|
||||
static void *z_decomp_alloc(u_char *options, int opt_len);
|
||||
static void z_comp_free(void *state);
|
||||
static void z_decomp_free(void *state);
|
||||
static int z_comp_init(void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int debug);
|
||||
static int z_decomp_init(void *state, u_char *options, int opt_len,
|
||||
int unit, int hdrlen, int mru, int debug);
|
||||
static int z_compress(void *state, struct mbuf **mret,
|
||||
struct mbuf *mp, int slen, int maxolen);
|
||||
static void z_incomp(void *state, struct mbuf *dmsg);
|
||||
static int z_decompress(void *state, struct mbuf *cmp,
|
||||
struct mbuf **dmpp);
|
||||
static void z_comp_reset(void *state);
|
||||
static void z_decomp_reset(void *state);
|
||||
static void z_comp_stats(void *state, struct compstat *stats);
|
||||
|
||||
/*
|
||||
* Procedures exported to if_ppp.c.
|
||||
|
@ -129,9 +129,7 @@ struct compressor ppp_deflate_draft = {
|
|||
* Space allocation and freeing routines for use by zlib routines.
|
||||
*/
|
||||
void *
|
||||
zalloc(notused, items, size)
|
||||
void *notused;
|
||||
u_int items, size;
|
||||
zalloc(void *notused, u_int items, u_int size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
|
@ -140,9 +138,7 @@ zalloc(notused, items, size)
|
|||
}
|
||||
|
||||
void
|
||||
zfree(notused, ptr)
|
||||
void *notused;
|
||||
void *ptr;
|
||||
zfree(void *notused, void *ptr)
|
||||
{
|
||||
free(ptr, M_DEVBUF);
|
||||
}
|
||||
|
@ -151,9 +147,7 @@ zfree(notused, ptr)
|
|||
* Allocate space for a compressor.
|
||||
*/
|
||||
static void *
|
||||
z_comp_alloc(options, opt_len)
|
||||
u_char *options;
|
||||
int opt_len;
|
||||
z_comp_alloc(u_char *options, int opt_len)
|
||||
{
|
||||
struct deflate_state *state;
|
||||
int w_size;
|
||||
|
@ -188,8 +182,7 @@ z_comp_alloc(options, opt_len)
|
|||
}
|
||||
|
||||
static void
|
||||
z_comp_free(arg)
|
||||
void *arg;
|
||||
z_comp_free(void *arg)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -198,10 +191,8 @@ z_comp_free(arg)
|
|||
}
|
||||
|
||||
static int
|
||||
z_comp_init(arg, options, opt_len, unit, hdrlen, debug)
|
||||
void *arg;
|
||||
u_char *options;
|
||||
int opt_len, unit, hdrlen, debug;
|
||||
z_comp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen,
|
||||
int debug)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -224,8 +215,7 @@ z_comp_init(arg, options, opt_len, unit, hdrlen, debug)
|
|||
}
|
||||
|
||||
static void
|
||||
z_comp_reset(arg)
|
||||
void *arg;
|
||||
z_comp_reset(void *arg)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -234,11 +224,10 @@ z_comp_reset(arg)
|
|||
}
|
||||
|
||||
int
|
||||
z_compress(arg, mret, mp, orig_len, maxolen)
|
||||
void *arg;
|
||||
struct mbuf **mret; /* compressed packet (out) */
|
||||
struct mbuf *mp; /* uncompressed packet (in) */
|
||||
int orig_len, maxolen;
|
||||
z_compress(void *arg,
|
||||
struct mbuf **mret /* compressed packet (out) */,
|
||||
struct mbuf *mp /* uncompressed packet (in) */,
|
||||
int orig_len, int maxolen)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
u_char *rptr, *wptr;
|
||||
|
@ -359,9 +348,7 @@ z_compress(arg, mret, mp, orig_len, maxolen)
|
|||
}
|
||||
|
||||
static void
|
||||
z_comp_stats(arg, stats)
|
||||
void *arg;
|
||||
struct compstat *stats;
|
||||
z_comp_stats(void *arg, struct compstat *stats)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
u_int out;
|
||||
|
@ -381,9 +368,7 @@ z_comp_stats(arg, stats)
|
|||
* Allocate space for a decompressor.
|
||||
*/
|
||||
static void *
|
||||
z_decomp_alloc(options, opt_len)
|
||||
u_char *options;
|
||||
int opt_len;
|
||||
z_decomp_alloc(u_char *options, int opt_len)
|
||||
{
|
||||
struct deflate_state *state;
|
||||
int w_size;
|
||||
|
@ -417,8 +402,7 @@ z_decomp_alloc(options, opt_len)
|
|||
}
|
||||
|
||||
static void
|
||||
z_decomp_free(arg)
|
||||
void *arg;
|
||||
z_decomp_free(void *arg)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -427,10 +411,8 @@ z_decomp_free(arg)
|
|||
}
|
||||
|
||||
static int
|
||||
z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug)
|
||||
void *arg;
|
||||
u_char *options;
|
||||
int opt_len, unit, hdrlen, mru, debug;
|
||||
z_decomp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen,
|
||||
int mru, int debug)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -454,8 +436,7 @@ z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug)
|
|||
}
|
||||
|
||||
static void
|
||||
z_decomp_reset(arg)
|
||||
void *arg;
|
||||
z_decomp_reset(void *arg)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
|
@ -480,9 +461,7 @@ z_decomp_reset(arg)
|
|||
* compression, even though they are detected by inspecting the input.
|
||||
*/
|
||||
int
|
||||
z_decompress(arg, mi, mop)
|
||||
void *arg;
|
||||
struct mbuf *mi, **mop;
|
||||
z_decompress(void *arg, struct mbuf *mi, struct mbuf **mop)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
struct mbuf *mo, *mo_head;
|
||||
|
@ -628,9 +607,7 @@ z_decompress(arg, mi, mop)
|
|||
* Incompressible data has arrived - add it to the history.
|
||||
*/
|
||||
static void
|
||||
z_incomp(arg, mi)
|
||||
void *arg;
|
||||
struct mbuf *mi;
|
||||
z_incomp(void *arg, struct mbuf *mi)
|
||||
{
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
u_char *rptr;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ppp_tty.c,v 1.40 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: ppp_tty.c,v 1.41 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -93,7 +93,7 @@
|
|||
/* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.40 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.41 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "ppp.h"
|
||||
|
||||
|
@ -132,16 +132,16 @@ __KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.40 2005/12/11 12:24:51 christos Exp $"
|
|||
#include <net/if_ppp.h>
|
||||
#include <net/if_pppvar.h>
|
||||
|
||||
int pppopen __P((dev_t dev, struct tty *tp));
|
||||
int pppclose __P((struct tty *tp, int flag));
|
||||
int pppread __P((struct tty *tp, struct uio *uio, int flag));
|
||||
int pppwrite __P((struct tty *tp, struct uio *uio, int flag));
|
||||
int ppptioctl __P((struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
struct lwp *));
|
||||
int pppinput __P((int c, struct tty *tp));
|
||||
int pppstart __P((struct tty *tp));
|
||||
static int pppopen(dev_t dev, struct tty *tp);
|
||||
static int pppclose(struct tty *tp, int flag);
|
||||
static int pppread(struct tty *tp, struct uio *uio, int flag);
|
||||
static int pppwrite(struct tty *tp, struct uio *uio, int flag);
|
||||
static int ppptioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
struct lwp *);
|
||||
static int pppinput(int c, struct tty *tp);
|
||||
static int pppstart(struct tty *tp);
|
||||
|
||||
struct linesw ppp_disc = {
|
||||
struct linesw ppp_disc = { /* XXX should be static */
|
||||
.l_name = "ppp",
|
||||
.l_open = pppopen,
|
||||
.l_close = pppclose,
|
||||
|
@ -154,18 +154,17 @@ struct linesw ppp_disc = {
|
|||
.l_poll = ttpoll
|
||||
};
|
||||
|
||||
static void ppprcvframe __P((struct ppp_softc *sc, struct mbuf *m));
|
||||
static u_int16_t pppfcs __P((u_int16_t fcs, u_char *cp, int len));
|
||||
static void pppsyncstart __P((struct ppp_softc *sc));
|
||||
static void pppasyncstart __P((struct ppp_softc *));
|
||||
static void pppasyncctlp __P((struct ppp_softc *));
|
||||
static void pppasyncrelinq __P((struct ppp_softc *));
|
||||
static void ppp_timeout __P((void *));
|
||||
static void pppgetm __P((struct ppp_softc *sc));
|
||||
static void pppdumpb __P((u_char *b, int l));
|
||||
static void ppplogchar __P((struct ppp_softc *, int));
|
||||
static void pppdumpframe __P((struct ppp_softc *sc, struct mbuf* m,
|
||||
int xmit));
|
||||
static void ppprcvframe(struct ppp_softc *sc, struct mbuf *m);
|
||||
static u_int16_t pppfcs(u_int16_t fcs, u_char *cp, int len);
|
||||
static void pppsyncstart(struct ppp_softc *sc);
|
||||
static void pppasyncstart(struct ppp_softc *);
|
||||
static void pppasyncctlp(struct ppp_softc *);
|
||||
static void pppasyncrelinq(struct ppp_softc *);
|
||||
static void ppp_timeout(void *);
|
||||
static void pppgetm(struct ppp_softc *sc);
|
||||
static void pppdumpb(u_char *b, int l);
|
||||
static void ppplogchar(struct ppp_softc *, int);
|
||||
static void pppdumpframe(struct ppp_softc *sc, struct mbuf* m, int xmit);
|
||||
|
||||
/*
|
||||
* Some useful mbuf macros not in mbuf.h.
|
||||
|
@ -201,10 +200,8 @@ static void pppdumpframe __P((struct ppp_softc *sc, struct mbuf* m,
|
|||
* Called from device open routine or ttioctl.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
pppopen(dev, tp)
|
||||
dev_t dev;
|
||||
struct tty *tp;
|
||||
static int
|
||||
pppopen(dev_t dev, struct tty *tp)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
struct ppp_softc *sc;
|
||||
|
@ -264,10 +261,8 @@ pppopen(dev, tp)
|
|||
* Detach the tty from the ppp unit.
|
||||
* Mimics part of ttyclose().
|
||||
*/
|
||||
int
|
||||
pppclose(tp, flag)
|
||||
struct tty *tp;
|
||||
int flag;
|
||||
static int
|
||||
pppclose(struct tty *tp, int flag)
|
||||
{
|
||||
struct ppp_softc *sc;
|
||||
int s;
|
||||
|
@ -292,8 +287,7 @@ pppclose(tp, flag)
|
|||
* Relinquish the interface unit to another device.
|
||||
*/
|
||||
static void
|
||||
pppasyncrelinq(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppasyncrelinq(struct ppp_softc *sc)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -321,11 +315,8 @@ pppasyncrelinq(sc)
|
|||
/*
|
||||
* Line specific (tty) read routine.
|
||||
*/
|
||||
int
|
||||
pppread(tp, uio, flag)
|
||||
struct tty *tp;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
static int
|
||||
pppread(struct tty *tp, struct uio *uio, int flag)
|
||||
{
|
||||
struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc;
|
||||
struct mbuf *m, *m0;
|
||||
|
@ -380,11 +371,8 @@ pppread(tp, uio, flag)
|
|||
/*
|
||||
* Line specific (tty) write routine.
|
||||
*/
|
||||
int
|
||||
pppwrite(tp, uio, flag)
|
||||
struct tty *tp;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
static int
|
||||
pppwrite(struct tty *tp, struct uio *uio, int flag)
|
||||
{
|
||||
struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc;
|
||||
struct mbuf *m, *m0;
|
||||
|
@ -445,13 +433,8 @@ pppwrite(tp, uio, flag)
|
|||
* the line specific l_ioctl routine from their ioctl routines.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
ppptioctl(tp, cmd, data, flag, l)
|
||||
struct tty *tp;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct lwp *l;
|
||||
static int
|
||||
ppptioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct lwp *l)
|
||||
{
|
||||
struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc;
|
||||
int error, s;
|
||||
|
@ -514,9 +497,7 @@ ppptioctl(tp, cmd, data, flag, l)
|
|||
* hdlc mode. caller gives up ownership of mbuf
|
||||
*/
|
||||
static void
|
||||
ppprcvframe(sc, m)
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf *m;
|
||||
ppprcvframe(struct ppp_softc *sc, struct mbuf *m)
|
||||
{
|
||||
int len, s;
|
||||
struct mbuf *n;
|
||||
|
@ -661,10 +642,7 @@ static const u_int16_t fcstab[256] = {
|
|||
* Calculate a new FCS given the current FCS and the new data.
|
||||
*/
|
||||
static u_int16_t
|
||||
pppfcs(fcs, cp, len)
|
||||
u_int16_t fcs;
|
||||
u_char *cp;
|
||||
int len;
|
||||
pppfcs(u_int16_t fcs, u_char *cp, int len)
|
||||
{
|
||||
while (len--)
|
||||
fcs = PPP_FCS(fcs, *cp++);
|
||||
|
@ -675,8 +653,7 @@ pppfcs(fcs, cp, len)
|
|||
* when there is data ready to be sent.
|
||||
*/
|
||||
static void
|
||||
pppsyncstart(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppsyncstart(struct ppp_softc *sc)
|
||||
{
|
||||
struct tty *tp = (struct tty *) sc->sc_devp;
|
||||
struct mbuf *m, *n;
|
||||
|
@ -713,8 +690,7 @@ pppsyncstart(sc)
|
|||
* when there is data ready to be sent.
|
||||
*/
|
||||
static void
|
||||
pppasyncstart(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppasyncstart(struct ppp_softc *sc)
|
||||
{
|
||||
struct tty *tp = (struct tty *) sc->sc_devp;
|
||||
struct mbuf *m;
|
||||
|
@ -902,8 +878,7 @@ pppasyncstart(sc)
|
|||
* the inq, at splsoftnet.
|
||||
*/
|
||||
static void
|
||||
pppasyncctlp(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppasyncctlp(struct ppp_softc *sc)
|
||||
{
|
||||
struct tty *tp;
|
||||
int s;
|
||||
|
@ -922,9 +897,8 @@ pppasyncctlp(sc)
|
|||
* called later at splsoftnet.
|
||||
* Called at spltty or higher.
|
||||
*/
|
||||
int
|
||||
pppstart(tp)
|
||||
struct tty *tp;
|
||||
static int
|
||||
pppstart(struct tty *tp)
|
||||
{
|
||||
struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc;
|
||||
|
||||
|
@ -964,8 +938,7 @@ pppstart(tp)
|
|||
* Timeout routine - try to start some more output.
|
||||
*/
|
||||
static void
|
||||
ppp_timeout(x)
|
||||
void *x;
|
||||
ppp_timeout(void *x)
|
||||
{
|
||||
struct ppp_softc *sc = (struct ppp_softc *) x;
|
||||
struct tty *tp = (struct tty *) sc->sc_devp;
|
||||
|
@ -981,8 +954,7 @@ ppp_timeout(x)
|
|||
* Allocate enough mbuf to handle current MRU.
|
||||
*/
|
||||
static void
|
||||
pppgetm(sc)
|
||||
struct ppp_softc *sc;
|
||||
pppgetm(struct ppp_softc *sc)
|
||||
{
|
||||
struct mbuf *m, **mp;
|
||||
int len;
|
||||
|
@ -1009,10 +981,8 @@ static const unsigned paritytab[8] = {
|
|||
0x69969669, 0x96696996, 0x96696996, 0x69969669
|
||||
};
|
||||
|
||||
int
|
||||
pppinput(c, tp)
|
||||
int c;
|
||||
struct tty *tp;
|
||||
static int
|
||||
pppinput(int c, struct tty *tp)
|
||||
{
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf *m;
|
||||
|
@ -1258,9 +1228,7 @@ pppinput(c, tp)
|
|||
#define MAX_DUMP_BYTES 128
|
||||
|
||||
static void
|
||||
ppplogchar(sc, c)
|
||||
struct ppp_softc *sc;
|
||||
int c;
|
||||
ppplogchar(struct ppp_softc *sc, int c)
|
||||
{
|
||||
if (c >= 0) {
|
||||
sc->sc_rawin.buf[sc->sc_rawin_start++] = c;
|
||||
|
@ -1280,9 +1248,7 @@ ppplogchar(sc, c)
|
|||
}
|
||||
|
||||
static void
|
||||
pppdumpb(b, l)
|
||||
u_char *b;
|
||||
int l;
|
||||
pppdumpb(u_char *b, int l)
|
||||
{
|
||||
char bf[3*MAX_DUMP_BYTES+4];
|
||||
char *bp = bf;
|
||||
|
@ -1302,10 +1268,7 @@ pppdumpb(b, l)
|
|||
}
|
||||
|
||||
static void
|
||||
pppdumpframe(sc, m, xmit)
|
||||
struct ppp_softc *sc;
|
||||
struct mbuf* m;
|
||||
int xmit;
|
||||
pppdumpframe(struct ppp_softc *sc, struct mbuf *m, int xmit)
|
||||
{
|
||||
int i,lcount,copycount,count;
|
||||
char lbuf[16];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: raw_cb.c,v 1.16 2005/12/11 12:24:51 christos Exp $ */
|
||||
/* $NetBSD: raw_cb.c,v 1.17 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_cb.c,v 1.16 2005/12/11 12:24:51 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_cb.c,v 1.17 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -67,9 +67,7 @@ u_long raw_recvspace = RAWRCVQ;
|
|||
* of buffer space for the socket.
|
||||
*/
|
||||
int
|
||||
raw_attach(so, proto)
|
||||
struct socket *so;
|
||||
int proto;
|
||||
raw_attach(struct socket *so, int proto)
|
||||
{
|
||||
struct rawcb *rp = sotorawcb(so);
|
||||
int error;
|
||||
|
@ -95,8 +93,7 @@ raw_attach(so, proto)
|
|||
* socket resources.
|
||||
*/
|
||||
void
|
||||
raw_detach(rp)
|
||||
struct rawcb *rp;
|
||||
raw_detach(struct rawcb *rp)
|
||||
{
|
||||
struct socket *so = rp->rcb_socket;
|
||||
|
||||
|
@ -115,8 +112,7 @@ raw_detach(rp)
|
|||
* Disconnect and possibly release resources.
|
||||
*/
|
||||
void
|
||||
raw_disconnect(rp)
|
||||
struct rawcb *rp;
|
||||
raw_disconnect(struct rawcb *rp)
|
||||
{
|
||||
|
||||
#ifdef notdef
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: raw_cb.h,v 1.18 2005/12/11 12:24:52 christos Exp $ */
|
||||
/* $NetBSD: raw_cb.h,v 1.19 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
|
@ -58,16 +58,16 @@ struct rawcb {
|
|||
LIST_HEAD(rawcbhead, rawcb);
|
||||
extern struct rawcbhead rawcb; /* head of list */
|
||||
|
||||
int raw_attach __P((struct socket *, int));
|
||||
void *raw_ctlinput __P((int, struct sockaddr *, void *));
|
||||
void raw_detach __P((struct rawcb *));
|
||||
void raw_disconnect __P((struct rawcb *));
|
||||
void raw_init __P((void));
|
||||
void raw_input __P((struct mbuf *, ...));
|
||||
int raw_usrreq __P((struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *));
|
||||
void raw_setsockaddr __P((struct rawcb *, struct mbuf *));
|
||||
void raw_setpeeraddr __P((struct rawcb *, struct mbuf *));
|
||||
int raw_attach(struct socket *, int);
|
||||
void *raw_ctlinput(int, struct sockaddr *, void *);
|
||||
void raw_detach(struct rawcb *);
|
||||
void raw_disconnect(struct rawcb *);
|
||||
void raw_init(void);
|
||||
void raw_input(struct mbuf *, ...);
|
||||
int raw_usrreq(struct socket *,
|
||||
int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
|
||||
void raw_setsockaddr(struct rawcb *, struct mbuf *);
|
||||
void raw_setpeeraddr(struct rawcb *, struct mbuf *);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: raw_usrreq.c,v 1.24 2005/12/11 12:24:52 christos Exp $ */
|
||||
/* $NetBSD: raw_usrreq.c,v 1.25 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.24 2005/12/11 12:24:52 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.25 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mbuf.h>
|
||||
|
@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.24 2005/12/11 12:24:52 christos Exp
|
|||
* Initialize raw connection block q.
|
||||
*/
|
||||
void
|
||||
raw_init()
|
||||
raw_init(void)
|
||||
{
|
||||
|
||||
LIST_INIT(&rawcb);
|
||||
|
@ -136,10 +136,7 @@ raw_input(struct mbuf *m0, ...)
|
|||
|
||||
/*ARGSUSED*/
|
||||
void *
|
||||
raw_ctlinput(cmd, arg, d)
|
||||
int cmd;
|
||||
struct sockaddr *arg;
|
||||
void *d;
|
||||
raw_ctlinput(int cmd, struct sockaddr *arg, void *d)
|
||||
{
|
||||
|
||||
if ((unsigned)cmd >= PRC_NCMDS)
|
||||
|
@ -149,9 +146,7 @@ raw_ctlinput(cmd, arg, d)
|
|||
}
|
||||
|
||||
void
|
||||
raw_setsockaddr(rp, nam)
|
||||
struct rawcb *rp;
|
||||
struct mbuf *nam;
|
||||
raw_setsockaddr(struct rawcb *rp, struct mbuf *nam)
|
||||
{
|
||||
|
||||
nam->m_len = rp->rcb_laddr->sa_len;
|
||||
|
@ -159,9 +154,7 @@ raw_setsockaddr(rp, nam)
|
|||
}
|
||||
|
||||
void
|
||||
raw_setpeeraddr(rp, nam)
|
||||
struct rawcb *rp;
|
||||
struct mbuf *nam;
|
||||
raw_setpeeraddr(struct rawcb *rp, struct mbuf *nam)
|
||||
{
|
||||
|
||||
nam->m_len = rp->rcb_faddr->sa_len;
|
||||
|
@ -170,11 +163,8 @@ raw_setpeeraddr(rp, nam)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
raw_usrreq(so, req, m, nam, control, l)
|
||||
struct socket *so;
|
||||
int req;
|
||||
struct mbuf *m, *nam, *control;
|
||||
struct lwp *l;
|
||||
raw_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
|
||||
struct mbuf *control, struct lwp *l)
|
||||
{
|
||||
struct rawcb *rp;
|
||||
struct proc *p;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: slcompress.c,v 1.27 2005/12/11 12:24:52 christos Exp $ */
|
||||
/* $NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: slcompress.c,v 1.3 1996/05/24 07:04:47 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.27 2005/12/11 12:24:52 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#ifdef INET
|
||||
|
@ -67,8 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.27 2005/12/11 12:24:52 christos Exp
|
|||
|
||||
|
||||
void
|
||||
sl_compress_init(comp)
|
||||
struct slcompress *comp;
|
||||
sl_compress_init(struct slcompress *comp)
|
||||
{
|
||||
u_int i;
|
||||
struct cstate *tstate = comp->tstate;
|
||||
|
@ -92,9 +91,7 @@ sl_compress_init(comp)
|
|||
* ID to use on transmission.
|
||||
*/
|
||||
void
|
||||
sl_compress_setup(comp, max_state)
|
||||
struct slcompress *comp;
|
||||
int max_state;
|
||||
sl_compress_setup(struct slcompress *comp, int max_state)
|
||||
{
|
||||
u_int i;
|
||||
struct cstate *tstate = comp->tstate;
|
||||
|
@ -173,11 +170,8 @@ sl_compress_setup(comp, max_state)
|
|||
}
|
||||
|
||||
u_int
|
||||
sl_compress_tcp(m, ip, comp, compress_cid)
|
||||
struct mbuf *m;
|
||||
struct ip *ip;
|
||||
struct slcompress *comp;
|
||||
int compress_cid;
|
||||
sl_compress_tcp(struct mbuf *m, struct ip *ip, struct slcompress *comp,
|
||||
int compress_cid)
|
||||
{
|
||||
struct cstate *cs = comp->last_cs->cs_next;
|
||||
u_int hlen = ip->ip_hl;
|
||||
|
@ -433,11 +427,7 @@ uncompressed:
|
|||
|
||||
|
||||
int
|
||||
sl_uncompress_tcp(bufp, len, type, comp)
|
||||
u_char **bufp;
|
||||
int len;
|
||||
u_int type;
|
||||
struct slcompress *comp;
|
||||
sl_uncompress_tcp(u_char **bufp, int len, u_int type, struct slcompress *comp)
|
||||
{
|
||||
u_char *hdr, *cp;
|
||||
int vjlen;
|
||||
|
@ -482,13 +472,8 @@ sl_uncompress_tcp(bufp, len, type, comp)
|
|||
* in *hdrp and its length in *hlenp.
|
||||
*/
|
||||
int
|
||||
sl_uncompress_tcp_core(buf, buflen, total_len, type, comp, hdrp, hlenp)
|
||||
u_char *buf;
|
||||
int buflen, total_len;
|
||||
u_int type;
|
||||
struct slcompress *comp;
|
||||
u_char **hdrp;
|
||||
u_int *hlenp;
|
||||
sl_uncompress_tcp_core(u_char *buf, int buflen, int total_len, u_int type,
|
||||
struct slcompress *comp, u_char **hdrp, u_int *hlenp)
|
||||
{
|
||||
u_char *cp;
|
||||
u_int hlen, changes;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: slcompress.h,v 1.16 2005/12/10 23:21:39 elad Exp $ */
|
||||
/* $NetBSD: slcompress.h,v 1.17 2005/12/11 23:05:25 thorpej Exp $ */
|
||||
/* Id: slcompress.h,v 1.4 1994/09/21 06:50:08 paulus Exp */
|
||||
|
||||
/*
|
||||
|
@ -156,14 +156,14 @@ struct slcompress {
|
|||
/* flag values */
|
||||
#define SLF_TOSS 1 /* tossing rcvd frames because of input err */
|
||||
|
||||
void sl_compress_init __P((struct slcompress *));
|
||||
void sl_compress_setup __P((struct slcompress *, int));
|
||||
void sl_compress_init(struct slcompress *);
|
||||
void sl_compress_setup(struct slcompress *, int);
|
||||
#ifdef INET
|
||||
u_int sl_compress_tcp __P((struct mbuf *,
|
||||
struct ip *, struct slcompress *, int));
|
||||
u_int sl_compress_tcp(struct mbuf *,
|
||||
struct ip *, struct slcompress *, int);
|
||||
#endif
|
||||
int sl_uncompress_tcp __P((u_char **, int, u_int, struct slcompress *));
|
||||
int sl_uncompress_tcp_core __P((u_char *, int, int, u_int,
|
||||
struct slcompress *, u_char **, u_int *));
|
||||
int sl_uncompress_tcp(u_char **, int, u_int, struct slcompress *);
|
||||
int sl_uncompress_tcp_core(u_char *, int, int, u_int,
|
||||
struct slcompress *, u_char **, u_int *);
|
||||
|
||||
#endif /* !_NET_SLCOMPRESS_H_ */
|
||||
|
|
Loading…
Reference in New Issue