summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/access.c24
-rw-r--r--server/acl_files.c50
-rw-r--r--server/bdump.c143
-rw-r--r--server/class.c63
-rw-r--r--server/client.c27
-rw-r--r--server/common.c13
-rw-r--r--server/dispatch.c103
-rw-r--r--server/kstuff.c49
-rw-r--r--server/main.c76
-rw-r--r--server/realm.c164
-rw-r--r--server/server.c165
-rw-r--r--server/subscr.c162
-rw-r--r--server/timer.c26
-rw-r--r--server/uloc.c118
-rw-r--r--server/version.c2
-rw-r--r--server/zserver.h207
-rw-r--r--server/zstring.c23
17 files changed, 622 insertions, 793 deletions
diff --git a/server/access.c b/server/access.c
index 8fcfe44..58854c8 100644
--- a/server/access.c
+++ b/server/access.c
@@ -58,10 +58,9 @@ static void access_setup __P((int first));
*/
int
-access_check(sender, acl, accesstype)
- char *sender;
- Acl *acl;
- Access accesstype;
+access_check(char *sender,
+ Acl *acl,
+ Access accesstype)
{
char buf[MAXPATHLEN]; /* holds the real acl name */
char *prefix;
@@ -109,8 +108,7 @@ access_check(sender, acl, accesstype)
}
static void
-check_acl(acl)
- Acl *acl;
+check_acl(Acl *acl)
{
acl->acl_types = 0;
check_acl_type(acl, TRANSMIT, ACL_XMT);
@@ -120,10 +118,9 @@ check_acl(acl)
}
static void
-check_acl_type(acl, accesstype, typeflag)
- Acl *acl;
- Access accesstype;
- int typeflag;
+check_acl_type(Acl *acl,
+ Access accesstype,
+ int typeflag)
{
char buf[MAXPATHLEN]; /* holds the real acl name */
char *prefix;
@@ -161,8 +158,7 @@ check_acl_type(acl, accesstype, typeflag)
* acl files for the (non-)restricted class.
*/
static void
-access_setup(first)
- int first;
+access_setup(int first)
{
char buf[MAXPATHLEN];
char class_name[512]; /* assume class names <= 511 bytes */
@@ -221,13 +217,13 @@ access_setup(first)
}
void
-access_init()
+access_init(void)
{
access_setup(1);
}
void
-access_reinit()
+access_reinit(void)
{
acl_cache_reset();
access_setup(0);
diff --git a/server/acl_files.c b/server/acl_files.c
index 4c44402..291f8e3 100644
--- a/server/acl_files.c
+++ b/server/acl_files.c
@@ -48,18 +48,13 @@ static const char rcsid_acl_files_c[] = "$Id$";
#define COR(a,b) ((a!=NULL)?(a):(b))
-extern int errno;
-
-extern time_t time();
-
/* Canonicalize a principal name */
/* If instance is missing, it becomes "" */
/* If realm is missing, it becomes the local realm */
/* Canonicalized form is put in canon, which must be big enough to hold
MAX_PRINCIPAL_SIZE characters */
-void acl_canonicalize_principal(principal, canon)
- char *principal;
- char *canon;
+void acl_canonicalize_principal(char *principal,
+ char *canon)
{
char *end;
char *dot, *atsign;
@@ -255,8 +250,8 @@ acl_initialize(acl_file, perm)
/* Eliminate all whitespace character in buf */
/* Modifies its argument */
-static void nuke_whitespace(buf)
- char *buf;
+static void
+nuke_whitespace(char *buf)
{
char *pin, *pout;
@@ -274,8 +269,8 @@ struct hashtbl {
};
/* Make an empty hash table of size s */
-static struct hashtbl *make_hash(size)
- int size;
+static struct hashtbl *
+make_hash(int size)
{
struct hashtbl *h;
@@ -289,8 +284,7 @@ static struct hashtbl *make_hash(size)
/* Destroy a hash table */
static void
-destroy_hash(h)
- struct hashtbl *h;
+destroy_hash(struct hashtbl *h)
{
int i;
@@ -303,8 +297,7 @@ destroy_hash(h)
/* Compute hash value for a string */
static unsigned int
-hashval(s)
- char *s;
+hashval(char *s)
{
unsigned hv;
@@ -315,9 +308,9 @@ hashval(s)
}
/* Add an element to a hash table */
-static void add_hash(h, el)
- struct hashtbl *h;
- char *el;
+static void
+add_hash(struct hashtbl *h,
+ char *el)
{
unsigned hv;
char *s;
@@ -352,9 +345,8 @@ static void add_hash(h, el)
/* Returns nonzero if el is in h */
static int
-check_hash(h, el)
- struct hashtbl *h;
- char *el;
+check_hash(struct hashtbl *h,
+ char *el)
{
unsigned hv;
@@ -391,8 +383,7 @@ static int acl_cache_next = 0;
/* Returns < 0 if unsuccessful in loading acl */
/* Returns index into acl_cache otherwise */
/* Note that if acl is already loaded, this is just a lookup */
-int acl_load(name)
- char *name;
+int acl_load(char *name)
{
int i;
FILE *f;
@@ -456,7 +447,7 @@ int acl_load(name)
* the next time they are requested.
*/
void
-acl_cache_reset()
+acl_cache_reset(void)
{
int i;
@@ -473,9 +464,9 @@ acl_cache_reset()
/* Returns nonzero if it can be determined that acl contains principal */
/* Principal is not canonicalized, and no wildcarding is done */
-acl_exact_match(acl, principal)
- char *acl;
- char *principal;
+int
+acl_exact_match(char *acl,
+ char *principal)
{
int idx;
@@ -489,9 +480,8 @@ acl_exact_match(acl, principal)
/* Returns nonzero if it can be determined that acl contains principal */
/* Recognizes wildcards in acl. */
int
-acl_check(acl, principal)
- char *acl;
- char *principal;
+acl_check(char *acl,
+ char *principal)
{
char buf[MAX_PRINCIPAL_SIZE];
char canon[MAX_PRINCIPAL_SIZE];
diff --git a/server/bdump.c b/server/bdump.c
index 3301156..da6d2de 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -81,27 +81,27 @@ return 0;
#endif
-static void close_bdump __P((void* arg));
-static Code_t bdump_send_loop __P((Server *server)),
-bdump_ask_for __P((char *inst)),
-bdump_recv_loop __P((Server *server));
-static void bdump_get_v12 __P((ZNotice_t *, int, struct sockaddr_in *,
- Server *));
-static Code_t get_packet __P((void *packet, int len, int *retlen));
-static Code_t extract_sin __P((ZNotice_t *notice, struct sockaddr_in *target));
-static Code_t send_done __P((void));
-static Code_t send_list __P((ZNotice_Kind_t kind, int port, char *class_name,
+static void close_bdump(void* arg);
+static Code_t bdump_send_loop(Server *server);
+static Code_t bdump_ask_for(char *inst);
+static Code_t bdump_recv_loop(Server *server);
+static void bdump_get_v12(ZNotice_t *, int, struct sockaddr_in *,
+ Server *);
+static Code_t get_packet(void *packet, int len, int *retlen);
+static Code_t extract_sin(ZNotice_t *notice, struct sockaddr_in *target);
+static Code_t send_done(void);
+static Code_t send_list(ZNotice_Kind_t kind, int port, char *class_name,
char *inst, char *opcode, char *sender,
- char *recip, char **lyst, int num));
-static Code_t send_normal_tcp __P((ZNotice_Kind_t kind, int port,
+ char *recip, char **lyst, int num);
+static Code_t send_normal_tcp(ZNotice_Kind_t kind, int port,
char *class_name,
char *inst, char *opcode, char *sender,
- char *recip, char *message, int len));
-static int net_read __P((FILE *f, char *buf, int len));
-static int net_write __P((FILE *f, char *buf, int len));
-static int setup_file_pointers __P((void));
-static void shutdown_file_pointers __P((void));
-static void cleanup __P((Server *server));
+ char *recip, char *message, int len);
+static int net_read(FILE *f, char *buf, int len);
+static int net_write(FILE *f, char *buf, int len);
+static int setup_file_pointers(void);
+static void shutdown_file_pointers(void);
+static void cleanup(Server *server);
#ifdef HAVE_KRB5
static long ticket5_time;
@@ -146,8 +146,7 @@ extern int bdump_auth_proto;
*/
void
-bdump_offer(who)
- struct sockaddr_in *who;
+bdump_offer(struct sockaddr_in *who)
{
Code_t retval;
char buf[512], *addr, *lyst[2];
@@ -248,7 +247,7 @@ bdump_offer(who)
*/
void
-bdump_send()
+bdump_send(void)
{
struct sockaddr_in from;
Server *server;
@@ -539,11 +538,10 @@ bdump_send()
/*ARGSUSED*/
static void
-bdump_get_v12 (notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+bdump_get_v12 (ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
struct sockaddr_in from;
Code_t retval;
@@ -828,13 +826,12 @@ bdump_get_v12 (notice, auth, who, server)
}
void
-bdump_get(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+bdump_get(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
- void (*proc) __P((ZNotice_t *, int, struct sockaddr_in *, Server *));
+ void (*proc)(ZNotice_t *, int, struct sockaddr_in *, Server *);
proc = NULL;
@@ -862,12 +859,15 @@ bdump_get(notice, auth, who, server)
*/
Code_t
-bdump_send_list_tcp(kind, addr, class_name, inst, opcode, sender, recip, lyst,
- num)
- ZNotice_Kind_t kind;
- struct sockaddr_in *addr;
- int num;
- char *class_name, *inst, *opcode, *sender, *recip, **lyst;
+bdump_send_list_tcp(ZNotice_Kind_t kind,
+ struct sockaddr_in *addr,
+ char *class_name,
+ char *inst,
+ char *opcode,
+ char *sender,
+ char *recip,
+ char **lyst,
+ int num)
{
ZNotice_t notice;
char *pack, addrbuf[100];
@@ -953,7 +953,8 @@ bdump_send_list_tcp(kind, addr, class_name, inst, opcode, sender, recip, lyst,
}
static void
-shutdown_file_pointers() {
+shutdown_file_pointers(void)
+{
if (input) {
fclose(input);
input = 0;
@@ -974,8 +975,7 @@ shutdown_file_pointers() {
}
static void
-cleanup(server)
- Server *server;
+cleanup(Server *server)
{
#ifdef _POSIX_VERSION
struct sigaction action;
@@ -1004,7 +1004,7 @@ cleanup(server)
#ifdef HAVE_KRB4
int
-get_tgt()
+get_tgt(void)
{
/* MIT Kerberos 4 get_svc_in_tkt() requires instance to be writable and
* at least INST_SZ bytes long. */
@@ -1106,8 +1106,7 @@ get_tgt()
/*ARGSUSED*/
static void
-close_bdump(arg)
- void * arg;
+close_bdump(void *arg)
{
if (bdump_socket >= 0) {
FD_CLR(bdump_socket, &interesting);
@@ -1130,8 +1129,7 @@ close_bdump(arg)
*/
static Code_t
-bdump_recv_loop(server)
- Server *server;
+bdump_recv_loop(Server *server)
{
ZNotice_t notice;
ZPacket_t packet;
@@ -1347,8 +1345,7 @@ bdump_recv_loop(server)
*/
static Code_t
-bdump_send_loop(server)
- Server *server;
+bdump_send_loop(Server *server)
{
Code_t retval;
@@ -1373,7 +1370,7 @@ bdump_send_loop(server)
*/
static Code_t
-send_done()
+send_done(void)
{
Code_t retval;
@@ -1391,10 +1388,15 @@ send_done()
*/
static Code_t
-send_list(kind, port, class_name, inst, opcode, sender, recip, lyst, num)
- ZNotice_Kind_t kind;
- int port, num;
- char *class_name, *inst, *opcode, *sender, *recip, **lyst;
+send_list(ZNotice_Kind_t kind,
+ int port,
+ char *class_name,
+ char *inst,
+ char *opcode,
+ char *sender,
+ char *recip,
+ char **lyst,
+ int num)
{
ZNotice_t notice;
char *pack;
@@ -1431,11 +1433,15 @@ send_list(kind, port, class_name, inst, opcode, sender, recip, lyst, num)
*/
static Code_t
-send_normal_tcp(kind, port, class_name, inst, opcode, sender, recip,
- message, len)
- ZNotice_Kind_t kind;
- int port, len;
- char *class_name, *inst, *opcode, *sender, *recip, *message;
+send_normal_tcp(ZNotice_Kind_t kind,
+ int port,
+ char *class_name,
+ char *inst,
+ char *opcode,
+ char *sender,
+ char *recip,
+ char *message,
+ int len)
{
ZNotice_t notice;
char *pack;
@@ -1522,10 +1528,7 @@ send_normal_tcp(kind, port, class_name, inst, opcode, sender, recip,
*/
static Code_t
-get_packet(packet, len, retlen)
- void *packet;
- int len;
- int *retlen;
+get_packet(void *packet, int len, int *retlen)
{
u_short length;
int result;
@@ -1558,9 +1561,7 @@ get_packet(packet, len, retlen)
}
static Code_t
-extract_sin(notice, target)
- ZNotice_t *notice;
- struct sockaddr_in *target;
+extract_sin(ZNotice_t *notice, struct sockaddr_in *target)
{
char *cp = notice->z_message;
char *buf;
@@ -1587,10 +1588,7 @@ extract_sin(notice, target)
}
static int
-net_read(f, buf, len)
- FILE *f;
- char *buf;
- int len;
+net_read(FILE *f, char *buf, int len)
{
int cc, len2 = 0;
@@ -1614,10 +1612,7 @@ net_read(f, buf, len)
}
static int
-net_write(f, buf, len)
- FILE *f;
- char *buf;
- int len;
+net_write(FILE *f, char *buf, int len)
{
int cc;
int wrlen = len;
@@ -1632,7 +1627,7 @@ net_write(f, buf, len)
}
static int
-setup_file_pointers ()
+setup_file_pointers (void)
{
int fd;
diff --git a/server/class.c b/server/class.c
index 0ce5da3..740b065 100644
--- a/server/class.c
+++ b/server/class.c
@@ -101,8 +101,9 @@ static void free_triplet __P((Triplet *));
* shouldn't affect performance.
*/
-int ZDest_eq(d1, d2)
- Destination *d1, *d2;
+int
+ZDest_eq(Destination *d1,
+ Destination *d2)
{
return((d1->classname == d2->classname) &&
(d1->inst == d2->inst) &&
@@ -114,10 +115,9 @@ int ZDest_eq(d1, d2)
/* the client as interested in a triplet */
Code_t
-triplet_register(client, dest, realm)
- Client *client;
- Destination *dest;
- ZRealm *realm;
+triplet_register(Client *client,
+ Destination *dest,
+ ZRealm *realm)
{
Triplet *triplet;
unsigned long hashval;
@@ -137,10 +137,9 @@ triplet_register(client, dest, realm)
/* dissociate client from the class, garbage collecting if appropriate */
Code_t
-triplet_deregister(client, dest, realm)
- Client *client;
- Destination *dest;
- ZRealm *realm;
+triplet_deregister(Client *client,
+ Destination *dest,
+ ZRealm *realm)
{
Triplet *triplet;
int retval;
@@ -170,8 +169,7 @@ triplet_deregister(client, dest, realm)
/* return a linked list of what clients are interested in this triplet */
Client **
-triplet_lookup(dest)
- Destination *dest;
+triplet_lookup(Destination *dest)
{
Triplet *triplet;
unsigned long hashval;
@@ -190,8 +188,7 @@ triplet_lookup(dest)
*/
Acl *
-class_get_acl(class_name)
- String *class_name;
+class_get_acl(String *class_name)
{
Triplet *triplet;
unsigned long hashval;
@@ -214,9 +211,8 @@ class_get_acl(class_name)
*/
Code_t
-class_restrict(class_name, acl)
- char *class_name;
- Acl *acl;
+class_restrict(char *class_name,
+ Acl *acl)
{
Triplet *triplet;
String *d;
@@ -246,9 +242,8 @@ class_restrict(class_name, acl)
*/
Code_t
-class_setup_restricted(class_name, acl)
- char *class_name;
- Acl *acl;
+class_setup_restricted(char *class_name,
+ Acl *acl)
{
Triplet *triplet;
String *d;
@@ -279,8 +274,9 @@ class_setup_restricted(class_name, acl)
/* allocate space for a class structure */
static Triplet *
-triplet_alloc(classname,inst,recipient)
- String *classname, *inst, *recipient;
+triplet_alloc(String *classname,
+ String *inst,
+ String *recipient)
{
Triplet *triplet;
Client *clist;
@@ -301,10 +297,9 @@ triplet_alloc(classname,inst,recipient)
/* insert a client into the list associated with the class *ptr */
static Code_t
-insert_client(triplet, client, realm)
- Triplet *triplet;
- Client *client;
- ZRealm *realm;
+insert_client(Triplet *triplet,
+ Client *client,
+ ZRealm *realm)
{
Client **clientp, **newclients;
int new_size;
@@ -345,10 +340,10 @@ insert_client(triplet, client, realm)
* collecting if appropriate
*/
-static Code_t remove_client(triplet, client, realm)
- Triplet *triplet;
- Client *client;
- ZRealm *realm;
+static Code_t
+remove_client(Triplet *triplet,
+ Client *client,
+ ZRealm *realm)
{
Client **clientp;
@@ -363,8 +358,8 @@ static Code_t remove_client(triplet, client, realm)
return ZSRV_BADASSOC;
}
-static void free_triplet(triplet)
- Triplet *triplet;
+static void
+free_triplet(Triplet *triplet)
{
if (triplet->clients)
free(triplet->clients);
@@ -374,8 +369,8 @@ static void free_triplet(triplet)
free(triplet);
}
-void triplet_dump_subs(fp)
- FILE *fp;
+void
+triplet_dump_subs(FILE *fp)
{
int i;
Triplet *triplet;
diff --git a/server/client.c b/server/client.c
index 9098ac0..e56c9b9 100644
--- a/server/client.c
+++ b/server/client.c
@@ -59,11 +59,10 @@ static Client *client_bucket[HASHSIZE];
htons((unsigned short) (port))) % HASHSIZE)
Code_t
-client_register(notice, host, client_p, wantdefaults)
- ZNotice_t *notice;
- struct in_addr *host;
- Client **client_p;
- int wantdefaults;
+client_register(ZNotice_t *notice,
+ struct in_addr *host,
+ Client **client_p,
+ int wantdefaults)
{
Client *client;
Code_t retval;
@@ -118,9 +117,8 @@ client_register(notice, host, client_p, wantdefaults)
*/
void
-client_deregister(client, flush)
- Client *client;
- int flush;
+client_deregister(Client *client,
+ int flush)
{
LIST_DELETE(client);
nack_release(client);
@@ -136,8 +134,7 @@ client_deregister(client, flush)
}
void
-client_flush_host(host)
- struct in_addr *host;
+client_flush_host(struct in_addr *host)
{
int i;
Client *client, *next;
@@ -153,7 +150,7 @@ client_flush_host(host)
}
Code_t
-client_send_clients()
+client_send_clients(void)
{
int i;
Client *client;
@@ -186,8 +183,7 @@ client_send_clients()
*/
void
-client_dump_clients(fp)
- FILE *fp;
+client_dump_clients(FILE *fp)
{
Client *client;
int i;
@@ -206,9 +202,8 @@ client_dump_clients(fp)
*/
Client *
-client_find(host, port)
- struct in_addr *host;
- unsigned int port;
+client_find(struct in_addr *host,
+ unsigned int port)
{
Client *client;
long hashval;
diff --git a/server/common.c b/server/common.c
index b668ef8..fd44f38 100644
--- a/server/common.c
+++ b/server/common.c
@@ -25,25 +25,22 @@ static const char rcsid_common_c[] =
/* copy a string into a newly allocated area */
char *
-strsave (sp)
- const char *sp;
+strsave (const char *sp)
{
char *ret;
- ret = (char *) malloc(strlen(sp) + 1);
+ ret = strdup(sp);
if (!ret) {
syslog(LOG_CRIT, "no mem strdup'ing");
abort();
}
- strcpy(ret, sp);
return ret;
}
/* The "& 0x5f" provides case-insensitivity for ASCII. */
unsigned long
-hash(string)
- const char *string;
+hash(const char *string)
{
unsigned long hval = 0;
char cp;
@@ -82,9 +79,7 @@ hash(string)
}
/* Output a name, replacing newlines with \n and single quotes with \q. */
-void dump_quote(p, fp)
- char *p;
- FILE *fp;
+void dump_quote(char *p, FILE *fp)
{
for (; *p; p++) {
if (*p == '\'') {
diff --git a/server/dispatch.c b/server/dispatch.c
index 09fa0c1..8cadcec 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -32,7 +32,7 @@ static const char rcsid_dispatch_c[] =
#define HOSTS_SIZE_INIT 256
#ifdef DEBUG
-ZCONST char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
+const char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
"HMCTL", "SERVACK", "SERVNAK", "CLIENTACK",
"STAT"};
#endif
@@ -95,8 +95,7 @@ static struct in_addr *hosts;
static int hosts_size = 0, num_hosts = 0;
static void
-dump_stats (arg)
- void *arg;
+dump_stats (void *arg)
{
syslog(LOG_INFO, "stats: %s: %d", hm_packets.str, hm_packets.val);
syslog(LOG_INFO, "stats: %s: %d", control_notices.str,
@@ -124,7 +123,7 @@ dump_stats (arg)
*/
void
-handle_packet()
+handle_packet(void)
{
Code_t status;
ZPacket_t input_packet; /* from the network */
@@ -244,11 +243,10 @@ handle_packet()
*/
static void
-dispatch(notice, auth, who, from_server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int from_server;
+dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ int from_server)
{
Code_t status;
String *notice_class;
@@ -341,11 +339,10 @@ dispatch(notice, auth, who, from_server)
*/
void
-sendit(notice, auth, who, external)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int external;
+sendit(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ int external)
{
static int send_counter = 0;
char recipbuf[ANAME_SZ + INST_SZ + REALM_SZ + 3], *recipp;
@@ -474,12 +471,11 @@ sendit(notice, auth, who, external)
*/
static int
-send_to_dest(notice, auth, dest, send_counter, external)
- ZNotice_t *notice;
- int auth;
- Destination *dest;
- int send_counter;
- int external;
+send_to_dest(ZNotice_t *notice,
+ int auth,
+ Destination *dest,
+ int send_counter,
+ int external)
{
Client **clientp;
int any = 0;
@@ -512,8 +508,7 @@ send_to_dest(notice, auth, dest, send_counter, external)
*/
void
-nack_release(client)
- Client *client;
+nack_release(Client *client)
{
int i;
Unacked *nacked, *next;
@@ -539,11 +534,10 @@ nack_release(client)
/* the arguments must be the same as the arguments to Z_XmitFragment */
/*ARGSUSED*/
Code_t
-xmit_frag(notice, buf, len, waitforack)
- ZNotice_t *notice;
- char *buf;
- int len;
- int waitforack;
+xmit_frag(ZNotice_t *notice,
+ char *buf,
+ int len,
+ int waitforack)
{
struct sockaddr_in sin;
char *savebuf;
@@ -596,11 +590,10 @@ xmit_frag(notice, buf, len, waitforack)
*/
void
-xmit(notice, dest, auth, client)
- ZNotice_t *notice;
- struct sockaddr_in *dest;
- int auth;
- Client *client;
+xmit(ZNotice_t *notice,
+ struct sockaddr_in *dest,
+ int auth,
+ Client *client)
{
char *noticepack;
Unacked *nacked;
@@ -714,7 +707,7 @@ xmit(notice, dest, auth, client)
(void) sprintf(multi, "%d/%d", offset+origoffset, origlen);
partnotice.z_multinotice = multi;
if (offset > 0) {
- (void) gettimeofday(&partnotice.z_uid.tv, (struct timezone *)0);
+ (void) Z_gettimeofday(&partnotice.z_uid.tv, (struct timezone *)0);
partnotice.z_uid.tv.tv_sec = htonl((u_long)
partnotice.z_uid.tv.tv_sec);
partnotice.z_uid.tv.tv_usec = htonl((u_long)
@@ -807,8 +800,7 @@ xmit(notice, dest, auth, client)
*/
void
-rexmit(arg)
- void *arg;
+rexmit(void *arg)
{
Unacked *nacked = (Unacked *) arg;
int retval;
@@ -874,10 +866,9 @@ rexmit(arg)
*/
void
-clt_ack(notice, who, sent)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- Sent_type sent;
+clt_ack(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ Sent_type sent)
{
ZNotice_t acknotice;
ZPacket_t ackpack;
@@ -970,9 +961,8 @@ clt_ack(notice, who, sent)
*/
static void
-nack_cancel(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+nack_cancel(ZNotice_t *notice,
+ struct sockaddr_in *who)
{
Unacked *nacked;
int hashval;
@@ -1013,11 +1003,10 @@ nack_cancel(notice, who)
/* Dispatch an HM_CTL notice. */
Code_t
-hostm_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+hostm_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
Server *owner;
char *opcode = notice->z_opcode;
@@ -1099,11 +1088,10 @@ hostm_dispatch(notice, auth, who, server)
*/
Code_t
-control_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+control_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
char *opcode = notice->z_opcode;
Client *client;
@@ -1273,7 +1261,7 @@ control_dispatch(notice, auth, who, server)
}
void
-hostm_shutdown()
+hostm_shutdown(void)
{
int i, s, newserver;
struct sockaddr_in sin;
@@ -1300,7 +1288,7 @@ hostm_shutdown()
}
void
-realm_shutdown()
+realm_shutdown(void)
{
int i, s, newserver;
struct sockaddr_in sin;
@@ -1325,9 +1313,8 @@ realm_shutdown()
}
static void
-hostm_deathgram(sin, server)
- struct sockaddr_in *sin;
- Server *server;
+hostm_deathgram(struct sockaddr_in *sin,
+ Server *server)
{
Code_t retval;
int shutlen;
@@ -1366,7 +1353,7 @@ hostm_deathgram(sin, server)
}
static char *
-hm_recipient()
+hm_recipient(void)
{
static char *recipient;
char *realm;
diff --git a/server/kstuff.c b/server/kstuff.c
index dd93288..e81e905 100644
--- a/server/kstuff.c
+++ b/server/kstuff.c
@@ -33,12 +33,11 @@ static ZChecksum_t compute_rlm_checksum __P((ZNotice_t *, C_Block));
* the value of rd_ap_req() applied to the ticket.
*/
int
-GetKerberosData(fd, haddr, kdata, service, srvtab)
- int fd; /* file descr. to read from */
- struct in_addr haddr; /* address of foreign host on fd */
- AUTH_DAT *kdata; /* kerberos data (returned) */
- char *service; /* service principal desired */
- char *srvtab; /* file to get keys from */
+GetKerberosData(int fd, /* file descr. to read from */
+ struct in_addr haddr, /* address of foreign host on fd */
+ AUTH_DAT *kdata, /* kerberos data (returned) */
+ char *service, /* service principal desired */
+ char *srvtab) /* file to get keys from */
{
char p[20];
KTEXT_ST ticket; /* will get Kerberos ticket from client */
@@ -94,11 +93,11 @@ GetKerberosData(fd, haddr, kdata, service, srvtab)
#endif
Code_t
-SendKerberosData(fd, ticket, service, host)
- int fd; /* file descriptor to write onto */
- KTEXT ticket; /* where to put ticket (return) */
- char *service; /* service name, foreign host */
- char *host;
+SendKerberosData(int fd, /* file descriptor to write onto */
+ KTEXT ticket, /* where to put ticket (return) */
+ char *service, /* service name, foreign host */
+ char *host)
+
{
int rem;
char p[32];
@@ -240,10 +239,9 @@ SendKrb5Data(int fd, krb5_data *data) {
#endif
Code_t
-ZCheckRealmAuthentication(notice, from, realm)
- ZNotice_t *notice;
- struct sockaddr_in *from;
- char *realm;
+ZCheckRealmAuthentication(ZNotice_t *notice,
+ struct sockaddr_in *from,
+ char *realm)
{
#ifdef HAVE_KRB5
char *authbuf;
@@ -524,9 +522,8 @@ ZCheckRealmAuthentication(notice, from, realm)
}
Code_t
-ZCheckAuthentication(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
+ZCheckAuthentication(ZNotice_t *notice,
+ struct sockaddr_in *from)
{
#ifdef HAVE_KRB5
char *authbuf;
@@ -811,9 +808,8 @@ ZCheckAuthentication(notice, from)
#undef KRB5AUTHENT
Code_t
-ZCheckAuthentication4(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
+ZCheckAuthentication4(ZNotice_t *notice,
+ struct sockaddr_in *from)
{
#ifdef HAVE_KRB4
int result;
@@ -873,9 +869,9 @@ ZCheckAuthentication4(notice, from)
#ifdef HAVE_KRB4
-static ZChecksum_t compute_checksum(notice, session_key)
- ZNotice_t *notice;
- C_Block session_key;
+static ZChecksum_t
+compute_checksum(ZNotice_t *notice,
+ C_Block session_key)
{
#ifdef NOENCRYPTION
return 0;
@@ -893,9 +889,8 @@ static ZChecksum_t compute_checksum(notice, session_key)
#endif
}
-static ZChecksum_t compute_rlm_checksum(notice, session_key)
- ZNotice_t *notice;
- C_Block session_key;
+static ZChecksum_t compute_rlm_checksum(ZNotice_t *notice,
+ C_Block session_key)
{
#ifdef NOENCRYPTION
return 0;
diff --git a/server/main.c b/server/main.c
index fe98edc..58dfccb 100644
--- a/server/main.c
+++ b/server/main.c
@@ -52,23 +52,23 @@ static const char rcsid_main_c[] =
#define EVER (;;) /* don't stop looping */
-static int do_net_setup __P((void));
-static int initialize __P((void));
-static void usage __P((void));
-static void do_reset __P((void));
-static RETSIGTYPE bye __P((int));
-static RETSIGTYPE dbug_on __P((int));
-static RETSIGTYPE dbug_off __P((int));
-static RETSIGTYPE sig_dump_db __P((int));
-static RETSIGTYPE sig_dump_strings __P((int));
-static RETSIGTYPE reset __P((int));
-static RETSIGTYPE reap __P((int));
-static void read_from_dump __P((char *dumpfile));
-static void dump_db __P((void));
-static void dump_strings __P((void));
+static int do_net_setup(void);
+static int initialize(void);
+static void usage(void);
+static void do_reset(void);
+static RETSIGTYPE bye(int);
+static RETSIGTYPE dbug_on(int);
+static RETSIGTYPE dbug_off(int);
+static RETSIGTYPE sig_dump_db(int);
+static RETSIGTYPE sig_dump_strings(int);
+static RETSIGTYPE reset(int);
+static RETSIGTYPE reap(int);
+static void read_from_dump(char *dumpfile);
+static void dump_db(void);
+static void dump_strings(void);
#ifndef DEBUG
-static void detach __P((void));
+static void detach(void);
#endif
static short doreset = 0; /* if it becomes 1, perform
@@ -144,9 +144,8 @@ C_Block __Zephyr_session;
#endif
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc,
+ char **argv)
{
int nfound; /* #fildes ready on select */
fd_set readable;
@@ -394,7 +393,7 @@ main(argc, argv)
*/
static int
-initialize()
+initialize(void)
{
int zero = 0;
if (do_net_setup())
@@ -452,7 +451,7 @@ initialize()
*/
static int
-do_net_setup()
+do_net_setup(void)
{
struct servent *sp;
struct hostent *hp;
@@ -522,7 +521,7 @@ do_net_setup()
*/
static void
-usage()
+usage(void)
{
#ifdef DEBUG
fprintf(stderr, "Usage: %s [-d] [-s] [-n] [-k realm] [-f dumpfile]\n",
@@ -535,7 +534,7 @@ usage()
}
int
-packets_waiting()
+packets_waiting(void)
{
fd_set readable, initial;
struct timeval tv;
@@ -550,8 +549,7 @@ packets_waiting()
}
static RETSIGTYPE
-bye(sig)
- int sig;
+bye(int sig)
{
server_shutdown(); /* tell other servers */
#ifdef REALM_MGMT
@@ -567,8 +565,7 @@ bye(sig)
}
static RETSIGTYPE
-dbug_on(sig)
- int sig;
+dbug_on(int sig)
{
syslog(LOG_DEBUG, "debugging turned on");
#ifdef DEBUG_MALLOC
@@ -578,8 +575,7 @@ dbug_on(sig)
}
static RETSIGTYPE
-dbug_off(sig)
- int sig;
+dbug_off(int sig)
{
syslog(LOG_DEBUG, "debugging turned off");
#ifdef DEBUG_MALLOC
@@ -591,13 +587,12 @@ dbug_off(sig)
int fork_for_dump = 0;
static RETSIGTYPE
-sig_dump_strings(sig)
- int sig;
+sig_dump_strings(int sig)
{
dump_strings_flag = 1;
}
-static void dump_strings()
+static void dump_strings(void)
{
char filename[128];
@@ -624,13 +619,13 @@ static void dump_strings()
}
static RETSIGTYPE
-sig_dump_db(sig)
- int sig;
+sig_dump_db(int sig)
{
dump_db_flag = 1;
}
-static void dump_db()
+static void
+dump_db(void)
{
/* dump the in-core database to human-readable form on disk */
FILE *fp;
@@ -667,8 +662,7 @@ static void dump_db()
}
static RETSIGTYPE
-reset(sig)
- int sig;
+reset(int sig)
{
#if 1
zdbug((LOG_DEBUG,"reset()"));
@@ -677,8 +671,7 @@ reset(sig)
}
static RETSIGTYPE
-reap(sig)
- int sig;
+reap(int sig)
{
int pid, i = 0;
int oerrno = errno;
@@ -720,7 +713,7 @@ reap(sig)
}
static void
-do_reset()
+do_reset(void)
{
int oerrno = errno;
#ifdef _POSIX_VERSION
@@ -759,7 +752,7 @@ do_reset()
*/
static void
-detach()
+detach(void)
{
/* detach from terminal and fork. */
int i;
@@ -793,8 +786,7 @@ detach()
#endif /* not DEBUG */
static void
-read_from_dump(dumpfile)
- char *dumpfile;
+read_from_dump(char *dumpfile)
{
/* Not yet implemented. */
return;
diff --git a/server/realm.c b/server/realm.c
index 9a3f2ef..0dea795 100644
--- a/server/realm.c
+++ b/server/realm.c
@@ -60,24 +60,22 @@ int nrealms = 0; /* number of other realms */
* do a database dump of foreign realm info
*
*/
-static void realm_sendit __P((ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender));
-static Code_t realm_sendit_auth __P((ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender));
-static void rlm_ack __P((ZNotice_t *notice, Unacked *nacked));
-static void rlm_nack_cancel __P((ZNotice_t *notice, struct sockaddr_in *who));
-static void rlm_new_ticket __P(());
-static void rlm_rexmit __P((void *arg));
-static Code_t realm_ulocate_dispatch __P((ZNotice_t *notice,int auth,struct sockaddr_in *who,Server *server,ZRealm *realm));
-static Code_t realm_new_server __P((struct sockaddr_in *, ZNotice_t *, ZRealm *));
-static Code_t realm_set_server __P((struct sockaddr_in *, ZRealm *));
+static void realm_sendit(ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender);
+static Code_t realm_sendit_auth(ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender);
+static void rlm_ack(ZNotice_t *notice, Unacked *nacked);
+static void rlm_nack_cancel(ZNotice_t *notice, struct sockaddr_in *who);
+static void rlm_rexmit(void *arg);
+static Code_t realm_ulocate_dispatch(ZNotice_t *notice,int auth,struct sockaddr_in *who,Server *server,ZRealm *realm);
+static Code_t realm_new_server(struct sockaddr_in *, ZNotice_t *, ZRealm *);
+static Code_t realm_set_server(struct sockaddr_in *, ZRealm *);
#ifdef HAVE_KRB4
-static Code_t ticket_retrieve __P((ZRealm *realm));
-static int ticket_lookup __P((char *realm));
+static Code_t ticket_retrieve(ZRealm *realm);
+static int ticket_lookup(char *realm);
#endif
static int
-realm_get_idx_by_addr(realm, who)
- ZRealm *realm;
- struct sockaddr_in *who;
+realm_get_idx_by_addr(ZRealm *realm,
+ struct sockaddr_in *who)
{
struct sockaddr_in *addr;
int a, b;
@@ -91,8 +89,7 @@ realm_get_idx_by_addr(realm, who)
}
char *
-realm_expand_realm(realmname)
-char *realmname;
+realm_expand_realm(char *realmname)
{
ZRealm *realm;
int a;
@@ -120,8 +117,7 @@ char *realmname;
}
ZRealm *
-realm_get_realm_by_pid(pid)
- int pid;
+realm_get_realm_by_pid(int pid)
{
ZRealm *realm;
int a;
@@ -134,7 +130,7 @@ realm_get_realm_by_pid(pid)
}
void
-kill_realm_pids()
+kill_realm_pids(void)
{
ZRealm *realm;
int a;
@@ -147,8 +143,7 @@ kill_realm_pids()
}
ZRealmname *
-get_realm_lists(file)
- char *file;
+get_realm_lists(char *file)
{
ZRealmname *rlm_list, *rlm;
int ii, nused, ntotal;
@@ -233,7 +228,7 @@ get_realm_lists(file)
}
Code_t
-realm_send_realms()
+realm_send_realms(void)
{
int cnt, retval;
for (cnt = 0; cnt < nrealms; cnt++) {
@@ -244,9 +239,7 @@ realm_send_realms()
}
int
-realm_bound_for_realm(realm, recip)
- char *realm;
- char *recip;
+realm_bound_for_realm(char *realm, char *recip)
{
char *rlm = NULL;
int remote = strcmp(ZGetRealm(), realm);
@@ -264,9 +257,7 @@ realm_bound_for_realm(realm, recip)
}
int
-realm_sender_in_realm(realm, sender)
- char *realm;
- char *sender;
+realm_sender_in_realm(char *realm, char *sender)
{
char *rlm = NULL;
int remote = strcmp(ZGetRealm(), realm);
@@ -283,8 +274,7 @@ realm_sender_in_realm(realm, sender)
return 0;
}
-int sender_in_realm(notice)
- ZNotice_t *notice;
+int sender_in_realm(ZNotice_t *notice)
{
char *realm;
@@ -297,8 +287,7 @@ int sender_in_realm(notice)
}
ZRealm *
-realm_which_realm(who)
- struct sockaddr_in *who;
+realm_which_realm(struct sockaddr_in *who)
{
ZRealm *realm;
struct sockaddr_in *addr;
@@ -318,8 +307,7 @@ realm_which_realm(who)
}
ZRealm *
-realm_get_realm_by_name(name)
- char *name;
+realm_get_realm_by_name(char *name)
{
int a;
ZRealm *realm;
@@ -338,9 +326,8 @@ realm_get_realm_by_name(name)
}
static void
-rlm_nack_cancel(notice, who)
- register ZNotice_t *notice;
- struct sockaddr_in *who;
+rlm_nack_cancel(register ZNotice_t *notice,
+ struct sockaddr_in *who)
{
register ZRealm *which = realm_which_realm(who);
register Unacked *nacked, *next;
@@ -383,9 +370,8 @@ rlm_nack_cancel(notice, who)
}
static void
-rlm_ack(notice, nacked)
- ZNotice_t *notice;
- Unacked *nacked;
+rlm_ack(ZNotice_t *notice,
+ Unacked *nacked)
{
ZNotice_t acknotice;
ZPacket_t ackpack;
@@ -419,11 +405,10 @@ rlm_ack(notice, nacked)
}
Code_t
-realm_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+realm_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
ZRealm *realm;
struct sockaddr_in newwho;
@@ -488,7 +473,7 @@ realm_dispatch(notice, auth, who, server)
}
void
-realm_init()
+realm_init(void)
{
Client *client;
ZRealmname *rlmnames;
@@ -591,8 +576,7 @@ realm_init()
}
void
-realm_deathgram(server)
- Server *server;
+realm_deathgram(Server *server)
{
ZRealm *realm;
char rlm_recipient[REALM_SZ + 1];
@@ -653,7 +637,7 @@ realm_deathgram(server)
}
void
-realm_wakeup()
+realm_wakeup(void)
{
int jj, found = 0;
ZRealm *realm;
@@ -721,12 +705,11 @@ realm_wakeup()
}
static Code_t
-realm_ulocate_dispatch(notice, auth, who, server, realm)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
- ZRealm *realm;
+realm_ulocate_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server,
+ ZRealm *realm)
{
register char *opcode = notice->z_opcode;
Code_t status;
@@ -761,12 +744,11 @@ realm_ulocate_dispatch(notice, auth, who, server, realm)
Code_t
-realm_control_dispatch(notice, auth, who, server, realm)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
- ZRealm *realm;
+realm_control_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server,
+ ZRealm *realm)
{
register char *opcode = notice->z_opcode;
Code_t status;
@@ -843,10 +825,9 @@ realm_control_dispatch(notice, auth, who, server, realm)
}
static Code_t
-realm_new_server(sin, notice, realm)
- struct sockaddr_in *sin;
- ZNotice_t *notice;
- ZRealm *realm;
+realm_new_server(struct sockaddr_in *sin,
+ ZNotice_t *notice,
+ ZRealm *realm)
{
struct hostent *hp;
char suggested_server[MAXHOSTNAMELEN];
@@ -880,9 +861,8 @@ realm_new_server(sin, notice, realm)
}
static Code_t
-realm_set_server(sin, realm)
- struct sockaddr_in *sin;
- ZRealm *realm;
+realm_set_server(struct sockaddr_in *sin,
+ ZRealm *realm)
{
ZRealm *rlm;
@@ -895,12 +875,11 @@ realm_set_server(sin, realm)
}
void
-realm_handoff(notice, auth, who, realm, ack_to_sender)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZRealm *realm;
- int ack_to_sender;
+realm_handoff(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ ZRealm *realm,
+ int ack_to_sender)
{
#ifdef HAVE_KRB5
Code_t retval;
@@ -929,12 +908,11 @@ realm_handoff(notice, auth, who, realm, ack_to_sender)
}
static void
-realm_sendit(notice, who, auth, realm, ack_to_sender)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int auth;
- ZRealm *realm;
- int ack_to_sender;
+realm_sendit(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int auth,
+ ZRealm *realm,
+ int ack_to_sender)
{
caddr_t pack;
int packlen;
@@ -992,8 +970,7 @@ realm_sendit(notice, who, auth, realm, ack_to_sender)
}
static void
-packet_ctl_nack(nackpacket)
- Unacked *nackpacket;
+packet_ctl_nack(Unacked *nackpacket)
{
ZNotice_t notice;
@@ -1009,8 +986,7 @@ packet_ctl_nack(nackpacket)
}
static void
-rlm_rexmit(arg)
- void *arg;
+rlm_rexmit(void *arg)
{
Unacked *nackpacket = (Unacked *) arg;
Code_t retval;
@@ -1088,8 +1064,7 @@ rlm_rexmit(arg)
}
void
-realm_dump_realms(fp)
- FILE *fp;
+realm_dump_realms(FILE *fp)
{
register int ii, jj;
@@ -1106,12 +1081,11 @@ realm_dump_realms(fp)
#ifdef HAVE_KRB5
static Code_t
-realm_sendit_auth(notice, who, auth, realm, ack_to_sender)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZRealm *realm;
- int ack_to_sender;
+realm_sendit_auth(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int auth,
+ ZRealm *realm,
+ int ack_to_sender)
{
char *buffer, *ptr;
caddr_t pack;
@@ -1318,8 +1292,7 @@ realm_sendit_auth(notice, who, auth, realm, ack_to_sender)
}
static int
-ticket_lookup(realm)
-char *realm;
+ticket_lookup(char *realm)
{
krb5_error_code result;
krb5_timestamp sec;
@@ -1364,8 +1337,7 @@ char *realm;
}
static Code_t
-ticket_retrieve(realm)
- ZRealm *realm;
+ticket_retrieve(ZRealm *realm)
{
int pid;
krb5_ccache ccache;
diff --git a/server/server.c b/server/server.c
index 4457e87..2132a8e 100644
--- a/server/server.c
+++ b/server/server.c
@@ -133,7 +133,7 @@ int zalone;
*/
void
-server_init()
+server_init(void)
{
int i;
struct in_addr *serv_addr, *server_addrs, limbo_addr;
@@ -229,7 +229,7 @@ server_init()
* handle on a particular server other than by indexing on otherservers[].
*/
void
-server_reset()
+server_reset(void)
{
int num_servers;
struct in_addr *server_addrs;
@@ -437,8 +437,7 @@ rlm_states[] = {
*/
void
-server_timo(arg)
- void *arg;
+server_timo(void *arg)
{
Server *which = (Server *) arg;
int auth = 0;
@@ -492,10 +491,9 @@ server_timo(arg)
/*ARGSUSED*/
Code_t
-server_dispatch(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+server_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who)
{
Server *server;
struct sockaddr_in newwho;
@@ -625,8 +623,7 @@ server_register(notice, auth, who)
*/
void
-server_kill_clt(client)
- Client *client;
+server_kill_clt(Client *client)
{
int i;
char buf[512], *lyst[2];
@@ -684,9 +681,8 @@ server_kill_clt(client)
*/
static Code_t
-kill_clt(notice, server)
- ZNotice_t *notice;
- Server *server;
+kill_clt(ZNotice_t *notice,
+ Server *server)
{
struct sockaddr_in who;
Client *client;
@@ -720,9 +716,8 @@ kill_clt(notice, server)
*/
static Code_t
-extract_addr(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+extract_addr(ZNotice_t *notice,
+ struct sockaddr_in *who)
{
char *cp = notice->z_message;
@@ -751,8 +746,7 @@ extract_addr(notice, who)
*/
static void
-server_flush(which)
- Server *which;
+server_flush(Server *which)
{
#if 0
if (zdebug)
@@ -767,9 +761,8 @@ server_flush(which)
*/
static void
-server_hello(which, auth)
- Server *which;
- int auth;
+server_hello(Server *which,
+ int auth)
{
send_msg(&which->addr, ADMIN_HELLO, auth);
which->num_hello_sent++;
@@ -781,11 +774,10 @@ server_hello(which, auth)
/*ARGSUSED*/
static Code_t
-admin_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+admin_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
char *opcode = notice->z_opcode;
Code_t status = ZERR_NONE;
@@ -839,11 +831,10 @@ admin_dispatch(notice, auth, who, server)
/*ARGSUSED*/
Code_t
-server_adispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+server_adispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
/* this had better be a HELLO message--start of acquisition
@@ -873,8 +864,7 @@ server_adispatch(notice, auth, who, server)
}
static void
-send_stats(who)
- struct sockaddr_in *who;
+send_stats(struct sockaddr_in *who)
{
int i;
char buf[BUFSIZ];
@@ -976,8 +966,7 @@ send_stats(who)
*/
static struct in_addr *
-get_server_addrs(number)
- int *number; /* RETURN */
+get_server_addrs(int *number)
{
int i;
char **server_hosts = NULL;
@@ -1030,8 +1019,7 @@ static int nhosts = 0;
*/
static char **
-get_server_list(file)
- char *file;
+get_server_list(char *file)
{
FILE *fp;
char buf[MAXHOSTNAMELEN];
@@ -1074,7 +1062,7 @@ get_server_list(file)
}
static char **
-get_single_server()
+get_single_server(void)
{
char buf[MAXHOSTNAMELEN];
char **ret_list;
@@ -1096,8 +1084,7 @@ get_single_server()
* free storage allocated by get_server_list
*/
static void
-free_server_list(list)
- char **list;
+free_server_list(char **list)
{
char **orig_list = list;
@@ -1115,9 +1102,8 @@ free_server_list(list)
*/
static void
-setup_server(server, addr)
- Server *server;
- struct in_addr *addr;
+setup_server(Server *server,
+ struct in_addr *addr)
{
server->state = SERV_DEAD;
server->timeout = timo_dead;
@@ -1137,10 +1123,9 @@ setup_server(server, addr)
*/
static void
-hello_respond(who, adj, auth)
- struct sockaddr_in *who;
- int adj;
- int auth;
+hello_respond(struct sockaddr_in *who,
+ int adj,
+ int auth)
{
Server *which;
@@ -1178,8 +1163,7 @@ hello_respond(who, adj, auth)
*/
Server *
-server_which_server(who)
- struct sockaddr_in *who;
+server_which_server(struct sockaddr_in *who)
{
Server *server;
int i;
@@ -1200,8 +1184,7 @@ server_which_server(who)
* appropriately.
*/
static void
-srv_responded(who)
- struct sockaddr_in *who;
+srv_responded(struct sockaddr_in *who)
{
Server *which = server_which_server(who);
@@ -1252,7 +1235,7 @@ srv_responded(who)
*/
void
-server_shutdown()
+server_shutdown(void)
{
int i;
@@ -1267,10 +1250,9 @@ server_shutdown()
*/
static void
-send_msg(who, opcode, auth)
- struct sockaddr_in *who;
- char *opcode;
- int auth;
+send_msg(struct sockaddr_in *who,
+ char *opcode,
+ int auth)
{
ZNotice_t notice;
ZNotice_t *pnotice; /* speed hack */
@@ -1325,12 +1307,11 @@ send_msg(who, opcode, auth)
*/
static void
-send_msg_list(who, opcode, lyst, num, auth)
- struct sockaddr_in *who;
- char *opcode;
- char **lyst;
- int num;
- int auth;
+send_msg_list(struct sockaddr_in *who,
+ char *opcode,
+ char **lyst,
+ int num,
+ int auth)
{
ZNotice_t notice;
char *pack;
@@ -1376,10 +1357,9 @@ send_msg_list(who, opcode, lyst, num, auth)
*/
/*ARGSUSED*/
void
-server_forward(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+server_forward(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who)
{
int i;
caddr_t pack;
@@ -1419,11 +1399,10 @@ server_forward(notice, auth, who)
}
static void
-server_forw_reliable(server, pack, packlen, notice)
- Server *server;
- caddr_t pack;
- int packlen;
- ZNotice_t *notice;
+server_forw_reliable(Server *server,
+ caddr_t pack,
+ int packlen,
+ ZNotice_t *notice)
{
Code_t retval;
Unacked *nacked;
@@ -1467,8 +1446,7 @@ server_forw_reliable(server, pack, packlen, notice)
*/
void
-server_send_queue(server)
- Server *server;
+server_send_queue(Server *server)
{
Pending *pending;
ZNotice_t notice;
@@ -1495,9 +1473,8 @@ server_send_queue(server)
*/
static void
-srv_nack_cancel(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+srv_nack_cancel(ZNotice_t *notice,
+ struct sockaddr_in *who)
{
Server *server = server_which_server(who);
Unacked *nacked;
@@ -1528,8 +1505,7 @@ srv_nack_cancel(notice, who)
*/
static void
-srv_rexmit(arg)
- void *arg;
+srv_rexmit(void *arg)
{
Unacked *packet = (Unacked *) arg;
Code_t retval;
@@ -1573,8 +1549,7 @@ srv_rexmit(arg)
*/
static void
-srv_nack_release(server)
- Server *server;
+srv_nack_release(Server *server)
{
int i;
Unacked *nacked, *next;
@@ -1598,8 +1573,7 @@ srv_nack_release(server)
*/
static void
-srv_nack_renumber (new_idx)
- int *new_idx;
+srv_nack_renumber (int *new_idx)
{
/* XXX release any private queue for this server */
Unacked *nacked;
@@ -1624,12 +1598,11 @@ srv_nack_renumber (new_idx)
* Queue this notice to be transmitted to the server when it is ready.
*/
static void
-server_queue(server, len, pack, auth, who)
- Server *server;
- int len;
- void *pack;
- int auth;
- struct sockaddr_in *who;
+server_queue(Server *server,
+ int len,
+ void *pack,
+ int auth,
+ struct sockaddr_in *who)
{
Pending *pending;
@@ -1656,8 +1629,7 @@ server_queue(server, len, pack, auth, who)
*/
Pending *
-server_dequeue(server)
- Server *server;
+server_dequeue(Server *server)
{
Pending *pending;
@@ -1673,8 +1645,7 @@ server_dequeue(server)
*/
void
-server_pending_free(pending)
- Pending *pending;
+server_pending_free(Pending *pending)
{
free(pending->packet);
free(pending);
@@ -1686,10 +1657,9 @@ server_pending_free(pending)
*/
void
-server_self_queue(notice, auth, who)
- ZNotice_t* notice;
- int auth;
- struct sockaddr_in * who;
+server_self_queue(ZNotice_t* notice,
+ int auth,
+ struct sockaddr_in * who)
{
char *pack;
int packlen;
@@ -1709,8 +1679,7 @@ server_self_queue(notice, auth, who)
* (true if called from signal handler)
*/
void
-server_dump_servers(fp)
- FILE *fp;
+server_dump_servers(FILE *fp)
{
int i;
diff --git a/server/subscr.c b/server/subscr.c
index 08d692a..a1fa916 100644
--- a/server/subscr.c
+++ b/server/subscr.c
@@ -73,33 +73,32 @@ Sched serv_ksched;
#ifdef OLD_COMPAT
#define OLD_ZEPHYR_VERSION "ZEPH0.0"
#define OLD_CLIENT_INCOMPSUBS "INCOMP"
-static void old_compat_subscr_sendlist __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
+static void old_compat_subscr_sendlist(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who);
extern int old_compat_count_subscr; /* counter of old use */
#endif /* OLD_COMPAT */
#ifdef NEW_COMPAT
#define NEW_OLD_ZEPHYR_VERSION "ZEPH0.1"
-static void new_old_compat_subscr_sendlist __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
+static void new_old_compat_subscr_sendlist(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who);
extern int new_compat_count_subscr; /* counter of old use */
#endif /* NEW_COMPAT */
-extern char *re_comp(), *re_conv();
-static Code_t add_subscriptions __P((Client *who, Destlist *subs_queue,
- ZNotice_t *notice, Server *server));
-static Destlist *extract_subscriptions __P((ZNotice_t *notice));
-static void free_subscriptions __P((Destlist *subs));
-static void free_subscription __P((Destlist *sub));
-static char **subscr_marshal_subs __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- int *found));
-static Destlist *subscr_copy_def_subs __P((char *person));
-static Code_t subscr_realm_sendit __P((Client *who, Destlist *subs,
- ZNotice_t *notice, ZRealm *realm));
-static void subscr_unsub_realms __P((Destlist *newsubs));
-static void subscr_unsub_sendit __P((Client *who, Destlist *subs,
- ZRealm *realm));
-static int cl_match __P((Destlist*, Client *));
+static Code_t add_subscriptions(Client *who, Destlist *subs_queue,
+ ZNotice_t *notice, Server *server);
+static Destlist *extract_subscriptions(ZNotice_t *notice);
+static void free_subscriptions(Destlist *subs);
+static void free_subscription(Destlist *sub);
+static char **subscr_marshal_subs(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who,
+ int *found);
+static Destlist *subscr_copy_def_subs(char *person);
+static Code_t subscr_realm_sendit(Client *who, Destlist *subs,
+ ZNotice_t *notice, ZRealm *realm);
+static void subscr_unsub_realms(Destlist *newsubs);
+static void subscr_unsub_sendit(Client *who, Destlist *subs,
+ ZRealm *realm);
+static int cl_match (Destlist*, Client *);
static int defaults_read = 0; /* set to 1 if the default subs
are in memory */
@@ -118,10 +117,9 @@ String *empty;
*/
Code_t
-subscr_subscribe(who, notice, server)
- Client *who;
- ZNotice_t *notice;
- Server *server;
+subscr_subscribe(Client *who,
+ ZNotice_t *notice,
+ Server *server)
{
Destlist *subs;
@@ -130,11 +128,10 @@ subscr_subscribe(who, notice, server)
}
static Code_t
-add_subscriptions(who, subs, notice, server)
- Client *who;
- Destlist *subs;
- ZNotice_t *notice;
- Server *server;
+add_subscriptions(Client *who,
+ Destlist *subs,
+ ZNotice_t *notice,
+ Server *server)
{
Destlist *next;
Code_t retval;
@@ -222,8 +219,7 @@ add_subscriptions(who, subs, notice, server)
*/
Code_t
-subscr_def_subs(who)
- Client *who;
+subscr_def_subs(Client *who)
{
Destlist *subs;
@@ -232,7 +228,7 @@ subscr_def_subs(who)
}
void
-subscr_reset()
+subscr_reset(void)
{
#if 0
zdbug((LOG_DEBUG, "subscr_reset()"));
@@ -243,8 +239,7 @@ subscr_reset()
}
static Destlist *
-subscr_copy_def_subs(person)
- char *person;
+subscr_copy_def_subs(char *person)
{
int retval, fd;
struct stat statbuf;
@@ -325,9 +320,8 @@ subscr_copy_def_subs(person)
*/
Code_t
-subscr_cancel(sin, notice)
- struct sockaddr_in *sin;
- ZNotice_t *notice;
+subscr_cancel(struct sockaddr_in *sin,
+ ZNotice_t *notice)
{
ZRealm *realm;
Client *who;
@@ -389,10 +383,9 @@ subscr_cancel(sin, notice)
}
Code_t
-subscr_realm_cancel(sin, notice, realm)
- struct sockaddr_in *sin;
- ZNotice_t *notice;
- ZRealm *realm;
+subscr_realm_cancel(struct sockaddr_in *sin,
+ ZNotice_t *notice,
+ ZRealm *realm)
{
Client *who;
Destlist *cancel_subs, *subs, *client_subs, *next, *next2;
@@ -443,8 +436,7 @@ subscr_realm_cancel(sin, notice, realm)
*/
void
-subscr_cancel_client(client)
- Client *client;
+subscr_cancel_client(Client *client)
{
Destlist *subs, *next;
Code_t retval;
@@ -481,10 +473,9 @@ subscr_cancel_client(client)
*/
void
-subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+subscr_sendlist(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who)
{
char **answer;
int found;
@@ -535,11 +526,10 @@ subscr_sendlist(notice, auth, who)
}
static char **
-subscr_marshal_subs(notice, auth, who, found)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int *found;
+subscr_marshal_subs(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ int *found)
{
char **answer = NULL;
unsigned short temp;
@@ -833,8 +823,7 @@ old_compat_subscr_sendlist(notice, auth, who)
/*ARGSUSED*/
Code_t
-subscr_send_subs(client)
- Client *client;
+subscr_send_subs(Client *client)
{
int i = 0;
Destlist *subs;
@@ -972,8 +961,7 @@ free_subscription(Destlist *sub)
}
static void
-free_subscriptions(subs)
- Destlist *subs;
+free_subscriptions(Destlist *subs)
{
Destlist *next;
@@ -996,8 +984,7 @@ free_subscriptions(subs)
*/
static Destlist *
-extract_subscriptions(notice)
- ZNotice_t *notice;
+extract_subscriptions(ZNotice_t *notice)
{
Destlist *subs = NULL, *sub;
char *recip, *class_name, *classinst;
@@ -1045,9 +1032,8 @@ extract_subscriptions(notice)
*/
void
-subscr_dump_subs(fp, subs)
- FILE *fp;
- Destlist *subs;
+subscr_dump_subs(FILE *fp,
+ Destlist *subs)
{
char *p;
@@ -1075,11 +1061,10 @@ subscr_dump_subs(fp, subs)
/* As it exists, this function expects to take only the first sub from the
* Destlist. At some point, it and the calling code should be replaced */
static Code_t
-subscr_realm_sendit(who, subs, notice, realm)
- Client *who;
- Destlist *subs;
- ZNotice_t *notice;
- ZRealm *realm;
+subscr_realm_sendit(Client *who,
+ Destlist *subs,
+ ZNotice_t *notice,
+ ZRealm *realm)
{
ZNotice_t snotice;
char *pack;
@@ -1162,10 +1147,9 @@ subscr_realm_sendit(who, subs, notice, realm)
/* Called from subscr_realm and subscr_foreign_user */
static Code_t
-subscr_add_raw(client, realm, newsubs)
- Client *client;
- ZRealm *realm;
- Destlist *newsubs;
+subscr_add_raw(Client *client,
+ ZRealm *realm,
+ Destlist *newsubs)
{
Destlist *subs, *subs2, *subs3, **head;
Code_t retval;
@@ -1221,9 +1205,8 @@ subscr_add_raw(client, realm, newsubs)
/* Called from bdump_recv_loop to decapsulate realm subs */
Code_t
-subscr_realm(realm, notice)
- ZRealm *realm;
- ZNotice_t *notice;
+subscr_realm(ZRealm *realm,
+ ZNotice_t *notice)
{
Destlist *newsubs;
@@ -1239,10 +1222,9 @@ subscr_realm(realm, notice)
/* Like realm_sendit, this only takes one item from subs */
static void
-subscr_unsub_sendit(who, subs, realm)
- Client *who;
- Destlist *subs;
- ZRealm *realm;
+subscr_unsub_sendit(Client *who,
+ Destlist *subs,
+ ZRealm *realm)
{
ZNotice_t unotice;
Code_t retval;
@@ -1306,8 +1288,7 @@ subscr_unsub_sendit(who, subs, realm)
/* Called from bump_send_loop by way of realm_send_realms */
Code_t
-subscr_send_realm_subs(realm)
- ZRealm *realm;
+subscr_send_realm_subs(ZRealm *realm)
{
int i = 0;
Destlist *subs, *next;
@@ -1373,8 +1354,7 @@ subscr_send_realm_subs(realm)
}
Code_t
-subscr_realm_subs(realm)
- ZRealm *realm;
+subscr_realm_subs(ZRealm *realm)
{
int i = 0;
Destlist *subs, *next;
@@ -1459,12 +1439,11 @@ subscr_realm_subs(realm)
/* Called from subscr_foreign_user for REALM_REQ_SUBSCRIBE */
static Code_t
-subscr_check_foreign_subs(notice, who, server, realm, newsubs)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- Server *server;
- ZRealm *realm;
- Destlist *newsubs;
+subscr_check_foreign_subs(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ Server *server,
+ ZRealm *realm,
+ Destlist *newsubs)
{
Destlist *subs, *subs2, *next;
Acl *acl;
@@ -1594,11 +1573,10 @@ subscr_check_foreign_subs(notice, who, server, realm, newsubs)
}
/* Called from realm_control_dispatch for REALM_REQ/ADD_SUBSCRIBE */
-Code_t subscr_foreign_user(notice, who, server, realm)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- Server *server;
- ZRealm *realm;
+Code_t subscr_foreign_user(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ Server *server,
+ ZRealm *realm)
{
Destlist *newsubs, *temp;
Acl *acl;
diff --git a/server/timer.c b/server/timer.c
index b6cbf51..11d61fe 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -114,13 +114,13 @@ static Timer **heap;
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;
@@ -134,8 +134,7 @@ Timer *timer_set_rel(time_rel, proc, arg)
}
void
-timer_reset(tmr)
- Timer *tmr;
+timer_reset(Timer *tmr)
{
int pos, min;
@@ -176,8 +175,7 @@ timer_reset(tmr)
#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;
@@ -207,7 +205,7 @@ add_timer(new)
}
void
-timer_process()
+timer_process(void)
{
Timer *t;
timer_proc func;
@@ -231,8 +229,7 @@ timer_process()
}
struct timeval *
-timer_timeout(tvbuf)
- struct timeval *tvbuf;
+timer_timeout(struct timeval *tvbuf)
{
if (num_timers > 0) {
tvbuf->tv_sec = heap[0]->abstime - NOW;
@@ -246,8 +243,7 @@ timer_timeout(tvbuf)
}
static void
-timer_botch(arg)
- void *arg;
+timer_botch(void *arg)
{
syslog(LOG_CRIT, "timer botch\n");
abort();
diff --git a/server/uloc.c b/server/uloc.c
index 07770a9..8583553 100644
--- a/server/uloc.c
+++ b/server/uloc.c
@@ -116,11 +116,10 @@ static int num_locs = 0; /* number in array */
*/
Code_t
-ulogin_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+ulogin_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
Exposure_type retval;
int err_ret;
@@ -257,11 +256,10 @@ ulogin_dispatch(notice, auth, who, server)
}
static void
-login_sendit(notice, auth, who, external)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int external;
+login_sendit(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ int external)
{
ZNotice_t log_notice;
@@ -280,11 +278,10 @@ login_sendit(notice, auth, who, external)
* Dispatch a LOCATE notice.
*/
Code_t
-ulocate_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+ulocate_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
char *cp;
ZRealm *realm;
@@ -311,8 +308,7 @@ ulocate_dispatch(notice, auth, who, server)
*/
void
-uloc_hflush(addr)
- struct in_addr *addr;
+uloc_hflush(struct in_addr *addr)
{
Location *loc;
int i = 0, new_num = 0;
@@ -354,8 +350,7 @@ uloc_hflush(addr)
}
void
-uloc_flush_client(sin)
- struct sockaddr_in *sin;
+uloc_flush_client(struct sockaddr_in *sin)
{
Location *loc;
int i = 0, new_num = 0;
@@ -414,7 +409,7 @@ uloc_flush_client(sin)
/*ARGSUSED*/
Code_t
-uloc_send_locations()
+uloc_send_locations(void)
{
Location *loc;
int i;
@@ -465,10 +460,9 @@ uloc_send_locations()
*/
static int
-ulogin_add_user(notice, exposure, who)
- ZNotice_t *notice;
- Exposure_type exposure;
- struct sockaddr_in *who;
+ulogin_add_user(ZNotice_t *notice,
+ Exposure_type exposure,
+ struct sockaddr_in *who)
{
Location *loc, *oldlocs, newloc;
int i;
@@ -543,11 +537,10 @@ ulogin_add_user(notice, exposure, who)
*/
static int
-ulogin_setup(notice, locs, exposure, who)
- ZNotice_t *notice;
- Location *locs;
- Exposure_type exposure;
- struct sockaddr_in *who;
+ulogin_setup(ZNotice_t *notice,
+ Location *locs,
+ Exposure_type exposure,
+ struct sockaddr_in *who)
{
if (ulogin_parse(notice, locs))
return 1;
@@ -564,9 +557,8 @@ ulogin_setup(notice, locs, exposure, who)
*/
static int
-ulogin_parse(notice, locs)
- ZNotice_t *notice;
- Location *locs;
+ulogin_parse(ZNotice_t *notice,
+ Location *locs)
{
char *cp, *base;
int nulls = 0;
@@ -604,10 +596,9 @@ ulogin_parse(notice, locs)
static Location *
-ulogin_find(user, host, port)
- char *user;
- struct in_addr *host;
- unsigned int port;
+ulogin_find(char *user,
+ struct in_addr *host,
+ unsigned int port)
{
Location *loc;
String *str;
@@ -638,8 +629,7 @@ ulogin_find(user, host, port)
*/
static Location *
-ulogin_find_user(user)
- char *user;
+ulogin_find_user(char *user)
{
int i, rlo, rhi;
int compar;
@@ -677,8 +667,7 @@ ulogin_find_user(user)
}
static int
-ul_equiv(l1, l2)
- Location *l1, *l2;
+ul_equiv(Location *l1, Location *l2)
{
if (l1->machine != l2->machine)
return 0;
@@ -692,10 +681,9 @@ ul_equiv(l1, l2)
*/
static Exposure_type
-ulogin_remove_user(notice, who, err_return)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int *err_return;
+ulogin_remove_user(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int *err_return)
{
Location *new_locs, *loc;
int i = 0;
@@ -752,8 +740,7 @@ ulogin_remove_user(notice, who, err_return)
*/
static void
-ulogin_flush_user(notice)
- ZNotice_t *notice;
+ulogin_flush_user(ZNotice_t *notice)
{
Location *loc, *loc2;
int i, j, num_match, num_left;
@@ -824,10 +811,9 @@ ulogin_flush_user(notice)
static void
-ulogin_locate(notice, who, auth)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int auth;
+ulogin_locate(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int auth)
{
char **answer;
int found;
@@ -865,10 +851,9 @@ ulogin_locate(notice, who, auth)
*/
static char **
-ulogin_marshal_locs(notice, found, auth)
- ZNotice_t *notice;
- int *found;
- int auth;
+ulogin_marshal_locs(ZNotice_t *notice,
+ int *found,
+ int auth)
{
Location **matches = (Location **) 0;
Location *loc;
@@ -955,8 +940,7 @@ ulogin_marshal_locs(notice, found, auth)
}
void
-uloc_dump_locs(fp)
- FILE *fp;
+uloc_dump_locs(FILE *fp)
{
int i;
@@ -996,8 +980,7 @@ uloc_dump_locs(fp)
}
static void
-free_loc(loc)
- Location *loc;
+free_loc(Location *loc)
{
free_string(loc->user);
free_string(loc->machine);
@@ -1007,10 +990,9 @@ free_loc(loc)
}
static void
-ulogin_locate_forward(notice, who, realm)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- ZRealm *realm;
+ulogin_locate_forward(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ ZRealm *realm)
{
ZNotice_t lnotice;
@@ -1021,10 +1003,9 @@ ulogin_locate_forward(notice, who, realm)
}
void
-ulogin_realm_locate(notice, who, realm)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- ZRealm *realm;
+ulogin_realm_locate(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ ZRealm *realm)
{
char **answer;
int found;
@@ -1068,9 +1049,8 @@ ulogin_realm_locate(notice, who, realm)
}
void
-ulogin_relay_locate(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+ulogin_relay_locate(ZNotice_t *notice,
+ struct sockaddr_in *who)
{
ZNotice_t lnotice;
Code_t retval;
diff --git a/server/version.c b/server/version.c
index f397f5f..d2b23ce 100644
--- a/server/version.c
+++ b/server/version.c
@@ -33,7 +33,7 @@ static const char copyright[] =
#endif
char *
-get_version()
+get_version(void)
{
static char vers_buf[256];
struct utsname un;
diff --git a/server/zserver.h b/server/zserver.h
index 07a0baa..69c19cb 100644
--- a/server/zserver.h
+++ b/server/zserver.h
@@ -37,7 +37,7 @@
extern krb5_keyblock *__Zephyr_keyblock;
#define ZGetSession() (__Zephyr_keyblock)
void ZSetSession(krb5_keyblock *keyblock);
-Code_t ZFormatAuthenticNoticeV5 __P((ZNotice_t*, char*, int, int*, krb5_keyblock *));
+Code_t ZFormatAuthenticNoticeV5(ZNotice_t*, char*, int, int*, krb5_keyblock *);
krb5_error_code Z_krb5_init_keyblock(krb5_context, krb5_enctype, size_t,
krb5_keyblock **);
#else
@@ -46,7 +46,7 @@ extern C_Block __Zephyr_session;
#endif
void ZSetSessionDES(C_Block *key);
-Code_t ZFormatAuthenticNotice __P((ZNotice_t*, char*, int, int*, C_Block));
+Code_t ZFormatAuthenticNotice(ZNotice_t*, char*, int, int*, C_Block);
#endif
/* For krb_rd_req prototype and definition. */
@@ -219,146 +219,145 @@ struct _Statistic {
/* Function declarations */
/* found in bdump.c */
-void bdump_get __P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- Server *server));
-void bdump_send __P((void));
-void bdump_offer __P((struct sockaddr_in *who));
-Code_t bdump_send_list_tcp __P((ZNotice_Kind_t kind, struct sockaddr_in *addr,
+void bdump_get(ZNotice_t *notice, int auth, struct sockaddr_in *who,
+ Server *server);
+void bdump_send(void);
+void bdump_offer(struct sockaddr_in *who);
+Code_t bdump_send_list_tcp(ZNotice_Kind_t kind, struct sockaddr_in *addr,
char *class_name, char *inst, char *opcode,
char *sender, char *recip, char **lyst,
- int num));
-int get_tgt __P((void));
+ int num);
+int get_tgt(void);
/* found in class.c */
extern String *class_control, *class_admin, *class_hm;
extern String *class_ulogin, *class_ulocate;
-int ZDest_eq __P((Destination *d1, Destination *d2));
-Code_t triplet_register __P((Client *client, Destination *dest, ZRealm *realm));
-Code_t triplet_deregister __P((Client *client, Destination *dest,
- ZRealm *realm));
-Code_t class_restrict __P((char *class, Acl *acl));
-Code_t class_setup_restricted __P((char *class, Acl *acl));
-Client **triplet_lookup __P((Destination *dest));
-Acl *class_get_acl __P((String *class));
-int dest_eq __P((Destination *d1, Destination *d2));
-int order_dest_strings __P((Destination *d1, Destination *d2));
-void triplet_dump_subs __P((FILE *fp));
+int ZDest_eq(Destination *d1, Destination *d2);
+Code_t triplet_register(Client *client, Destination *dest, ZRealm *realm);
+Code_t triplet_deregister(Client *client, Destination *dest,
+ ZRealm *realm);
+Code_t class_restrict(char *class, Acl *acl);
+Code_t class_setup_restricted(char *class, Acl *acl);
+Client **triplet_lookup(Destination *dest);
+Acl *class_get_acl(String *class);
+int dest_eq(Destination *d1, Destination *d2);
+int order_dest_strings(Destination *d1, Destination *d2);
+void triplet_dump_subs(FILE *fp);
/* found in client.c */
-Code_t client_register __P((ZNotice_t *notice, struct in_addr *host,
- Client **client_p, int wantdefaults));
-void client_deregister __P((Client *client, int flush));
-void client_flush_host __P((struct in_addr *host));
-void client_dump_clients __P((FILE *fp));
-Client *client_find __P((struct in_addr *host, unsigned int port));
-Code_t client_send_clients __P((void));
+Code_t client_register(ZNotice_t *notice, struct in_addr *host,
+ Client **client_p, int wantdefaults);
+void client_deregister(Client *client, int flush);
+void client_flush_host(struct in_addr *host);
+void client_dump_clients(FILE *fp);
+Client *client_find(struct in_addr *host, unsigned int port);
+Code_t client_send_clients(void);
/* found in common.c */
-char *strsave __P((const char *str));
-unsigned long hash __P((const char *));
-void dump_quote __P((char *p, FILE *fp));
+char *strsave(const char *str);
+unsigned long hash (const char *);
+void dump_quote(char *p, FILE *fp);
/* found in dispatch.c */
-void handle_packet __P((void));
-void clt_ack __P((ZNotice_t *notice, struct sockaddr_in *who, Sent_type sent));
-void nack_release __P((Client *client));
-void sendit __P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- int external));
-void rexmit __P((void *));
-void xmit __P((ZNotice_t *notice, struct sockaddr_in *dest, int auth,
- Client *client));
-Code_t hostm_dispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, Server *server));
-Code_t control_dispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, Server *server));
-Code_t xmit_frag __P((ZNotice_t *notice, char *buf, int len, int waitforack));
-void hostm_shutdown __P((void));
+void handle_packet(void);
+void clt_ack(ZNotice_t *notice, struct sockaddr_in *who, Sent_type sent);
+void nack_release(Client *client);
+void sendit(ZNotice_t *notice, int auth, struct sockaddr_in *who,
+ int external);
+void rexmit(void *);
+void xmit(ZNotice_t *notice, struct sockaddr_in *dest, int auth,
+ Client *client);
+Code_t hostm_dispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server);
+Code_t control_dispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server);
+Code_t xmit_frag(ZNotice_t *notice, char *buf, int len, int waitforack);
+void hostm_shutdown(void);
/* found in kstuff.c */
#ifdef HAVE_KRB4
-int GetKerberosData __P((int, struct in_addr, AUTH_DAT *, char *, char *));
-Code_t SendKerberosData __P((int, KTEXT, char *, char *));
-void sweep_ticket_hash_table __P((void *));
+int GetKerberosData (int, struct in_addr, AUTH_DAT *, char *, char *);
+Code_t SendKerberosData (int, KTEXT, char *, char *);
+void sweep_ticket_hash_table(void *);
#endif
/* found in kopt.c */
#ifdef HAVE_KRB4
#ifndef NOENCRYPTION
-Sched *check_key_sched_cache __P((des_cblock key));
-void add_to_key_sched_cache __P((des_cblock key, Sched *sched));
-/*int krb_set_key __P((void *key, int cvt));*/
-/* int krb_rd_req __P((KTEXT authent, char *service, char *instance,
- unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn)); */
-int krb_find_ticket __P((KTEXT authent, KTEXT ticket));
-int krb_get_lrealm __P((char *r, int n));
+Sched *check_key_sched_cache(des_cblock key);
+void add_to_key_sched_cache(des_cblock key, Sched *sched);
+/*int krb_set_key(void *key, int cvt);*/
+/* int krb_rd_req(KTEXT authent, char *service, char *instance,
+ unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn); */
+int krb_find_ticket(KTEXT authent, KTEXT ticket);
+int krb_get_lrealm(char *r, int n);
#endif
#endif
/* found in server.c */
-void server_timo __P((void *which));
-void server_dump_servers __P((FILE *fp));
-void server_init __P((void));
-void server_shutdown __P((void));
-void server_forward __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-void server_kill_clt __P((Client *client));
-void server_pending_free __P((Pending *pending));
-void server_self_queue __P((ZNotice_t *, int, struct sockaddr_in *));
-void server_send_queue __P((Server *));
-void server_reset __P((void));
-int is_server();
-Server *server_which_server __P((struct sockaddr_in *who));
-Pending *server_dequeue __P((Server *server));
-Code_t server_dispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-Code_t server_adispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, Server *server));
+void server_timo(void *which);
+void server_dump_servers(FILE *fp);
+void server_init(void);
+void server_shutdown(void);
+void server_forward(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who);
+void server_kill_clt(Client *client);
+void server_pending_free(Pending *pending);
+void server_self_queue(ZNotice_t *, int, struct sockaddr_in *);
+void server_send_queue(Server *);
+void server_reset(void);
+Server *server_which_server(struct sockaddr_in *who);
+Pending *server_dequeue(Server *server);
+Code_t server_dispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who);
+Code_t server_adispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server);
/* found in subscr.c */
-Code_t subscr_foreign_user __P((ZNotice_t *, struct sockaddr_in *, Server *, ZRealm *));
-Code_t subscr_cancel __P((struct sockaddr_in *sin, ZNotice_t *notice));
-Code_t subscr_subscribe __P((Client *who, ZNotice_t *notice, Server *server));
-Code_t subscr_send_subs __P((Client *client));
-void subscr_cancel_client __P((Client *client));
-void subscr_sendlist __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-void subscr_dump_subs __P((FILE *fp, Destlist *subs));
-void subscr_reset __P((void));
-Code_t subscr_def_subs __P((Client *who));
+Code_t subscr_foreign_user(ZNotice_t *, struct sockaddr_in *, Server *, ZRealm *);
+Code_t subscr_cancel(struct sockaddr_in *sin, ZNotice_t *notice);
+Code_t subscr_subscribe(Client *who, ZNotice_t *notice, Server *server);
+Code_t subscr_send_subs(Client *client);
+void subscr_cancel_client(Client *client);
+void subscr_sendlist(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who);
+void subscr_dump_subs(FILE *fp, Destlist *subs);
+void subscr_reset(void);
+Code_t subscr_def_subs(Client *who);
/* found in uloc.c */
-void uloc_hflush __P((struct in_addr *addr));
-void uloc_flush_client __P((struct sockaddr_in *sin));
-void uloc_dump_locs __P((FILE *fp));
-Code_t ulogin_dispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, Server *server));
-Code_t ulocate_dispatch __P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, Server *server));
-Code_t uloc_send_locations __P((void));
+void uloc_hflush(struct in_addr *addr);
+void uloc_flush_client(struct sockaddr_in *sin);
+void uloc_dump_locs(FILE *fp);
+Code_t ulogin_dispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server);
+Code_t ulocate_dispatch(ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server);
+Code_t uloc_send_locations(void);
/* found in realm.c */
-int realm_sender_in_realm __P((char *realm, char *sender));
-int realm_bound_for_realm __P((char *realm, char *recip));
-ZRealm *realm_which_realm __P((struct sockaddr_in *who));
-ZRealm *realm_get_realm_by_name __P((char *name));
-ZRealm *realm_get_realm_by_pid __P((int));
+int realm_sender_in_realm(char *realm, char *sender);
+int realm_bound_for_realm(char *realm, char *recip);
+ZRealm *realm_which_realm(struct sockaddr_in *who);
+ZRealm *realm_get_realm_by_name(char *name);
+ZRealm *realm_get_realm_by_pid(int);
void realm_handoff(ZNotice_t *, int, struct sockaddr_in *, ZRealm *, int);
char *realm_expand_realm(char *);
-void realm_init __P((void));
-Code_t ZCheckZRealmAuthentication __P((ZNotice_t *, struct sockaddr_in *,
- char *));
-Code_t realm_control_dispatch __P((ZNotice_t *, int, struct sockaddr_in *,
- Server *, ZRealm *));
-void realm_shutdown __P((void));
-void realm_deathgram __P((Server *));
+void realm_init(void);
+Code_t ZCheckZRealmAuthentication(ZNotice_t *, struct sockaddr_in *,
+ char *);
+Code_t realm_control_dispatch(ZNotice_t *, int, struct sockaddr_in *,
+ Server *, ZRealm *);
+void realm_shutdown(void);
+void realm_deathgram(Server *);
/* found in version.c */
-char *get_version __P((void));
+char *get_version(void);
/* global identifiers */
/* found in main.c */
-int packets_waiting __P((void));
+int packets_waiting(void);
extern struct sockaddr_in srv_addr; /* server socket address */
extern unsigned short hm_port; /* host manager receiver port */
extern unsigned short hm_srv_port; /* host manager server sending port */
diff --git a/server/zstring.c b/server/zstring.c
index e4e26b8..05cd418 100644
--- a/server/zstring.c
+++ b/server/zstring.c
@@ -23,9 +23,8 @@ static const char rcsid_zstring_c[] =
static String *zhash[STRING_HASH_TABLE_SIZE];
String *
-make_string(s, downcase)
- char *s;
- int downcase;
+make_string(char *s,
+ int downcase)
{
char *new_s,*p;
String *new_z,*hp;
@@ -73,8 +72,7 @@ make_string(s, downcase)
}
void
-free_string(z)
- String *z;
+free_string(String *z)
{
if (z == (String *) NULL)
return;
@@ -97,9 +95,8 @@ free_string(z)
}
String *
-find_string(s,downcase)
- char *s;
- int downcase;
+find_string(char *s,
+ int downcase)
{
char *new_s,*p;
String *z;
@@ -130,8 +127,8 @@ find_string(s,downcase)
}
int
-comp_string(a,b)
- String *a, *b;
+comp_string(String *a,
+ String *b)
{
if (a->hash_val > b->hash_val)
return 1;
@@ -141,8 +138,7 @@ comp_string(a,b)
}
void
-print_string_table(f)
- FILE *f;
+print_string_table(FILE *f)
{
String *p;
int i;
@@ -157,8 +153,7 @@ print_string_table(f)
}
String *
-dup_string(z)
- String *z;
+dup_string(String *z)
{
z->ref_count++;
return z;