From ea0110598882bfc78c23cde9feaf1172f83b1a7a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 14 Apr 1997 18:23:25 +0000 Subject: [PATCH] Use LIST macros instead of insque/remque --- sys/net/raw_cb.c | 9 +++++---- sys/net/raw_cb.h | 7 +++---- sys/net/raw_usrreq.c | 7 +++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index 0676931cdc6e..5b39bc007ee7 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: raw_cb.c,v 1.10 1997/02/22 09:41:13 peter Exp $ */ #include @@ -58,7 +58,8 @@ * redo address binding to allow wildcards */ -struct rawcb rawcb; +struct rawcb_list_head rawcb_list; + static u_long raw_sendspace = RAWSNDQ; static u_long raw_recvspace = RAWRCVQ; @@ -87,7 +88,7 @@ raw_attach(so, proto) rp->rcb_socket = so; rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family; rp->rcb_proto.sp_protocol = proto; - insque(rp, &rawcb); + LIST_INSERT_HEAD(&rawcb_list, rp, list); return (0); } @@ -103,7 +104,7 @@ raw_detach(rp) so->so_pcb = 0; sofree(so); - remque(rp); + LIST_REMOVE(rp, list); #ifdef notdef if (rp->rcb_laddr) m_freem(dtom(rp->rcb_laddr)); diff --git a/sys/net/raw_cb.h b/sys/net/raw_cb.h index c1ed5e5e0a4d..bff398971ca2 100644 --- a/sys/net/raw_cb.h +++ b/sys/net/raw_cb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_cb.h 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: raw_cb.h,v 1.7 1997/02/22 09:41:13 peter Exp $ */ #ifndef _NET_RAW_CB_H_ @@ -42,8 +42,7 @@ * to tie a socket to the generic raw interface. */ struct rawcb { - struct rawcb *rcb_next; /* doubly linked list */ - struct rawcb *rcb_prev; + LIST_ENTRY(rawcb) list; struct socket *rcb_socket; /* back pointer to socket */ struct sockaddr *rcb_faddr; /* destination address */ struct sockaddr *rcb_laddr; /* socket's address */ @@ -59,7 +58,7 @@ struct rawcb { #define RAWRCVQ 8192 #ifdef KERNEL -extern struct rawcb rawcb; /* head of list */ +extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list; int raw_attach __P((struct socket *, int)); void raw_ctlinput __P((int, struct sockaddr *, void *)); diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index fb4faf4d6d5c..ae7729f1ce2e 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: raw_usrreq.c,v 1.10 1997/02/22 09:41:14 peter Exp $ */ #include @@ -55,8 +55,7 @@ void raw_init() { - - rawcb.rcb_next = rawcb.rcb_prev = &rawcb; + LIST_INIT(&rawcb_list); } @@ -80,7 +79,7 @@ raw_input(m0, proto, src, dst) struct socket *last; last = 0; - for (rp = rawcb.rcb_next; rp != &rawcb; rp = rp->rcb_next) { + LIST_FOREACH(rp, &rawcb_list, list) { if (rp->rcb_proto.sp_family != proto->sp_family) continue; if (rp->rcb_proto.sp_protocol &&