From owner-p4-projects@FreeBSD.ORG Tue Sep 12 14:03:07 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 C159E16A416; Tue, 12 Sep 2006 14:03:07 +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 63FAB16A415 for ; Tue, 12 Sep 2006 14:03:07 +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 0F92743D46 for ; Tue, 12 Sep 2006 14:03:07 +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 k8CE372X040942 for ; Tue, 12 Sep 2006 14:03:07 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CE36TU040937 for perforce@freebsd.org; Tue, 12 Sep 2006 14:03:06 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 14:03:06 GMT Message-Id: <200609121403.k8CE36TU040937@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 106015 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: Tue, 12 Sep 2006 14:03:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=106015 Change 106015 by piso@piso_longino on 2006/09/12 14:02:26 style: function opening brace must go on the next line. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#13 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#7 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#20 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#9 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#9 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/libalias.3#6 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#13 (text+ko) ==== @@ -1491,7 +1491,8 @@ #ifndef _KERNEL int -LibAliasRefreshModules(void) { +LibAliasRefreshModules(void) +{ char buf[256], conf[] = "/etc/libalias.conf"; FILE *fd; int len; @@ -1517,7 +1518,8 @@ } int -LibAliasLoadModule(char *path) { +LibAliasLoadModule(char *path) +{ struct dll *t; void *handle; struct proto_handler *m; @@ -1558,7 +1560,8 @@ } int -LibAliasUnLoadAllModule(void) { +LibAliasUnLoadAllModule(void) +{ struct dll *t; struct proto_handler *p; ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#11 (text+ko) ==== @@ -71,7 +71,8 @@ struct in_addr original_addr); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->oaddr == NULL) return (-1); @@ -81,14 +82,16 @@ } static int -protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleCUSeeMeIn(la, pip, *ah->oaddr); return (0); } static int -protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleCUSeeMeOut(la, pip, ah->lnk); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#7 (text+ko) ==== @@ -467,7 +467,8 @@ #ifdef _KERNEL static void -AliasLog(char * str, const char * format, ...) { +AliasLog(char * str, const char * format, ...) +{ va_list ap; va_start(ap, format); @@ -477,7 +478,8 @@ } #else static void -AliasLog(FILE * stream, const char * format, ...) { +AliasLog(FILE * stream, const char * format, ...) +{ va_list ap; va_start(ap, format); @@ -488,7 +490,8 @@ #endif static void -ShowAliasStats(struct libalias *la) { +ShowAliasStats(struct libalias *la) +{ /* Used for debugging */ if (la->logDesc) { ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#10 (text+ko) ==== @@ -68,7 +68,8 @@ AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ /* * Check here all the data that will be used later, if any field @@ -93,7 +94,8 @@ */ static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleDummy(la, pip, ah); return (0); @@ -152,7 +154,8 @@ #endif static void -AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah) { +AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah) +{ ; /* Dummy. */ } ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#10 (text+ko) ==== @@ -108,7 +108,8 @@ int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -120,7 +121,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#11 (text+ko) ==== @@ -93,7 +93,8 @@ int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -105,7 +106,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleIrcOut(la, pip, ah->lnk, ah->maxpktsize); return (0); @@ -123,7 +125,8 @@ }; static int -mod_handler(module_t mod, int type, void *data) { +mod_handler(module_t mod, int type, void *data) +{ int error; switch (type) { ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#20 (text+ko) ==== @@ -101,14 +101,16 @@ } static void -_handler_chain_init(void) { +_handler_chain_init(void) +{ if (!rw_initialized(&handler_rw)) LIBALIAS_LOCK_INIT(); } static void -_handler_chain_destroy(void) { +_handler_chain_destroy(void) +{ if (rw_initialized(&handler_rw)) LIBALIAS_LOCK_DESTROY(); @@ -145,29 +147,34 @@ } static void -_handler_chain_init(void) { +_handler_chain_init(void) +{ ; } static void -_handler_chain_destroy(void) { +_handler_chain_destroy(void) +{ ; } #endif void -handler_chain_init(void) { +handler_chain_init(void) +{ _handler_chain_init(); } void -handler_chain_destroy(void) { +handler_chain_destroy(void) +{ _handler_chain_destroy(); } static int -_attach_handler(struct proto_handler *p) { +_attach_handler(struct proto_handler *p) +{ struct proto_handler *b = NULL; LIBALIAS_WLOCK_ASSERT(); @@ -190,7 +197,8 @@ } static int -_detach_handler(struct proto_handler *p) { +_detach_handler(struct proto_handler *p) +{ struct proto_handler *b, *b_tmp;; LIBALIAS_WLOCK_ASSERT(); @@ -204,7 +212,8 @@ } int -LibAliasAttachHandlers(struct proto_handler *_p) { +LibAliasAttachHandlers(struct proto_handler *_p) +{ int i, error = -1; LIBALIAS_WLOCK(); @@ -220,7 +229,8 @@ } int -LibAliasDetachHandlers(struct proto_handler *_p) { +LibAliasDetachHandlers(struct proto_handler *_p) +{ int i, error = -1; LIBALIAS_WLOCK(); @@ -236,7 +246,8 @@ } int -detach_handler(struct proto_handler *_p) { +detach_handler(struct proto_handler *_p) +{ int error = -1; LIBALIAS_WLOCK(); @@ -247,7 +258,8 @@ int find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, - struct alias_data *ad) { + struct alias_data *ad) +{ struct proto_handler *p; int error = ENOENT; @@ -265,7 +277,8 @@ } struct proto_handler * -first_handler(void) { +first_handler(void) +{ return (LIST_FIRST(&handler_chain)); } @@ -273,7 +286,8 @@ /* Dll manipulation code - this code is not thread safe... */ int -attach_dll(struct dll *p) { +attach_dll(struct dll *p) +{ struct dll *b; SLIST_FOREACH(b, &dll_chain, next) { @@ -285,7 +299,8 @@ } void * -detach_dll(char *p) { +detach_dll(char *p) +{ struct dll *b = NULL, *b_tmp; void *error = NULL; @@ -299,7 +314,8 @@ } struct dll * -walk_dll_chain(void) { +walk_dll_chain(void) +{ struct dll *t; t = SLIST_FIRST(&dll_chain); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#11 (text+ko) ==== @@ -85,7 +85,8 @@ AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *); static int -fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) @@ -97,14 +98,16 @@ } static int -protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport); return (0); } static int -fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) @@ -116,7 +119,8 @@ } static int -protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbtNS(la, pip, ah->lnk, ah->aaddr, ah->aport, ah->oaddr, ah->dport); @@ -124,7 +128,8 @@ } static int -protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, ah->aaddr, ah->aport); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#9 (text+ko) ==== @@ -93,7 +93,8 @@ AliasHandlePptpGreIn(struct libalias *, struct ip *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) return (-1); @@ -104,27 +105,31 @@ } static int -fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ return (0); } static int -protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandlePptpIn(la, pip, ah->lnk); return (0); } static int -protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandlePptpOut(la, pip, ah->lnk); return (0); } static int -protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY || AliasHandlePptpGreIn(la, pip) == 0) @@ -133,7 +138,8 @@ } static int -protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (AliasHandlePptpGreOut(la, pip) == 0) return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#9 (text+ko) ==== @@ -68,7 +68,8 @@ AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) return (-1); @@ -79,7 +80,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleSkinny(la, pip, ah->lnk); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#10 (text+ko) ==== @@ -137,7 +137,8 @@ AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -152,7 +153,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ntohs(*ah->dport) == TFTP_PORT_NUMBER) FindRtspOut(la, pip->ip_src, pip->ip_dst, ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/libalias.3#6 (text+ko) ==== @@ -1345,7 +1345,8 @@ static #endif int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ ... } @@ -1355,7 +1356,8 @@ #endif int protohandler(struct libalias *la, struct ip *pip, - struct alias_data *ah) { + struct alias_data *ah) +{ ... } @@ -1388,7 +1390,8 @@ .An 5) and place this function somewhere in main.c: .Pp .An static void -.An signal_handler(int sig) { +.An signal_handler(int sig) +.An { .Pp .An LibAliasRefreshModules(); .An }