diff options
| author | christos <christos@NetBSD.org> | 1996-09-24 16:36:19 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 1996-09-24 16:36:19 +0000 |
| commit | 41751ebe3cea9c1917299d5f39e67fbe4923ced0 (patch) | |
| tree | 1503d92da5dda5d8caf14c2ae7dc6c1318296b59 /include | |
| parent | 4d3fba59886c135c2b6a606398ae8c23045987dc (diff) | |
- Revert to the traditional struct sockaddr description of the rip v1 packets.
- Fix a bad bug where:
u_int16_t n_dst;
should be:
u_int32_t n_dst;
If this bug is in the 1.2 release it should be part of the first patch.
Diffstat (limited to 'include')
| -rw-r--r-- | include/protocols/routed.h | 38 |
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. |
