1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/****************************************************************************
** File: rip.h
**
** Author: Mike Borella
**
** Comments: Structure of RIP packets
**
*****************************************************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define RIP_CMD_RQ 1
#define RIP_CMD_RP 2
#define RIP_CMD_POLL 5
#define RIP_CMD_POLL_ENTRY 6
/*
* Static part of RIP header
*/
typedef struct _RipHdr
{
#if defined(WORDS_BIGENDIAN)
u_int16_t domain;
u_int8_t version;
u_int8_t command;
#else
u_int8_t command;
u_int8_t version;
u_int16_t domain;
#endif
} RipHdr;
/*
* RIP route header
*/
typedef struct _RipRouteHdr
{
u_int16_t addr_fam;
u_int16_t route_tag;
struct in_addr ipaddr;
struct in_addr netmask;
struct in_addr next_hop;
u_int32_t metric;
} RipRouteHdr;
/*
* RIP authentication header
*/
typedef struct _RipAuthHdr
{
u_int16_t addr_fam;
u_int16_t type;
char passwd [16];
} RipAuthHdr;
void dump_rip(u_char *bp, int length);
|