]>
Commit | Line | Data |
---|---|---|
95616c82 OZ |
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 | ||
c6964c30 | 18 | struct kif_state { |
95616c82 OZ |
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 | ||
e237b28a OZ |
30 | static inline struct ifa * kif_get_primary_ip(struct iface *i) { return NULL; } |
31 | ||
95616c82 OZ |
32 | |
33 | /* Kernel routes */ | |
34 | ||
f9f2e280 OZ |
35 | #define KRT_ALLOW_MERGE_PATHS 1 |
36 | ||
9fdf9d29 OZ |
37 | #define EA_KRT_PREFSRC EA_CODE(EAP_KRT, 0x10) |
38 | #define EA_KRT_REALM EA_CODE(EAP_KRT, 0x11) | |
39 | ||
40 | ||
41 | #define KRT_METRICS_MAX 0x10 /* RTAX_QUICKACK+1 */ | |
42 | #define KRT_METRICS_OFFSET 0x20 /* Offset of EA_KRT_* vs RTAX_* */ | |
43 | ||
44 | #define KRT_FEATURES_MAX 4 | |
45 | ||
46 | /* | |
47 | * Following attributes are parts of RTA_METRICS kernel route attribute, their | |
48 | * ids must be consistent with their RTAX_* constants (+ KRT_METRICS_OFFSET) | |
49 | */ | |
50 | #define EA_KRT_METRICS EA_CODE(EAP_KRT, 0x20) /* Dummy one */ | |
51 | #define EA_KRT_LOCK EA_CODE(EAP_KRT, 0x21) | |
52 | #define EA_KRT_MTU EA_CODE(EAP_KRT, 0x22) | |
53 | #define EA_KRT_WINDOW EA_CODE(EAP_KRT, 0x23) | |
54 | #define EA_KRT_RTT EA_CODE(EAP_KRT, 0x24) | |
55 | #define EA_KRT_RTTVAR EA_CODE(EAP_KRT, 0x25) | |
56 | #define EA_KRT_SSTRESH EA_CODE(EAP_KRT, 0x26) | |
57 | #define EA_KRT_CWND EA_CODE(EAP_KRT, 0x27) | |
58 | #define EA_KRT_ADVMSS EA_CODE(EAP_KRT, 0x28) | |
59 | #define EA_KRT_REORDERING EA_CODE(EAP_KRT, 0x29) | |
60 | #define EA_KRT_HOPLIMIT EA_CODE(EAP_KRT, 0x2a) | |
61 | #define EA_KRT_INITCWND EA_CODE(EAP_KRT, 0x2b) | |
62 | #define EA_KRT_FEATURES EA_CODE(EAP_KRT, 0x2c) | |
63 | #define EA_KRT_RTO_MIN EA_CODE(EAP_KRT, 0x2d) | |
64 | #define EA_KRT_INITRWND EA_CODE(EAP_KRT, 0x2e) | |
65 | #define EA_KRT_QUICKACK EA_CODE(EAP_KRT, 0x2f) | |
66 | ||
67 | /* Bits of EA_KRT_LOCK, also based on RTAX_* constants */ | |
68 | #define EA_KRT_LOCK_MTU EA_KRT_LOCK | EA_BIT(0x2) | |
69 | #define EA_KRT_LOCK_WINDOW EA_KRT_LOCK | EA_BIT(0x3) | |
70 | #define EA_KRT_LOCK_RTT EA_KRT_LOCK | EA_BIT(0x4) | |
71 | #define EA_KRT_LOCK_RTTVAR EA_KRT_LOCK | EA_BIT(0x5) | |
72 | #define EA_KRT_LOCK_SSTHRESH EA_KRT_LOCK | EA_BIT(0x6) | |
73 | #define EA_KRT_LOCK_CWND EA_KRT_LOCK | EA_BIT(0x7) | |
74 | #define EA_KRT_LOCK_ADVMSS EA_KRT_LOCK | EA_BIT(0x8) | |
75 | #define EA_KRT_LOCK_REORDERING EA_KRT_LOCK | EA_BIT(0x9) | |
76 | #define EA_KRT_LOCK_HOPLIMIT EA_KRT_LOCK | EA_BIT(0xa) | |
77 | // define EA_KRT_LOCK_INITCWND EA_KRT_LOCK | EA_BIT(0xb) | |
78 | // define EA_KRT_LOCK_FEATURES EA_KRT_LOCK | EA_BIT(0xc) | |
79 | #define EA_KRT_LOCK_RTO_MIN EA_KRT_LOCK | EA_BIT(0xd) | |
80 | // define EA_KRT_LOCK_INITRWND EA_KRT_LOCK | EA_BIT(0xe) | |
81 | ||
82 | /* Bits of EA_KRT_FEATURES, based on RTAX_FEATURE_* constants */ | |
83 | #define EA_KRT_FEATURE_ECN EA_KRT_FEATURES | EA_BIT(0x0) | |
84 | // define EA_KRT_FEATURE_SACK EA_KRT_FEATURES | EA_BIT(0x1) | |
85 | // define EA_KRT_FEATURE_TSTAMP EA_KRT_FEATURES | EA_BIT(0x2) | |
86 | #define EA_KRT_FEATURE_ALLFRAG EA_KRT_FEATURES | EA_BIT(0x3) | |
87 | ||
88 | ||
95616c82 | 89 | struct krt_params { |
9ddbfbdd | 90 | u32 table_id; /* Kernel table ID we sync with */ |
95616c82 OZ |
91 | }; |
92 | ||
c6964c30 | 93 | struct krt_state { |
9ddbfbdd | 94 | struct krt_proto *hash_next; |
95616c82 OZ |
95 | }; |
96 | ||
97 | ||
98 | static inline void krt_sys_init(struct krt_proto *p UNUSED) { } | |
9ddbfbdd JMM |
99 | static inline void krt_sys_preconfig(struct config *c UNUSED) { } |
100 | static inline void krt_sys_postconfig(struct krt_config *x UNUSED) { } | |
95616c82 OZ |
101 | |
102 | ||
103 | #endif |