summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_pcb.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-03-25 17:28:42 +0000
committerrwatson <rwatson@FreeBSD.org>2006-03-25 17:28:42 +0000
commit1cfd88a69729e158fe5ff02e63458690749fc413 (patch)
treeb7d264b4afb5b95b38d654f6039ddb85f9abca77 /sys/netipx/ipx_pcb.h
parentf594b5f37bad3af3a3ecddfae898048e07a57bc1 (diff)
downloadFreeBSD-src-1cfd88a69729e158fe5ff02e63458690749fc413.zip
FreeBSD-src-1cfd88a69729e158fe5ff02e63458690749fc413.tar.gz
Rework IPX/SPX socket and pcb reference model:
- Introduce invariant that all IPX/SPX sockets will have valid so_pcb pointers to ipxpcb structures, and that for SPX, the control block pointer will always be valid. Don't attempt to free the socket or pcb at various odd points, such as disconnect. - Add a new ipxpcb flag, IPXP_DROPPED, which will be set in place of freeing PCB's so that this invariant can be maintained. This flag is now checked instead of a NULL check in various socket protocol calls. - Introduce many assertions that this invariant holds. - Various pieces of code, such as the SPX timer code, no longer needs to jump through hoops in case it frees a PCB while running. - Break out ipx_pcbfree() from ipx_pcbdetach(). Likewise spx_pcbdetach(). - Comment on some SMP-related limitations to the SPX code. - Update copyrights. MFC after: 1 month
Diffstat (limited to 'sys/netipx/ipx_pcb.h')
-rw-r--r--sys/netipx/ipx_pcb.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/netipx/ipx_pcb.h b/sys/netipx/ipx_pcb.h
index e5de871..86071c1 100644
--- a/sys/netipx/ipx_pcb.h
+++ b/sys/netipx/ipx_pcb.h
@@ -2,7 +2,7 @@
* Copyright (c) 1984, 1985, 1986, 1987, 1993
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1995, Mike Mitchell
- * Copyright (c) 2004-2005 Robert N. M. Watson
+ * Copyright (c) 2004-2006 Robert N. M. Watson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -68,13 +68,15 @@ extern struct ipxpcbhead ipxrawpcb_list;
extern struct mtx ipxpcb_list_mtx;
#endif
-/* possible flags */
-
-#define IPXP_IN_ABORT 0x1 /* calling abort through socket */
-#define IPXP_RAWIN 0x2 /* show headers on input */
-#define IPXP_RAWOUT 0x4 /* show header on output */
-#define IPXP_ALL_PACKETS 0x8 /* Turn off higher proto processing */
-#define IPXP_CHECKSUM 0x10 /* use checksum on this socket */
+/*
+ * IPX/SPX PCB flags.
+ */
+#define IPXP_IN_ABORT 0x1 /* Calling abort through socket. */
+#define IPXP_RAWIN 0x2 /* Show headers on input. */
+#define IPXP_RAWOUT 0x4 /* Show header on output. */
+#define IPXP_ALL_PACKETS 0x8 /* Turn off higher proto processing. */
+#define IPXP_CHECKSUM 0x10 /* Use checksum on this socket. */
+#define IPXP_DROPPED 0x20 /* Connection dropped. */
#define IPX_WILDCARD 1
@@ -98,6 +100,7 @@ int ipx_pcbconnect(struct ipxpcb *ipxp, struct sockaddr *nam,
struct thread *p);
void ipx_pcbdetach(struct ipxpcb *ipxp);
void ipx_pcbdisconnect(struct ipxpcb *ipxp);
+void ipx_pcbfree(struct ipxpcb *ipxp);
struct ipxpcb *
ipx_pcblookup(struct ipx_addr *faddr, int lport, int wildp);
void ipx_setpeeraddr(struct ipxpcb *ipxp, struct sockaddr **nam);
OpenPOWER on IntegriCloud