Statistics
| Branch: | Revision:

iof-bird-daemon / sysdep / linux / krt-sys.h @ e86cfd41

History | View | Annotate | Download (3.41 KB)

1
/*
2
 *        BIRD -- Linux Kernel Netlink Route Syncer
3
 *
4
 *        (c) 1998--2000 Martin Mares <mj@ucw.cz>
5
 *
6
 *        Can be freely distributed and used under the terms of the GNU GPL.
7
 */
8

    
9
#ifndef _BIRD_KRT_SYS_H_
10
#define _BIRD_KRT_SYS_H_
11

    
12

    
13
/* Kernel interfaces */
14

    
15
struct kif_params {
16
};
17

    
18
struct kif_state {
19
};
20

    
21

    
22
static inline void kif_sys_init(struct kif_proto *p UNUSED) { }
23
static inline int kif_sys_reconfigure(struct kif_proto *p UNUSED, struct kif_config *n UNUSED, struct kif_config *o UNUSED) { return 1; }
24

    
25
static inline void kif_sys_preconfig(struct config *c UNUSED) { }
26
static inline void kif_sys_postconfig(struct kif_config *c UNUSED) { }
27
static inline void kif_sys_init_config(struct kif_config *c UNUSED) { }
28
static inline void kif_sys_copy_config(struct kif_config *d UNUSED, struct kif_config *s UNUSED) { }
29

    
30
static inline struct ifa * kif_get_primary_ip(struct iface *i) { return NULL; }
31

    
32

    
33
/* Kernel routes */
34

    
35
#define EA_KRT_PREFSRC                EA_CODE(EAP_KRT, 0x10)
36
#define EA_KRT_REALM                EA_CODE(EAP_KRT, 0x11)
37

    
38

    
39
#define KRT_METRICS_MAX                0x10        /* RTAX_QUICKACK+1 */
40
#define KRT_METRICS_OFFSET        0x20        /* Offset of EA_KRT_* vs RTAX_* */
41

    
42
#define KRT_FEATURES_MAX        4
43

    
44
/*
45
 * Following attributes are parts of RTA_METRICS kernel route attribute, their
46
 * ids must be consistent with their RTAX_* constants (+ KRT_METRICS_OFFSET)
47
 */
48
#define EA_KRT_METRICS                EA_CODE(EAP_KRT, 0x20)        /* Dummy one */
49
#define EA_KRT_LOCK                EA_CODE(EAP_KRT, 0x21)
50
#define EA_KRT_MTU                EA_CODE(EAP_KRT, 0x22)
51
#define EA_KRT_WINDOW                EA_CODE(EAP_KRT, 0x23)
52
#define EA_KRT_RTT                EA_CODE(EAP_KRT, 0x24)
53
#define EA_KRT_RTTVAR                EA_CODE(EAP_KRT, 0x25)
54
#define EA_KRT_SSTRESH                EA_CODE(EAP_KRT, 0x26)
55
#define EA_KRT_CWND                EA_CODE(EAP_KRT, 0x27)
56
#define EA_KRT_ADVMSS                EA_CODE(EAP_KRT, 0x28)
57
#define EA_KRT_REORDERING         EA_CODE(EAP_KRT, 0x29)
58
#define EA_KRT_HOPLIMIT                EA_CODE(EAP_KRT, 0x2a)
59
#define EA_KRT_INITCWND                EA_CODE(EAP_KRT, 0x2b)
60
#define EA_KRT_FEATURES                EA_CODE(EAP_KRT, 0x2c)
61
#define EA_KRT_RTO_MIN                EA_CODE(EAP_KRT, 0x2d)
62
#define EA_KRT_INITRWND                EA_CODE(EAP_KRT, 0x2e)
63
#define EA_KRT_QUICKACK                EA_CODE(EAP_KRT, 0x2f)
64

    
65
/* Bits of EA_KRT_LOCK, also based on RTAX_* constants */
66
#define EA_KRT_LOCK_MTU                EA_KRT_LOCK | EA_BIT(0x2)
67
#define EA_KRT_LOCK_WINDOW        EA_KRT_LOCK | EA_BIT(0x3)
68
#define EA_KRT_LOCK_RTT                EA_KRT_LOCK | EA_BIT(0x4)
69
#define EA_KRT_LOCK_RTTVAR        EA_KRT_LOCK | EA_BIT(0x5)
70
#define EA_KRT_LOCK_SSTHRESH        EA_KRT_LOCK | EA_BIT(0x6)
71
#define EA_KRT_LOCK_CWND        EA_KRT_LOCK | EA_BIT(0x7)
72
#define EA_KRT_LOCK_ADVMSS        EA_KRT_LOCK | EA_BIT(0x8)
73
#define EA_KRT_LOCK_REORDERING         EA_KRT_LOCK | EA_BIT(0x9)
74
#define EA_KRT_LOCK_HOPLIMIT        EA_KRT_LOCK | EA_BIT(0xa)
75
// define EA_KRT_LOCK_INITCWND        EA_KRT_LOCK | EA_BIT(0xb)
76
// define EA_KRT_LOCK_FEATURES        EA_KRT_LOCK | EA_BIT(0xc)
77
#define EA_KRT_LOCK_RTO_MIN        EA_KRT_LOCK | EA_BIT(0xd)
78
// define EA_KRT_LOCK_INITRWND        EA_KRT_LOCK | EA_BIT(0xe)
79

    
80
/* Bits of EA_KRT_FEATURES, based on RTAX_FEATURE_* constants */
81
#define EA_KRT_FEATURE_ECN        EA_KRT_FEATURES | EA_BIT(0x0)
82
// define EA_KRT_FEATURE_SACK        EA_KRT_FEATURES | EA_BIT(0x1)
83
// define EA_KRT_FEATURE_TSTAMP        EA_KRT_FEATURES | EA_BIT(0x2)
84
#define EA_KRT_FEATURE_ALLFRAG        EA_KRT_FEATURES | EA_BIT(0x3)
85

    
86

    
87
struct krt_params {
88
  u32 table_id;                                /* Kernel table ID we sync with */
89
};
90

    
91
struct krt_state {
92
  struct krt_proto *hash_next;
93
};
94

    
95

    
96
static inline void krt_sys_init(struct krt_proto *p UNUSED) { }
97
static inline void krt_sys_preconfig(struct config *c UNUSED) { }
98
static inline void krt_sys_postconfig(struct krt_config *x UNUSED) { }
99

    
100

    
101
#endif