diff options
author | harti <harti@FreeBSD.org> | 2003-08-06 13:46:15 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-08-06 13:46:15 +0000 |
commit | 4af00ec0ba74014550bd3c1ab9baa19ad3aae7d2 (patch) | |
tree | b113dd36b988889ad169e2cafd16df066b160841 /sys/netnatm/natm.h | |
parent | a74328e4ef7573138465d87cc353a5e7a0aaba8d (diff) | |
download | FreeBSD-src-4af00ec0ba74014550bd3c1ab9baa19ad3aae7d2.zip FreeBSD-src-4af00ec0ba74014550bd3c1ab9baa19ad3aae7d2.tar.gz |
Style(9): remove unneccesary space and blank lines, indentation,
function prototypes. Use LIST_FOREACH instead of explicit loops.
The indentation of functions indendet by 4 space have been left alone.
2-space indented functions have been re-indented.
Diffstat (limited to 'sys/netnatm/natm.h')
-rw-r--r-- | sys/netnatm/natm.h | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/sys/netnatm/natm.h b/sys/netnatm/natm.h index aa4cf3c..d0469df 100644 --- a/sys/netnatm/natm.h +++ b/sys/netnatm/natm.h @@ -37,34 +37,31 @@ * natm.h: native mode atm */ - /* * supported protocols */ - -#define PROTO_NATMAAL0 1 -#define PROTO_NATMAAL5 2 +#define PROTO_NATMAAL0 1 +#define PROTO_NATMAAL5 2 /* * sockaddr_natm */ struct sockaddr_natm { - u_int8_t snatm_len; /* length */ - u_int8_t snatm_family; /* AF_NATM */ - char snatm_if[IFNAMSIZ]; /* interface name */ - u_int16_t snatm_vci; /* vci */ - u_int8_t snatm_vpi; /* vpi */ + unsigned char snatm_len; /* length */ + sa_family_t snatm_family; /* AF_NATM */ + char snatm_if[IFNAMSIZ]; /* interface name */ + u_int16_t snatm_vci; /* vci */ + u_int8_t snatm_vpi; /* vpi */ }; - #if defined(__FreeBSD__) && defined(_KERNEL) -#define SPLSOFTNET() splnet() +#define SPLSOFTNET() splnet() #elif defined(__NetBSD__) || defined(__OpenBSD__) -#define SPLSOFTNET() splsoftnet() +#define SPLSOFTNET() splsoftnet() #endif @@ -73,28 +70,27 @@ struct sockaddr_natm { /* * natm protocol control block */ - struct natmpcb { - LIST_ENTRY(natmpcb) pcblist; /* list pointers */ - u_int npcb_inq; /* # of our pkts in proto q */ - struct socket *npcb_socket; /* backpointer to socket */ - struct ifnet *npcb_ifp; /* pointer to hardware */ - struct in_addr ipaddr; /* remote IP address, if APCB_IP */ - u_int16_t npcb_vci; /* VCI */ - u_int8_t npcb_vpi; /* VPI */ - u_int8_t npcb_flags; /* flags */ + LIST_ENTRY(natmpcb) pcblist; /* list pointers */ + u_int npcb_inq; /* # of our pkts in proto q */ + struct socket *npcb_socket; /* backpointer to socket */ + struct ifnet *npcb_ifp; /* pointer to hardware */ + struct in_addr ipaddr; /* remote IP address, if APCB_IP */ + u_int16_t npcb_vci; /* VCI */ + u_int8_t npcb_vpi; /* VPI */ + u_int8_t npcb_flags; /* flags */ }; /* flags */ -#define NPCB_FREE 0x01 /* free (not on any list) */ -#define NPCB_CONNECTED 0x02 /* connected */ -#define NPCB_IP 0x04 /* used by IP */ -#define NPCB_DRAIN 0x08 /* destory as soon as inq == 0 */ -#define NPCB_RAW 0x10 /* in 'raw' mode? */ +#define NPCB_FREE 0x01 /* free (not on any list) */ +#define NPCB_CONNECTED 0x02 /* connected */ +#define NPCB_IP 0x04 /* used by IP */ +#define NPCB_DRAIN 0x08 /* destory as soon as inq == 0 */ +#define NPCB_RAW 0x10 /* in 'raw' mode? */ /* flag arg to npcb_free */ -#define NPCB_REMOVE 0 /* remove from global list */ -#define NPCB_DESTROY 1 /* destroy and be free */ +#define NPCB_REMOVE 0 /* remove from global list */ +#define NPCB_DESTROY 1 /* destroy and be free */ /* * NPCB_RAWCC is a hack which applies to connections in 'raw' mode. it @@ -103,8 +99,7 @@ struct natmpcb { * * XXX: socket buffering needs to be looked at. */ - -#define NPCB_RAWCC (1024*1024) /* 1MB */ +#define NPCB_RAWCC (1024*1024) /* 1MB */ LIST_HEAD(npcblist, natmpcb); @@ -113,10 +108,10 @@ LIST_HEAD(npcblist, natmpcb); extern struct npcblist natm_pcbs; /* global list of pcbs */ #define NATM_STAT #ifdef NATM_STAT -extern u_int natm_sodropcnt, - natm_sodropbytes; /* account of droppage */ -extern u_int natm_sookcnt, - natm_sookbytes; /* account of ok */ +extern u_int natm_sodropcnt; +extern u_int natm_sodropbytes; /* account of droppage */ +extern u_int natm_sookcnt; +extern u_int natm_sookbytes; /* account of ok */ #endif /* atm_rawioctl: kernel's version of SIOCRAWATM [for internal use only!] */ @@ -124,34 +119,38 @@ struct atm_rawioctl { struct natmpcb *npcb; int rawvalue; }; -#define SIOCXRAWATM _IOWR('a', 125, struct atm_rawioctl) +#define SIOCXRAWATM _IOWR('a', 125, struct atm_rawioctl) /* external functions */ /* natm_pcb.c */ struct natmpcb *npcb_alloc(int); void npcb_free(struct natmpcb *, int); -struct natmpcb *npcb_add(struct natmpcb *, struct ifnet *, int, int); +struct natmpcb *npcb_add(struct natmpcb *, struct ifnet *, uint16_t, uint8_t); /* natm.c */ #if defined(__NetBSD__) || defined(__OpenBSD__) int natm_usrreq(struct socket *, int, struct mbuf *, - struct mbuf *, struct mbuf *, struct proc *); + struct mbuf *, struct mbuf *, struct proc *); #elif defined(__FreeBSD__) #if __FreeBSD__ > 2 /* * FreeBSD new usrreqs style appeared since 2.2. compatibility to old style * has gone since 3.0. */ -#define FREEBSD_USRREQS +#define FREEBSD_USRREQS extern struct pr_usrreqs natm_usrreqs; #else /* !( __FreeBSD__ > 2) */ int natm_usrreq(struct socket *, int, struct mbuf *, - struct mbuf *, struct mbuf *); + struct mbuf *, struct mbuf *); #endif /* !( __FreeBSD__ > 2) */ #endif -int natm0_sysctl(int *, u_int, void *, size_t *, void *, size_t); -int natm5_sysctl(int *, u_int, void *, size_t *, void *, size_t); + +#ifdef SYSCTL_HANDLER_ARGS +int natm0_sysctl(SYSCTL_HANDLER_ARGS); +int natm5_sysctl(SYSCTL_HANDLER_ARGS); +#endif + void natmintr(struct mbuf *); #endif |