From owner-svn-src-projects@FreeBSD.ORG Thu Aug 12 20:09:23 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390051065694; Thu, 12 Aug 2010 20:09:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 283338FC0A; Thu, 12 Aug 2010 20:09:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7CK9NWL082044; Thu, 12 Aug 2010 20:09:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7CK9N3T082042; Thu, 12 Aug 2010 20:09:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201008122009.o7CK9N3T082042@svn.freebsd.org> From: Attilio Rao Date: Thu, 12 Aug 2010 20:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211240 - projects/sv/usr.sbin/netdumpsrv X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 20:09:23 -0000 Author: attilio Date: Thu Aug 12 20:09:22 2010 New Revision: 211240 URL: http://svn.freebsd.org/changeset/base/211240 Log: Declare the prototypes of internal functions (and staticize them) in order to compile with WARNS=3. Modified: projects/sv/usr.sbin/netdumpsrv/netdump_server.c Modified: projects/sv/usr.sbin/netdumpsrv/netdump_server.c ============================================================================== --- projects/sv/usr.sbin/netdumpsrv/netdump_server.c Thu Aug 12 20:05:01 2010 (r211239) +++ projects/sv/usr.sbin/netdumpsrv/netdump_server.c Thu Aug 12 20:09:22 2010 (r211240) @@ -79,7 +79,33 @@ struct in_addr bindip; struct pidfh *pfh; int sock; -struct netdump_client * alloc_client(struct in_addr *ip) +static struct netdump_client *alloc_client(struct in_addr *ip); +static void eventloop(void); +static void exec_handler(struct netdump_client *client, + const char *reason); +static void free_client(struct netdump_client *client); +static int handle_finish(struct netdump_client *client, + struct netdump_msg *msg); +static int handle_herald(struct sockaddr_in *from, + struct netdump_client *client, + struct netdump_msg *msg); +static int handle_kdh(struct netdump_client *client, + struct netdump_msg *msg); +static int handle_packet(struct netdump_client *client, + struct sockaddr_in *from, const char *fromstr, + struct netdump_msg *msg); +static void handle_timeout(struct netdump_client *client); +static int handle_vmcore(struct netdump_client *client, + struct netdump_msg *msg); +static int receive_message(int sock, struct sockaddr_in *from, + char *fromstr, size_t fromstrlen, + struct netdump_msg *msg); +static void send_ack(struct netdump_client *client, + struct netdump_msg *msg); +static void signal_shutdown(int sig); +static void timeout_clients(void); + +static struct netdump_client *alloc_client(struct in_addr *ip) { struct sockaddr_in saddr; struct netdump_client *client; @@ -241,7 +267,7 @@ struct netdump_client * alloc_client(str return client; } -void free_client(struct netdump_client *client) +static void free_client(struct netdump_client *client) { /* Remove from the list */ SLIST_REMOVE(&clients, client, netdump_client, iter); @@ -251,7 +277,7 @@ void free_client(struct netdump_client * free(client); } -void exec_handler(struct netdump_client *client, const char *reason) +static void exec_handler(struct netdump_client *client, const char *reason) { int pid=fork(); @@ -276,7 +302,7 @@ void exec_handler(struct netdump_client } } -void handle_timeout(struct netdump_client *client) +static void handle_timeout(struct netdump_client *client) { printf("Client %s timed out\n", client_ntoa(client)); fputs("Dump incomplete: client timed out\n", client->infofile); @@ -284,7 +310,7 @@ void handle_timeout(struct netdump_clien free_client(client); } -void timeout_clients() +static void timeout_clients() { static time_t last_timeout_check; struct netdump_client *client, *tmp; @@ -306,7 +332,7 @@ void timeout_clients() } } -void send_ack(struct netdump_client *client, struct netdump_msg *msg) +static void send_ack(struct netdump_client *client, struct netdump_msg *msg) { struct netdump_ack ack; int tryagain; @@ -335,8 +361,8 @@ void send_ack(struct netdump_client *cli while (tryagain); } -int handle_herald(struct sockaddr_in *from, struct netdump_client *client, - struct netdump_msg *msg) +static int handle_herald(struct sockaddr_in *from, + struct netdump_client *client, struct netdump_msg *msg) { int freed_client=0; @@ -373,7 +399,7 @@ int handle_herald(struct sockaddr_in *fr return freed_client; } -int handle_kdh(struct netdump_client *client, struct netdump_msg *msg) +static int handle_kdh(struct netdump_client *client, struct netdump_msg *msg) { struct kerneldumpheader *h=(void *)msg->data; uint64_t dumplen; @@ -432,7 +458,7 @@ int handle_kdh(struct netdump_client *cl return 0; } -int handle_vmcore(struct netdump_client *client, struct netdump_msg *msg) +static int handle_vmcore(struct netdump_client *client, struct netdump_msg *msg) { if (!client) { @@ -464,7 +490,7 @@ int handle_vmcore(struct netdump_client return 0; } -int handle_finish(struct netdump_client *client, struct netdump_msg *msg) +static int handle_finish(struct netdump_client *client, struct netdump_msg *msg) { if (!client) { @@ -487,7 +513,7 @@ int handle_finish(struct netdump_client } -int receive_message(int sock, struct sockaddr_in *from, char *fromstr, +static int receive_message(int sock, struct sockaddr_in *from, char *fromstr, size_t fromstrlen, struct netdump_msg *msg) { socklen_t fromlen; @@ -532,8 +558,8 @@ int receive_message(int sock, struct soc return len; } -int handle_packet(struct netdump_client *client, struct sockaddr_in *from, - const char *fromstr, struct netdump_msg *msg) +static int handle_packet(struct netdump_client *client, + struct sockaddr_in *from, const char *fromstr, struct netdump_msg *msg) { int freed_client; @@ -565,7 +591,7 @@ int handle_packet(struct netdump_client return freed_client; } -void eventloop() +static void eventloop() { struct netdump_msg msg; @@ -717,7 +743,7 @@ void eventloop() } } -void signal_shutdown(int sig) +static void signal_shutdown(int sig) { do_shutdown=1; }