| 1 | /*
|
|---|
| 2 | ipr.h
|
|---|
| 3 |
|
|---|
| 4 | Copyright 1995 Philip Homburg
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | #ifndef IPR_H
|
|---|
| 8 | #define IPR_H
|
|---|
| 9 |
|
|---|
| 10 | typedef struct oroute
|
|---|
| 11 | {
|
|---|
| 12 | int ort_port;
|
|---|
| 13 | ipaddr_t ort_dest;
|
|---|
| 14 | ipaddr_t ort_subnetmask;
|
|---|
| 15 | int ort_dist;
|
|---|
| 16 | i32_t ort_pref;
|
|---|
| 17 | u32_t ort_mtu;
|
|---|
| 18 | ipaddr_t ort_gateway;
|
|---|
| 19 | time_t ort_exp_tim;
|
|---|
| 20 | time_t ort_timestamp;
|
|---|
| 21 | int ort_flags;
|
|---|
| 22 |
|
|---|
| 23 | struct oroute *ort_nextnw;
|
|---|
| 24 | struct oroute *ort_nextgw;
|
|---|
| 25 | struct oroute *ort_nextdist;
|
|---|
| 26 | } oroute_t;
|
|---|
| 27 |
|
|---|
| 28 | #define ORTD_UNREACHABLE 512
|
|---|
| 29 |
|
|---|
| 30 | #define ORTF_EMPTY 0
|
|---|
| 31 | #define ORTF_INUSE 1
|
|---|
| 32 | #define ORTF_STATIC 2
|
|---|
| 33 |
|
|---|
| 34 | typedef struct iroute
|
|---|
| 35 | {
|
|---|
| 36 | ipaddr_t irt_dest;
|
|---|
| 37 | ipaddr_t irt_gateway;
|
|---|
| 38 | ipaddr_t irt_subnetmask;
|
|---|
| 39 | int irt_dist;
|
|---|
| 40 | u32_t irt_mtu;
|
|---|
| 41 | int irt_port;
|
|---|
| 42 | int irt_flags;
|
|---|
| 43 | } iroute_t;
|
|---|
| 44 |
|
|---|
| 45 | #define IRTD_UNREACHABLE 512
|
|---|
| 46 |
|
|---|
| 47 | #define IRTF_EMPTY 0
|
|---|
| 48 | #define IRTF_INUSE 1
|
|---|
| 49 | #define IRTF_STATIC 2
|
|---|
| 50 |
|
|---|
| 51 | #define IPR_UNRCH_TIMEOUT (60L * HZ)
|
|---|
| 52 | #define IPR_TTL_TIMEOUT (60L * HZ)
|
|---|
| 53 | #define IPR_REDIRECT_TIMEOUT (20 * 60L * HZ)
|
|---|
| 54 | #define IPR_GW_DOWN_TIMEOUT (60L * HZ)
|
|---|
| 55 | #define IPR_MTU_TIMEOUT (10*60L * HZ) /* RFC-1191 */
|
|---|
| 56 |
|
|---|
| 57 | /* Prototypes */
|
|---|
| 58 |
|
|---|
| 59 | iroute_t *iroute_frag ARGS(( int port_nr, ipaddr_t dest ));
|
|---|
| 60 | int oroute_frag ARGS(( int port_nr, ipaddr_t dest, int ttl, size_t msgsize,
|
|---|
| 61 | ipaddr_t *nexthop ));
|
|---|
| 62 | void ipr_init ARGS(( void ));
|
|---|
| 63 | int ipr_get_iroute ARGS(( int ent_no, nwio_route_t *route_ent ));
|
|---|
| 64 | int ipr_add_iroute ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 65 | ipaddr_t gateway, int dist, int mtu, int static_route,
|
|---|
| 66 | iroute_t **route_p ));
|
|---|
| 67 | int ipr_del_iroute ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 68 | ipaddr_t gateway, int static_route ));
|
|---|
| 69 | void ipr_chk_itab ARGS(( int port_nr, ipaddr_t addr, ipaddr_t mask ));
|
|---|
| 70 | int ipr_get_oroute ARGS(( int ent_no, nwio_route_t *route_ent ));
|
|---|
| 71 | int ipr_add_oroute ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 72 | ipaddr_t gateway, time_t timeout, int dist, int mtu, int static_route,
|
|---|
| 73 | i32_t preference, oroute_t **route_p ));
|
|---|
| 74 | int ipr_del_oroute ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 75 | ipaddr_t gateway, int static_route ));
|
|---|
| 76 | void ipr_chk_otab ARGS(( int port_nr, ipaddr_t addr, ipaddr_t mask ));
|
|---|
| 77 | void ipr_gateway_down ARGS(( int port_nr, ipaddr_t gateway, time_t timeout ));
|
|---|
| 78 | void ipr_redirect ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 79 | ipaddr_t old_gateway, ipaddr_t new_gateway, time_t timeout ));
|
|---|
| 80 | void ipr_destunrch ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 81 | time_t timeout ));
|
|---|
| 82 | void ipr_ttl_exc ARGS(( int port_nr, ipaddr_t dest, ipaddr_t subnetmask,
|
|---|
| 83 | time_t timeout ));
|
|---|
| 84 | void ipr_mtu ARGS(( int port_nr, ipaddr_t dest, U16_t mtu, time_t timeout ));
|
|---|
| 85 |
|
|---|
| 86 | #endif /* IPR_H */
|
|---|
| 87 |
|
|---|
| 88 | /*
|
|---|
| 89 | * $PchId: ipr.h,v 1.8 2002/06/09 07:48:11 philip Exp $
|
|---|
| 90 | */
|
|---|