-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathopenvswitch.diff
283 lines (258 loc) · 11 KB
/
openvswitch.diff
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
diff --git a/openvswitch-2.3.0/lib/ovsdb-idl.h b/openvswitch-2.3.0/lib/ovsdb-idl.h
--- a/openvswitch-2.3.0/lib/ovsdb-idl.h
+++ b/openvswitch-2.3.0/lib/ovsdb-idl.h
@@ -41,6 +41,14 @@ struct ovsdb_idl_class;
struct ovsdb_idl_column;
struct ovsdb_idl_table_class;
struct uuid;
+#ifdef OPEN_CONTRAIL_CLIENT
+struct ovsdb_idl_row;
+struct ovsdb_idl_txn;
+
+typedef void (*idl_callback)(void *, int, struct ovsdb_idl_row *);
+typedef void (*txn_ack_callback)(void *, struct ovsdb_idl_txn *);
+bool ovsdb_idl_is_txn_success(struct ovsdb_idl_txn *);
+#endif
struct ovsdb_idl *ovsdb_idl_create(const char *remote,
const struct ovsdb_idl_class *,
diff --git a/openvswitch-2.3.0/lib/vtep-idl.c b/openvswitch-2.3.0/lib/vtep-idl.c
--- a/openvswitch-2.3.0/lib/vtep-idl.c
+++ b/openvswitch-2.3.0/lib/vtep-idl.c
@@ -3327,6 +3327,10 @@ vteprec_physical_locator_set_unparse_loc
ovs_assert(inited);
free(row->locators);
+#ifdef OPEN_CONTRAIL_CLIENT
+ row->locators = NULL;
+ row->n_locators = 0;
+#endif
}
static void
@@ -3636,7 +3640,9 @@ void
vteprec_physical_port_verify_port_fault_status(const struct vteprec_physical_port *row)
{
ovs_assert(inited);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS]);
+#endif
}
void
@@ -3719,7 +3725,11 @@ vteprec_physical_port_get_port_fault_sta
enum ovsdb_atomic_type key_type OVS_UNUSED)
{
ovs_assert(key_type == OVSDB_TYPE_STRING);
+#ifndef OPEN_CONTRAIL_CLIENT
return ovsdb_idl_read(&row->header_, &vteprec_physical_port_col_port_fault_status);
+#else
+ return NULL;
+#endif
}
/* Returns the vlan_bindings column's value in 'row' as a struct ovsdb_datum.
@@ -3816,7 +3826,9 @@ vteprec_physical_port_set_port_fault_sta
datum.keys[i].string = xstrdup(port_fault_status[i]);
}
ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_write(&row->header_, &vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS], &datum);
+#endif
}
void
@@ -3886,6 +3898,7 @@ vteprec_physical_port_columns_init(void)
c->parse = vteprec_physical_port_parse_name;
c->unparse = vteprec_physical_port_unparse_name;
+#ifndef OPEN_CONTRAIL_CLIENT
/* Initialize vteprec_physical_port_col_port_fault_status. */
c = &vteprec_physical_port_col_port_fault_status;
c->name = "port_fault_status";
@@ -3897,6 +3910,7 @@ vteprec_physical_port_columns_init(void)
c->mutable = true;
c->parse = vteprec_physical_port_parse_port_fault_status;
c->unparse = vteprec_physical_port_unparse_port_fault_status;
+#endif
/* Initialize vteprec_physical_port_col_vlan_bindings. */
c = &vteprec_physical_port_col_vlan_bindings;
@@ -4185,7 +4199,9 @@ void
vteprec_physical_switch_verify_switch_fault_status(const struct vteprec_physical_switch *row)
{
ovs_assert(inited);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS]);
+#endif
}
void
@@ -4199,7 +4215,9 @@ void
vteprec_physical_switch_verify_tunnels(const struct vteprec_physical_switch *row)
{
ovs_assert(inited);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_verify(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS]);
+#endif
}
/* Returns the description column's value in 'row' as a struct ovsdb_datum.
@@ -4314,7 +4332,11 @@ vteprec_physical_switch_get_switch_fault
enum ovsdb_atomic_type key_type OVS_UNUSED)
{
ovs_assert(key_type == OVSDB_TYPE_STRING);
+#ifndef OPEN_CONTRAIL_CLIENT
return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_switch_fault_status);
+#else
+ return NULL;
+#endif
}
/* Returns the tunnel_ips column's value in 'row' as a struct ovsdb_datum.
@@ -4360,7 +4382,11 @@ vteprec_physical_switch_get_tunnels(cons
enum ovsdb_atomic_type key_type OVS_UNUSED)
{
ovs_assert(key_type == OVSDB_TYPE_UUID);
+#ifndef OPEN_CONTRAIL_CLIENT
return ovsdb_idl_read(&row->header_, &vteprec_physical_switch_col_tunnels);
+#else
+ return NULL;
+#endif
}
void
@@ -4439,7 +4465,9 @@ vteprec_physical_switch_set_switch_fault
datum.keys[i].string = xstrdup(switch_fault_status[i]);
}
ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_VOID);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS], &datum);
+#endif
}
void
@@ -4473,7 +4501,9 @@ vteprec_physical_switch_set_tunnels(cons
datum.keys[i].uuid = tunnels[i]->header_.uuid;
}
ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_UUID, OVSDB_TYPE_VOID);
+#ifndef OPEN_CONTRAIL_CLIENT
ovsdb_idl_txn_write(&row->header_, &vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS], &datum);
+#endif
}
struct ovsdb_idl_column vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_N_COLUMNS];
@@ -4532,6 +4562,7 @@ vteprec_physical_switch_columns_init(voi
c->parse = vteprec_physical_switch_parse_ports;
c->unparse = vteprec_physical_switch_unparse_ports;
+#ifndef OPEN_CONTRAIL_CLIENT
/* Initialize vteprec_physical_switch_col_switch_fault_status. */
c = &vteprec_physical_switch_col_switch_fault_status;
c->name = "switch_fault_status";
@@ -4543,6 +4574,7 @@ vteprec_physical_switch_columns_init(voi
c->mutable = true;
c->parse = vteprec_physical_switch_parse_switch_fault_status;
c->unparse = vteprec_physical_switch_unparse_switch_fault_status;
+#endif
/* Initialize vteprec_physical_switch_col_tunnel_ips. */
c = &vteprec_physical_switch_col_tunnel_ips;
@@ -4556,6 +4588,7 @@ vteprec_physical_switch_columns_init(voi
c->parse = vteprec_physical_switch_parse_tunnel_ips;
c->unparse = vteprec_physical_switch_unparse_tunnel_ips;
+#ifndef OPEN_CONTRAIL_CLIENT
/* Initialize vteprec_physical_switch_col_tunnels. */
c = &vteprec_physical_switch_col_tunnels;
c->name = "tunnels";
@@ -4568,6 +4601,7 @@ vteprec_physical_switch_columns_init(voi
c->mutable = true;
c->parse = vteprec_physical_switch_parse_tunnels;
c->unparse = vteprec_physical_switch_unparse_tunnels;
+#endif
}
/* Tunnel table. */
@@ -5890,12 +5924,14 @@ vteprec_ucast_macs_remote_columns_init(v
}
struct ovsdb_idl_table_class vteprec_table_classes[VTEPREC_N_TABLES] = {
+#ifndef OPEN_CONTRAIL_CLIENT
{"Arp_Sources_Local", true,
vteprec_arp_sources_local_columns, ARRAY_SIZE(vteprec_arp_sources_local_columns),
sizeof(struct vteprec_arp_sources_local), vteprec_arp_sources_local_init__},
{"Arp_Sources_Remote", true,
vteprec_arp_sources_remote_columns, ARRAY_SIZE(vteprec_arp_sources_remote_columns),
sizeof(struct vteprec_arp_sources_remote), vteprec_arp_sources_remote_init__},
+#endif
{"Global", true,
vteprec_global_columns, ARRAY_SIZE(vteprec_global_columns),
sizeof(struct vteprec_global), vteprec_global_init__},
@@ -5929,9 +5965,11 @@ struct ovsdb_idl_table_class vteprec_tab
{"Physical_Switch", false,
vteprec_physical_switch_columns, ARRAY_SIZE(vteprec_physical_switch_columns),
sizeof(struct vteprec_physical_switch), vteprec_physical_switch_init__},
+#ifndef OPEN_CONTRAIL_CLIENT
{"Tunnel", false,
vteprec_tunnel_columns, ARRAY_SIZE(vteprec_tunnel_columns),
sizeof(struct vteprec_tunnel), vteprec_tunnel_init__},
+#endif
{"Ucast_Macs_Local", true,
vteprec_ucast_macs_local_columns, ARRAY_SIZE(vteprec_ucast_macs_local_columns),
sizeof(struct vteprec_ucast_macs_local), vteprec_ucast_macs_local_init__},
diff --git a/openvswitch-2.3.0/lib/vtep-idl.h b/openvswitch-2.3.0/lib/vtep-idl.h
--- a/openvswitch-2.3.0/lib/vtep-idl.h
+++ b/openvswitch-2.3.0/lib/vtep-idl.h
@@ -704,14 +704,18 @@ struct vteprec_physical_port {
enum {
VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION,
VTEPREC_PHYSICAL_PORT_COL_NAME,
+#ifndef OPEN_CONTRAIL_CLIENT
VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS,
+#endif
VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS,
VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS,
VTEPREC_PHYSICAL_PORT_N_COLUMNS
};
#define vteprec_physical_port_col_name (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_NAME])
+#ifndef OPEN_CONTRAIL_CLIENT
#define vteprec_physical_port_col_port_fault_status (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_PORT_FAULT_STATUS])
+#endif
#define vteprec_physical_port_col_vlan_bindings (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_BINDINGS])
#define vteprec_physical_port_col_vlan_stats (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_VLAN_STATS])
#define vteprec_physical_port_col_description (vteprec_physical_port_columns[VTEPREC_PHYSICAL_PORT_COL_DESCRIPTION])
@@ -792,18 +796,26 @@ enum {
VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS,
VTEPREC_PHYSICAL_SWITCH_COL_NAME,
VTEPREC_PHYSICAL_SWITCH_COL_PORTS,
+#ifndef OPEN_CONTRAIL_CLIENT
VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS,
+#endif
VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS,
+#ifndef OPEN_CONTRAIL_CLIENT
VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS,
+#endif
VTEPREC_PHYSICAL_SWITCH_N_COLUMNS
};
#define vteprec_physical_switch_col_management_ips (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_MANAGEMENT_IPS])
#define vteprec_physical_switch_col_description (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_DESCRIPTION])
#define vteprec_physical_switch_col_tunnel_ips (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNEL_IPS])
+#ifndef OPEN_CONTRAIL_CLIENT
#define vteprec_physical_switch_col_switch_fault_status (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_SWITCH_FAULT_STATUS])
+#endif
#define vteprec_physical_switch_col_ports (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_PORTS])
+#ifndef OPEN_CONTRAIL_CLIENT
#define vteprec_physical_switch_col_tunnels (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_TUNNELS])
+#endif
#define vteprec_physical_switch_col_name (vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_COL_NAME])
extern struct ovsdb_idl_column vteprec_physical_switch_columns[VTEPREC_PHYSICAL_SWITCH_N_COLUMNS];
@@ -1070,8 +1082,10 @@ void vteprec_ucast_macs_remote_set_logic
enum {
+#ifndef OPEN_CONTRAIL_CLIENT
VTEPREC_TABLE_ARP_SOURCES_LOCAL,
VTEPREC_TABLE_ARP_SOURCES_REMOTE,
+#endif
VTEPREC_TABLE_GLOBAL,
VTEPREC_TABLE_LOGICAL_BINDING_STATS,
VTEPREC_TABLE_LOGICAL_ROUTER,
@@ -1083,10 +1097,19 @@ enum {
VTEPREC_TABLE_PHYSICAL_LOCATOR_SET,
VTEPREC_TABLE_PHYSICAL_PORT,
VTEPREC_TABLE_PHYSICAL_SWITCH,
+#ifndef OPEN_CONTRAIL_CLIENT
VTEPREC_TABLE_TUNNEL,
+#endif
VTEPREC_TABLE_UCAST_MACS_LOCAL,
VTEPREC_TABLE_UCAST_MACS_REMOTE,
+#ifdef OPEN_CONTRAIL_CLIENT
+ VTEPREC_N_TABLES,
+ VTEPREC_TABLE_ARP_SOURCES_LOCAL,
+ VTEPREC_TABLE_ARP_SOURCES_REMOTE,
+ VTEPREC_TABLE_TUNNEL
+#else
VTEPREC_N_TABLES
+#endif
};
#define vteprec_table_mcast_macs_remote (vteprec_table_classes[VTEPREC_TABLE_MCAST_MACS_REMOTE])