routed.h (17844) | routed.h (19886) |
---|---|
1/*- 2 * Copyright (c) 1983, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35 * $NetBSD$ 36 */ 37 38#ifndef _ROUTED_H_ 39#define _ROUTED_H_ 40#ifdef __cplusplus 41extern "C" { 42#endif | 1/*- 2 * Copyright (c) 1983, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35 * $NetBSD$ 36 */ 37 38#ifndef _ROUTED_H_ 39#define _ROUTED_H_ 40#ifdef __cplusplus 41extern "C" { 42#endif |
43#ident "$Revision: 1.9 $" | 43#ident "$Revision: 1.1.1.1 $" |
44 45/* 46 * Routing Information Protocol 47 * 48 * Derived from Xerox NS Routing Information Protocol 49 * by changing 32-bit net numbers to sockaddr's and 50 * padding stuff to 32-bit boundaries. 51 */ --- 28 unchanged lines hidden (view full) --- 80 u_int32_t n_mask; /* netmask in RIPv2 */ 81 u_int32_t n_nhop; /* optional next hop in RIPv2 */ 82 u_int32_t n_metric; /* cost of route */ 83}; 84#endif 85 86/* RIPv2 authentication */ 87struct netauth { | 44 45/* 46 * Routing Information Protocol 47 * 48 * Derived from Xerox NS Routing Information Protocol 49 * by changing 32-bit net numbers to sockaddr's and 50 * padding stuff to 32-bit boundaries. 51 */ --- 28 unchanged lines hidden (view full) --- 80 u_int32_t n_mask; /* netmask in RIPv2 */ 81 u_int32_t n_nhop; /* optional next hop in RIPv2 */ 82 u_int32_t n_metric; /* cost of route */ 83}; 84#endif 85 86/* RIPv2 authentication */ 87struct netauth { |
88 u_int16_t a_family; /* always RIP_AF_AUTH */ |
|
88 u_int16_t a_type; | 89 u_int16_t a_type; |
90#define RIP_AUTH_NONE 0 |
|
89#define RIP_AUTH_PW htons(2) /* password type */ | 91#define RIP_AUTH_PW htons(2) /* password type */ |
92#define RIP_AUTH_MD5 htons(3) /* Keyed MD5 */ |
|
90 union { 91#define RIP_AUTH_PW_LEN 16 | 93 union { 94#define RIP_AUTH_PW_LEN 16 |
92 int8_t au_pw[RIP_AUTH_PW_LEN]; | 95 u_int8_t au_pw[RIP_AUTH_PW_LEN]; 96 struct a_md5 { 97 int16_t md5_pkt_len; /* RIP-II packet length */ 98 int8_t md5_keyid; /* key ID and auth data len */ 99 int8_t md5_auth_len; /* 16 */ 100 u_int32_t md5_seqno; /* sequence number */ 101 u_int32_t rsvd[2]; /* must be 0 */ 102#define RIP_AUTH_MD5_LEN RIP_AUTH_PW_LEN 103 } a_md5; |
93 } au; 94}; 95 96struct rip { 97 u_int8_t rip_cmd; /* request/response */ 98 u_int8_t rip_vers; /* protocol version # */ 99 u_int16_t rip_res1; /* pad to 32-bit boundary */ 100 union { /* variable length... */ 101 struct netinfo ru_nets[1]; 102 int8_t ru_tracefile[1]; 103 struct netauth ru_auth[1]; 104 } ripun; 105#define rip_nets ripun.ru_nets | 104 } au; 105}; 106 107struct rip { 108 u_int8_t rip_cmd; /* request/response */ 109 u_int8_t rip_vers; /* protocol version # */ 110 u_int16_t rip_res1; /* pad to 32-bit boundary */ 111 union { /* variable length... */ 112 struct netinfo ru_nets[1]; 113 int8_t ru_tracefile[1]; 114 struct netauth ru_auth[1]; 115 } ripun; 116#define rip_nets ripun.ru_nets |
117#define rip_auths ripun.ru_auth |
|
106#define rip_tracefile ripun.ru_tracefile 107}; 108 109/* Packet types. 110 */ 111#define RIPCMD_REQUEST 1 /* want info */ 112#define RIPCMD_RESPONSE 2 /* responding to request */ 113#define RIPCMD_TRACEON 3 /* turn tracing on */ --- 49 unchanged lines hidden --- | 118#define rip_tracefile ripun.ru_tracefile 119}; 120 121/* Packet types. 122 */ 123#define RIPCMD_REQUEST 1 /* want info */ 124#define RIPCMD_RESPONSE 2 /* responding to request */ 125#define RIPCMD_TRACEON 3 /* turn tracing on */ --- 49 unchanged lines hidden --- |