From owner-p4-projects@FreeBSD.ORG Mon Jul 3 09:50:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5AFA316A577; Mon, 3 Jul 2006 09:50:28 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30B9E16A47C for ; Mon, 3 Jul 2006 09:50:28 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33A4F43E61 for ; Mon, 3 Jul 2006 09:49:50 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k639nnZR065917 for ; Mon, 3 Jul 2006 09:49:49 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k639nnZA065914 for perforce@freebsd.org; Mon, 3 Jul 2006 09:49:49 GMT (envelope-from piso@freebsd.org) Date: Mon, 3 Jul 2006 09:49:49 GMT Message-Id: <200607030949.k639nnZA065914@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 100482 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2006 09:50:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=100482 Change 100482 by piso@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