mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 17:32:43 +00:00
Use LIST macros instead of insque/remque
This commit is contained in:
parent
0b5fe37814
commit
ea01105988
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24936
@ -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 <sys/param.h>
|
||||
@ -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));
|
||||
|
@ -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 *));
|
||||
|
@ -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 <sys/param.h>
|
||||
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user