PERFORCE change 106015 for review
Paolo Pisati
piso at FreeBSD.org
Tue Sep 12 07:03:08 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=106015
Change 106015 by piso at 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 }
More information about the p4-projects
mailing list