Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/map-mbone Unifdef __STDC__. ANSIfy. Remove __P().
details: https://anonhg.NetBSD.org/src/rev/db6df87915e3
branches: trunk
changeset: 534058:db6df87915e3
user: wiz <wiz%NetBSD.org@localhost>
date: Sun Jul 14 15:34:58 2002 +0000
description:
Unifdef __STDC__. ANSIfy. Remove __P().
diffstat:
usr.sbin/map-mbone/mapper.c | 186 +++++++++++++------------------------------
1 files changed, 57 insertions(+), 129 deletions(-)
diffs (truncated from 399 to 300 lines):
diff -r 910fb4d1f38a -r db6df87915e3 usr.sbin/map-mbone/mapper.c
--- a/usr.sbin/map-mbone/mapper.c Sun Jul 14 15:27:58 2002 +0000
+++ b/usr.sbin/map-mbone/mapper.c Sun Jul 14 15:34:58 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mapper.c,v 1.9 2002/06/02 13:47:02 itojun Exp $ */
+/* $NetBSD: mapper.c,v 1.10 2002/07/14 15:34:58 wiz Exp $ */
/* Mapper for connections between MRouteD multicast routers.
* Written by Pavel Curtis <Pavel%PARC.Xerox.Com@localhost>
@@ -39,11 +39,7 @@
#include <sys/time.h>
#include "defs.h"
#include <arpa/inet.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#define DEFAULT_TIMEOUT 2 /* How long to wait before retrying requests */
#define DEFAULT_RETRIES 1 /* How many times to ask each router */
@@ -87,31 +83,27 @@
vifi_t numvifs; /* to keep loader happy */
/* (see COPY_TABLES macro called in kern.c) */
-Node * find_node __P((u_int32_t addr, Node **ptr));
-Interface * find_interface __P((u_int32_t addr, Node *node));
-Neighbor * find_neighbor __P((u_int32_t addr, Node *node));
-int main __P((int argc, char *argv[]));
-void ask __P((u_int32_t dst));
-void ask2 __P((u_int32_t dst));
-int retry_requests __P((Node *node));
-char * inet_name __P((u_int32_t addr));
-void print_map __P((Node *node));
-char * graph_name __P((u_int32_t addr, char *buf));
-void graph_edges __P((Node *node));
-void elide_aliases __P((Node *node));
-void graph_map __P((void));
-int get_number __P((int *var, int deflt, char ***pargv,
- int *pargc));
-u_int32_t host_addr __P((char *name));
+Node * find_node(u_int32_t addr, Node **ptr);
+Interface * find_interface(u_int32_t addr, Node *node);
+Neighbor * find_neighbor(u_int32_t addr, Node *node);
+int main(int argc, char *argv[]);
+void ask(u_int32_t dst);
+void ask2(u_int32_t dst);
+int retry_requests(Node *node);
+char * inet_name(u_int32_t addr);
+void print_map(Node *node);
+char * graph_name(u_int32_t addr, char *buf);
+void graph_edges(Node *node);
+void elide_aliases(Node *node);
+void graph_map(void);
+int get_number(int *var, int deflt, char ***pargv,
+ int *pargc);
+u_int32_t host_addr(char *name);
-#ifdef __STDC__
void log(int severity, int syserr, const char *format, ...)
__attribute__((__format__(__printf__, 3, 4)));
-#endif
-Node *find_node(addr, ptr)
- u_int32_t addr;
- Node **ptr;
+Node *find_node(u_int32_t addr, Node **ptr)
{
Node *n = *ptr;
@@ -132,9 +124,7 @@
}
-Interface *find_interface(addr, node)
- u_int32_t addr;
- Node *node;
+Interface *find_interface(u_int32_t addr, Node *node)
{
Interface *ifc;
@@ -152,9 +142,7 @@
}
-Neighbor *find_neighbor(addr, node)
- u_int32_t addr;
- Node *node;
+Neighbor *find_neighbor(u_int32_t addr, Node *node)
{
Interface *ifc;
@@ -175,17 +163,8 @@
* message and the current debug level. For errors of severity LOG_ERR or
* worse, terminate the program.
*/
-#ifdef __STDC__
void
log(int severity, int syserr, const char *format, ...)
-#else
-/*VARARGS3*/
-void
-log(severity, syserr, format, va_alist)
- int severity, syserr;
- char *format;
- va_dcl
-#endif
{
va_list ap;
char fmt[100];
@@ -200,11 +179,7 @@
strcat(fmt, "warning - ");
strncat(fmt, format, 80);
format = fmt;
-#ifdef __STDC__
va_start(ap, format);
-#else
- va_start(ap);
-#endif
vfprintf(stderr, format, ap);
va_end(ap);
if (syserr == 0)
@@ -221,15 +196,13 @@
/*
* Send a neighbors-list request.
*/
-void ask(dst)
- u_int32_t dst;
+void ask(u_int32_t dst)
{
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS,
htonl(MROUTED_LEVEL), 0);
}
-void ask2(dst)
- u_int32_t dst;
+void ask2(u_int32_t dst)
{
send_igmp(our_addr, dst, IGMP_DVMRP, DVMRP_ASK_NEIGHBORS2,
htonl(MROUTED_LEVEL), 0);
@@ -239,9 +212,7 @@
/*
* Process an incoming group membership report.
*/
-void accept_group_report(src, dst, group, r_type)
- u_int32_t src, dst, group;
- int r_type;
+void accept_group_report(u_int32_t src, u_int32_t dst, u_int32_t group, int r_type)
{
log(LOG_INFO, 0, "ignoring IGMP group membership report from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
@@ -251,10 +222,8 @@
/*
* Process an incoming neighbor probe message.
*/
-void accept_probe(src, dst, p, datalen, level)
- u_int32_t src, dst, level;
- char *p;
- int datalen;
+void accept_probe(u_int32_t src, u_int32_t dst, char *p, int datalen,
+ u_int32_t level)
{
log(LOG_INFO, 0, "ignoring DVMRP probe from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
@@ -264,10 +233,8 @@
/*
* Process an incoming route report message.
*/
-void accept_report(src, dst, p, datalen, level)
- u_int32_t src, dst, level;
- char *p;
- int datalen;
+void accept_report(u_int32_t src, u_int32_t dst, char *p, int datalen,
+ u_int32_t level)
{
log(LOG_INFO, 0, "ignoring DVMRP routing report from %s to %s",
inet_fmt(src, s1), inet_fmt(dst, s2));
@@ -277,8 +244,7 @@
/*
* Process an incoming neighbor-list request message.
*/
-void accept_neighbor_request(src, dst)
- u_int32_t src, dst;
+void accept_neighbor_request(u_int32_t src, u_int32_t dst)
{
if (src != our_addr)
log(LOG_INFO, 0,
@@ -286,8 +252,7 @@
inet_fmt(src, s1), inet_fmt(dst, s2));
}
-void accept_neighbor_request2(src, dst)
- u_int32_t src, dst;
+void accept_neighbor_request2(u_int32_t src, u_int32_t dst)
{
if (src != our_addr)
log(LOG_INFO, 0,
@@ -299,10 +264,8 @@
/*
* Process an incoming neighbor-list message.
*/
-void accept_neighbors(src, dst, p, datalen, level)
- u_int32_t src, dst, level;
- u_char *p;
- int datalen;
+void accept_neighbors(u_int32_t src, u_int32_t dst, u_char *p, int datalen,
+ u_int32_t level)
{
Node *node = find_node(src, &routers);
@@ -460,10 +423,8 @@
}
}
-void accept_neighbors2(src, dst, p, datalen, level)
- u_int32_t src, dst, level;
- u_char *p;
- int datalen;
+void accept_neighbors2(u_int32_t src, u_int32_t dst, u_char *p, int datalen,
+ u_int32_t level)
{
Node *node = find_node(src, &routers);
u_int broken_cisco = ((level & 0xffff) == 0x020a); /* 10.2 */
@@ -607,14 +568,13 @@
}
-void check_vif_state()
+void check_vif_state(void)
{
log(LOG_NOTICE, 0, "network marked down...");
}
-int retry_requests(node)
- Node *node;
+int retry_requests(Node *node)
{
int result;
@@ -634,8 +594,7 @@
}
-char *inet_name(addr)
- u_int32_t addr;
+char *inet_name(u_int32_t addr)
{
struct hostent *e;
@@ -645,8 +604,7 @@
}
-void print_map(node)
- Node *node;
+void print_map(Node *node)
{
if (node) {
char *name, *addr;
@@ -713,9 +671,7 @@
}
-char *graph_name(addr, buf)
- u_int32_t addr;
- char *buf;
+char *graph_name(u_int32_t addr, char *buf)
{
char *name;
@@ -728,8 +684,7 @@
}
-void graph_edges(node)
- Node *node;
+void graph_edges(Node *node)
{
Interface *ifc;
Neighbor *nb;
@@ -773,8 +728,7 @@
}
}
-void elide_aliases(node)
- Node *node;
+void elide_aliases(Node *node)
{
if (node) {
elide_aliases(node->left);
@@ -796,7 +750,7 @@
}
}
-void graph_map()
+void graph_map(void)
{
time_t now = time(0);
char *nowstr = ctime(&now);
Home |
Main Index |
Thread Index |
Old Index