static Queue *hm_queue;
static int retransmits_enabled = 0;
-static Queue *find_notice_in_queue __P((ZNotice_t *notice));
-static Code_t dump_queue __P((void));
-static void queue_timeout __P((void *arg));
+static Queue *find_notice_in_queue(ZNotice_t *notice);
+static Code_t dump_queue(void);
+static void queue_timeout(void *arg);
int rexmit_times[] = { 2, 2, 4, 4, 8, -1 };
#ifdef DEBUG
-Code_t dump_queue();
+Code_t dump_queue(void);
#endif
-void init_queue()
+void
+init_queue(void)
{
Queue *q;
DPR("Queue initialized and flushed.\n");
}
-Code_t add_notice_to_queue(notice, packet, repl, len)
- ZNotice_t *notice;
- char * packet;
- struct sockaddr_in *repl;
- int len;
+Code_t
+add_notice_to_queue(ZNotice_t *notice,
+ char *packet,
+ struct sockaddr_in *repl,
+ int len)
{
Queue *entry;
return(ZERR_NONE);
}
-Code_t remove_notice_from_queue(notice, kind, repl)
- ZNotice_t *notice;
- ZNotice_Kind_t *kind;
- struct sockaddr_in *repl;
+Code_t
+remove_notice_from_queue(ZNotice_t *notice,
+ ZNotice_Kind_t *kind,
+ struct sockaddr_in *repl)
{
Queue *entry;
}
/* We have a server; transmit all of our packets. */
-void retransmit_queue(sin)
- struct sockaddr_in *sin;
+void
+retransmit_queue(struct sockaddr_in *sin)
{
Queue *entry;
Code_t ret;
}
/* We lost our server; nuke all of our timers. */
-void disable_queue_retransmits()
+void
+disable_queue_retransmits(void)
{
Queue *entry;
}
#ifdef DEBUG
-static Code_t dump_queue()
+static Code_t
+dump_queue(void)
{
Queue *entry;
caddr_t mp;
}
#endif /* DEBUG */
-int queue_len()
+int
+queue_len(void)
{
int length = 0;
Queue *entry;
return length;
}
-static Queue *find_notice_in_queue(notice)
- ZNotice_t *notice;
+static Queue *
+find_notice_in_queue(ZNotice_t *notice)
{
Queue *entry;
return NULL;
}
-static void queue_timeout(arg)
- void *arg;
+static void
+queue_timeout(void *arg)
{
Queue *entry = (Queue *) arg;
Code_t ret;
static int num_timers = 0;
static int heap_size = 0;
-static void timer_botch __P((void*));
-static Timer *add_timer __P((Timer *));
+static void timer_botch (void*);
+static Timer *add_timer (Timer *);
-Timer *timer_set_rel(time_rel, proc, arg)
- long time_rel;
- void (*proc) __P((void *));
- void *arg;
+Timer *
+timer_set_rel(long time_rel,
+ void (*proc)(void *),
+ void *arg)
{
Timer *new_t;
}
void
-timer_reset(tmr)
- Timer *tmr;
+timer_reset(Timer *tmr)
{
int pos, min;
#define set_timeval(t,s) ((t).tv_sec=(s),(t).tv_usec=0,(t))
static Timer *
-add_timer(new)
- Timer *new;
+add_timer(Timer *new)
{
int pos;
}
void
-timer_process()
+timer_process(void)
{
Timer *t;
timer_proc func;
}
struct timeval *
-timer_timeout(tvbuf)
- struct timeval *tvbuf;
+timer_timeout(struct timeval *tvbuf)
{
if (num_timers > 0) {
tvbuf->tv_sec = heap[0]->abstime - time(NULL);
}
static void
-timer_botch(arg)
- void *arg;
+timer_botch(void *arg)
{
syslog(LOG_CRIT, "timer botch\n");
abort();
char hostname[MAXHOSTNAMELEN], loopback[4];
char PidFile[128];
-static RETSIGTYPE deactivate __P((void));
-static RETSIGTYPE terminate __P((void));
-static void choose_server __P((void));
-static void init_hm __P((void));
-static void detach __P((void));
-static void send_stats __P((ZNotice_t *, struct sockaddr_in *));
-static char *strsave __P((const char *));
+static RETSIGTYPE deactivate(int);
+static RETSIGTYPE terminate(int);
+static void choose_server(void);
+static void init_hm(void);
+static void detach(void);
+static void send_stats(ZNotice_t *, struct sockaddr_in *);
+static char *strsave(const char *);
extern int optind;
-static RETSIGTYPE deactivate()
+static RETSIGTYPE
+deactivate(int ignored)
{
deactivating = 1;
}
-static RETSIGTYPE terminate()
+static RETSIGTYPE
+terminate(int ignored)
{
terminating = 1;
}
-main(argc, argv)
-char *argv[];
+int
+main(int argc,
+ char *argv[])
{
ZNotice_t notice;
ZPacket_t packet;
}
}
-static void choose_server()
+static void
+choose_server(void)
{
int i = 0;
char **clust_info, **cpp;
}
}
-static void init_hm()
+static void
+init_hm(void)
{
struct servent *sp;
Code_t ret;
#endif
}
-static void detach()
+static void
+detach(void)
{
/* detach from terminal and fork. */
register int i, x = ZGetFD();
static char version[BUFSIZ];
-static void send_stats(notice, sin)
- ZNotice_t *notice;
- struct sockaddr_in *sin;
+static void
+send_stats(ZNotice_t *notice,
+ struct sockaddr_in *sin)
{
ZNotice_t newnotice;
Code_t ret;
free(list[i]);
}
-void die_gracefully()
+void
+die_gracefully(void)
{
syslog(LOG_INFO, "Terminate signal caught...");
unlink(PidFile);
exit(0);
}
-static char *strsave(sp)
- const char *sp;
+static char *
+strsave(const char *sp)
{
register char *ret;
- if((ret = malloc((unsigned) strlen(sp)+1)) == NULL) {
+ if((ret = strdup(sp)) == NULL) {
abort();
}
- strcpy(ret,sp);
return(ret);
}
extern int no_server, nclt, deactivated, noflushflag;
extern struct sockaddr_in cli_sin, serv_sin, from;
-void transmission_tower(notice, packet, pak_len)
- ZNotice_t *notice;
- char *packet;
- int pak_len;
+void transmission_tower(ZNotice_t *notice,
+ char *packet,
+ int pak_len)
{
ZNotice_t gack;
Code_t ret;
}
Code_t
-send_outgoing(notice)
-ZNotice_t *notice;
+send_outgoing(ZNotice_t *notice)
{
Code_t retval;
char *packet;
extern int numserv;
extern char **serv_list;
extern char cur_serv[], prim_serv[];
-extern void die_gracefully();
+extern void die_gracefully(void);
-void hm_control(), send_back(), new_server();
+void hm_control(ZNotice_t *);
+void send_back(ZNotice_t *);
+void new_server(char *);
/* Argument is whether we are actually booting, or just attaching
* after a server switch */
void
-send_boot_notice(op)
-char *op;
+send_boot_notice(char *op)
{
ZNotice_t notice;
Code_t ret;
/* Argument is whether we are detaching or really going down */
void
-send_flush_notice(op)
-char *op;
+send_flush_notice(char *op)
{
ZNotice_t notice;
Code_t ret;
}
void
-find_next_server(sugg_serv)
-char *sugg_serv;
+find_next_server(char *sugg_serv)
{
struct hostent *hp;
int done = 0;
}
void
-server_manager(notice)
-ZNotice_t *notice;
+server_manager(ZNotice_t *notice)
{
if (memcmp((char *)&serv_sin.sin_addr, (char *)&from.sin_addr, 4) ||
(serv_sin.sin_port != from.sin_port)) {
}
void
-hm_control(notice)
-ZNotice_t *notice;
+hm_control(ZNotice_t *notice)
{
Code_t ret;
struct hostent *hp;
}
void
-send_back(notice)
-ZNotice_t *notice;
+send_back(ZNotice_t *notice)
{
ZNotice_Kind_t kind;
struct sockaddr_in repl;
}
void
-new_server(sugg_serv)
-char *sugg_serv;
+new_server(char *sugg_serv)
{
no_server = 1;
syslog (LOG_INFO, "Server went down, finding new server.");
disable_queue_retransmits();
}
-static void boot_timeout(arg)
-void *arg;
+static void
+boot_timeout(void *arg)
{
serv_timeouts++;
new_server(NULL);