summaryrefslogtreecommitdiff
path: root/include/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'include/protocols')
-rw-r--r--include/protocols/routed.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/protocols/routed.h b/include/protocols/routed.h
index 7413294725e..1c1f09d7cdb 100644
--- a/include/protocols/routed.h
+++ b/include/protocols/routed.h
@@ -1,4 +1,4 @@
-/* $NetBSD: routed.h,v 1.5 1996/08/10 01:37:09 thorpej Exp $ */
+/* $NetBSD: routed.h,v 1.6 1996/09/24 16:36:19 christos Exp $ */
/*-
* Copyright (c) 1983, 1989, 1993
@@ -33,6 +33,7 @@
* SUCH DAMAGE.
*
* @(#)routed.h 8.1 (Berkeley) 6/2/93
+ *
*/
#ifndef _ROUTED_H_
@@ -60,32 +61,35 @@ extern "C" {
#endif
#define RIP_PORT 520
-
+
#if RIPVERSION == 1
+/* Note that this so called sockaddr has a 2-byte sa_family and no sa_len.
+ * It is not a UNIX sockaddr, but the shape of an address as defined
+ * in RIPv1. It is still defined to allow old versions of programs
+ * such as `gated` to use this file to define RIPv1.
+ */
struct netinfo {
- u_int16_t rip_family;
- u_int16_t rip_tag;
- u_int32_t rip_dst; /* destination net/host */
- u_int32_t rip_metric; /* cost of route */
+ struct sockaddr rip_dst; /* destination net/host */
+ u_int32_t rip_metric; /* cost of route */
};
#else
struct netinfo {
- u_int16_t n_family;
+ u_int16_t n_family;
#define RIP_AF_INET htons(AF_INET)
#define RIP_AF_UNSPEC 0
#define RIP_AF_AUTH 0xffff
- u_int16_t n_tag; /* optional in RIPv2 */
- u_int16_t n_dst; /* destination net or host */
+ u_int16_t n_tag; /* optional in RIPv2 */
+ u_int32_t n_dst; /* destination net or host */
#define RIP_DEFAULT 0
- u_int32_t n_mask; /* netmask in RIPv2 */
- u_int32_t n_nhop; /* optional next hop in RIPv2 */
- u_int32_t n_metric; /* cost of route */
+ u_int32_t n_mask; /* netmask in RIPv2 */
+ u_int32_t n_nhop; /* optional next hop in RIPv2 */
+ u_int32_t n_metric; /* cost of route */
};
#endif
/* RIPv2 authentication */
struct netauth {
- u_int16_t a_type;
+ u_int16_t a_type;
#define RIP_AUTH_PW htons(2) /* password type */
union {
#define RIP_AUTH_PW_LEN 16
@@ -94,9 +98,9 @@ struct netauth {
};
struct rip {
- u_int8_t rip_cmd; /* request/response */
- u_int8_t rip_vers; /* protocol version # */
- u_int16_t rip_res1; /* pad to 32-bit boundary */
+ u_int8_t rip_cmd; /* request/response */
+ u_int8_t rip_vers; /* protocol version # */
+ u_int16_t rip_res1; /* pad to 32-bit boundary */
union { /* variable length... */
struct netinfo ru_nets[1];
int8_t ru_tracefile[1];
@@ -132,7 +136,7 @@ char *ripcmds[RIPCMD_MAX] = {
#define NETS_LEN ((MAXPACKETSIZE-sizeof(struct rip)) \
/ sizeof(struct netinfo) +1)
-#define INADDR_RIP_GROUP (u_int32_t)0xe0000009 /* 224.0.0.9 */
+#define INADDR_RIP_GROUP (u_int32_t)0xe0000009 /* 224.0.0.9 */
/* Timer values used in managing the routing table.