PERFORCE change 100482 for review
Paolo Pisati
piso at FreeBSD.org
Mon Jul 3 09:50:30 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100482
Change 100482 by piso at piso_newluxor on 2006/07/03 09:49:10
style(9) cleanup: whitespace, newline and data type
cleanup. While here, put some XXX for stuff to be fixed
later.
Affected files ...
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.h#2 edit
Differences ...
==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.h#2 (text+ko) ====
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/*-
+/*
* Alias_mod.h defines the outside world interfaces for the packet aliasing
* modular framework
*/
@@ -32,13 +32,14 @@
#ifndef _ALIAS_MOD_H_
#define _ALIAS_MOD_H_
-/* protocol handlers struct & function*/
+/* Protocol handlers struct & function. */
-/* packet flow direction */
+/* Packet flow direction. */
#define IN 1
#define OUT 2
-/* working protocol */
+// XXX - use ip.h?
+/* Working protocol. */
#define IP 1
#define TCP 2
#define UDP 4
@@ -47,17 +48,16 @@
/*
* Data passed to protocol handler module, it must be filled
* right before calling find_handler() to determine which
- * module is elegible to be called
+ * module is elegible to be called.
*/
-struct alias_data {
-
+struct alias_data {
struct alias_link *lnk;
struct in_addr *original_address;
struct in_addr *alias_address;
- u_short *alias_port;
- u_int16_t *sport, *dport;
- int maxpacketsize;
+ uint16_t *alias_port;
+ uint16_t *sport, *dport;
+ uint16_t maxpacketsize;
};
/*
@@ -65,8 +65,8 @@
* a protocol handler correctly work.
*/
+// XXX - use queue(3)
struct proto_handler {
-
u_int pri; /* handler priority */
int16_t dir; /* flow direction */
int16_t proto; /* working protocol */
@@ -77,22 +77,14 @@
struct proto_handler *next;
};
-#if __FreeBSD_version >= 500000
+// XXX - use rwlock(9)
struct chain {
-
void *chain;
struct mtx mtx; /* lock guarding list */
int busy_count; /* busy count for rw locks */
int want_write;
struct cv cv;
};
-#else
-struct chain {
-
- void *chain;
- int spl;
-};
-#endif
/*
* Used only in userland when libalias needs to keep track of all
@@ -101,8 +93,7 @@
*/
#define DLL_LEN 32
-struct dll {
-
+struct dll {
char name[DLL_LEN]; /* name of module */
void *handle; /*
* ptr to shared obj obtained through
@@ -136,6 +127,7 @@
#define OK 1
#define NOK -1
+// XXX - convert all this stuff to use errno.h
/* end of handlers */
#define EOH -1
More information about the p4-projects
mailing list