44 uint32_t svp_size;
45 uint32_t svp_id;
46 uint32_t svp_crc32;
47 } svp_req_t;
48
49 typedef enum svp_op {
50 SVP_R_UNKNOWN = 0x00,
51 SVP_R_PING = 0x01,
52 SVP_R_PONG = 0x02,
53 SVP_R_VL2_REQ = 0x03,
54 SVP_R_VL2_ACK = 0x04,
55 SVP_R_VL3_REQ = 0x05,
56 SVP_R_VL3_ACK = 0x06,
57 SVP_R_BULK_REQ = 0x07,
58 SVP_R_BULK_ACK = 0x08,
59 SVP_R_LOG_REQ = 0x09,
60 SVP_R_LOG_ACK = 0x0A,
61 SVP_R_LOG_RM = 0x0B,
62 SVP_R_LOG_RM_ACK = 0x0C,
63 SVP_R_SHOOTDOWN = 0x0D,
64 SVP_R_REMOTE_VL3_REQ = 0x0E,
65 SVP_R_REMOTE_VL3_ACK = 0x0F
66 } svp_op_t;
67
68 typedef enum svp_status {
69 SVP_S_OK = 0x00, /* Everything OK */
70 SVP_S_FATAL = 0x01, /* Fatal error, close connection */
71 SVP_S_NOTFOUND = 0x02, /* Entry not found */
72 SVP_S_BADL3TYPE = 0x03, /* Unknown svp_vl3_type_t */
73 SVP_S_BADBULK = 0x04 /* Unknown svp_bulk_type_t */
74 } svp_status_t;
75
76 /*
77 * A client issues the SVP_R_VL2_REQ whenever it needs to perform a VLS->UL3
78 * lookup. Requests have the following structure:
79 */
80 typedef struct svp_vl2_req {
81 uint8_t sl2r_mac[ETHERADDRL];
82 uint8_t sl2r_pad[2];
83 uint32_t sl2r_vnetid;
84 } svp_vl2_req_t;
85
86 /*
87 * This is the message a server uses to reply to the SVP_R_VL2_REQ. If the
88 * destination on the underlay is an IPv4 address, it should be encoded as an
89 * IPv4-mapped IPv6 address.
90 */
91 typedef struct svp_vl2_ack {
92 uint16_t sl2a_status;
93 uint16_t sl2a_port;
94 uint8_t sl2a_addr[16];
95 } svp_vl2_ack_t;
96
97
107 } svp_vl3_type_t;
108
109 typedef struct svp_vl3_req {
110 uint8_t sl3r_ip[16];
111 uint32_t sl3r_type;
112 uint32_t sl3r_vnetid;
113 } svp_vl3_req_t;
114
115 /*
116 * This response, corresponding to the SVP_R_VL3_ACK, includes an answer to both
117 * the VL3->VL2 and the VL2->UL3 requests.
118 */
119 typedef struct svp_vl3_ack {
120 uint32_t sl3a_status;
121 uint8_t sl3a_mac[ETHERADDRL];
122 uint16_t sl3a_uport;
123 uint8_t sl3a_uip[16];
124 } svp_vl3_ack_t;
125
126 /*
127 * A client issues the SVP_R_REMOTE_VL3_REQ for a far-remote (cross-DC) VL3 IP
128 * address. The server may take longer because it may query cross-DC to get
129 * the answer for our response.
130 */
131 typedef struct svp_rvl3_req {
132 uint8_t srl3r_srcip[16];
133 uint8_t srl3r_dstip[16];
134 uint32_t srl3r_type; /* Same as SVP_R_VL3_REQ */
135 uint32_t srl3r_vnetid;
136 uint16_t srl3r_vlan;
137 uint16_t srl3r_pad; /* XXX KEBE ASKS, necessary? */
138 } svp_rvl3_req_t;
139
140 /*
141 * The remote-VL3 response contains more than the regular VL3 one, because
142 * overlay needs to rewrite the MAC header completely.
143 */
144 typedef struct svp_rvl3_ack {
145 uint32_t srl3a_status;
146 uint8_t srl3a_dstmac[ETHERADDRL]; /* MAC of the target. */
147 uint8_t srl3a_srcmac[ETHERADDRL]; /* MAC of the target's rtr */
148 uint16_t srl3a_vlanid;
149 uint16_t srl3a_uport;
150 uint32_t srl3a_dcid; /* Remote Data Center ID. */
151 uint8_t srl3a_uip[16];
152 } svp_rvl3_ack_t;
153
154 /*
155 * SVP_R_BULK_REQ requests a bulk dump of data. Currently we have two kinds of
156 * data tables that we need to dump: VL3->VL2 mappings and VL2->UL3 mappings.
157 * The kind that we want is indicated using the svbr_type member.
158 */
159 typedef enum svp_bulk_type {
160 SVP_BULK_VL2 = 0x01,
161 SVP_BULK_VL3 = 0x02
162 } svp_bulk_type_t;
163
164 typedef struct svp_bulk_req {
165 uint32_t svbr_type;
166 } svp_bulk_req_t;
167
168 /*
169 * When replying to a bulk request (SVP_R_BULK_ACK), data is streamed back
170 * across. The format of the data is currently undefined and as we work on the
171 * system, we'll get a better understanding of what this should look like. A
172 * client may need to stream such a request to disk, or the format will need to
173 * be in a streamable format that allows the client to construct data.
174 */
244 */
245 typedef struct svp_lrm_ack {
246 uint32_t svra_status;
247 } svp_lrm_ack_t;
248
249 /*
250 * A shootdown (SVP_R_SHOOTDOWN) is used by a CN to reply to another CN that it
251 * sent an invalid entry that could not be processed. This should be a
252 * relatively infrequent occurrence. Unlike the rest of the messages, there is
253 * no reply to it. It's a single request to try and help get us out there. When
254 * a node receives this, it will issue a conditional revocation ioctl, that
255 * removes the entry if and only if, it matches the IP. That way if we've
256 * already gotten an updated entry for this, we don't remove it again.
257 */
258 typedef struct svp_shootdown {
259 uint8_t svsd_mac[ETHERADDRL];
260 uint8_t svsd_pad[2];
261 uint32_t svsd_vnetid;
262 } svp_shootdown_t;
263
264 #ifdef __cplusplus
265 }
266 #endif
267
268 #endif /* _LIBVARPD_SVP_PROT_H */
|
44 uint32_t svp_size;
45 uint32_t svp_id;
46 uint32_t svp_crc32;
47 } svp_req_t;
48
49 typedef enum svp_op {
50 SVP_R_UNKNOWN = 0x00,
51 SVP_R_PING = 0x01,
52 SVP_R_PONG = 0x02,
53 SVP_R_VL2_REQ = 0x03,
54 SVP_R_VL2_ACK = 0x04,
55 SVP_R_VL3_REQ = 0x05,
56 SVP_R_VL3_ACK = 0x06,
57 SVP_R_BULK_REQ = 0x07,
58 SVP_R_BULK_ACK = 0x08,
59 SVP_R_LOG_REQ = 0x09,
60 SVP_R_LOG_ACK = 0x0A,
61 SVP_R_LOG_RM = 0x0B,
62 SVP_R_LOG_RM_ACK = 0x0C,
63 SVP_R_SHOOTDOWN = 0x0D,
64 SVP_R_ROUTE_REQ = 0x0E,
65 SVP_R_ROUTE_ACK = 0x0F
66 } svp_op_t;
67
68 typedef enum svp_status {
69 SVP_S_OK = 0x00, /* Everything OK */
70 SVP_S_FATAL = 0x01, /* Fatal error, close connection */
71 SVP_S_NOTFOUND = 0x02, /* Entry not found */
72 SVP_S_BADL3TYPE = 0x03, /* Unknown svp_vl3_type_t */
73 SVP_S_BADBULK = 0x04 /* Unknown svp_bulk_type_t */
74 } svp_status_t;
75
76 /*
77 * A client issues the SVP_R_VL2_REQ whenever it needs to perform a VL2->UL3
78 * lookup. Requests have the following structure:
79 */
80 typedef struct svp_vl2_req {
81 uint8_t sl2r_mac[ETHERADDRL];
82 uint8_t sl2r_pad[2];
83 uint32_t sl2r_vnetid;
84 } svp_vl2_req_t;
85
86 /*
87 * This is the message a server uses to reply to the SVP_R_VL2_REQ. If the
88 * destination on the underlay is an IPv4 address, it should be encoded as an
89 * IPv4-mapped IPv6 address.
90 */
91 typedef struct svp_vl2_ack {
92 uint16_t sl2a_status;
93 uint16_t sl2a_port;
94 uint8_t sl2a_addr[16];
95 } svp_vl2_ack_t;
96
97
107 } svp_vl3_type_t;
108
109 typedef struct svp_vl3_req {
110 uint8_t sl3r_ip[16];
111 uint32_t sl3r_type;
112 uint32_t sl3r_vnetid;
113 } svp_vl3_req_t;
114
115 /*
116 * This response, corresponding to the SVP_R_VL3_ACK, includes an answer to both
117 * the VL3->VL2 and the VL2->UL3 requests.
118 */
119 typedef struct svp_vl3_ack {
120 uint32_t sl3a_status;
121 uint8_t sl3a_mac[ETHERADDRL];
122 uint16_t sl3a_uport;
123 uint8_t sl3a_uip[16];
124 } svp_vl3_ack_t;
125
126 /*
127 * SVP_R_BULK_REQ requests a bulk dump of data. Currently we have two kinds of
128 * data tables that we need to dump: VL3->VL2 mappings and VL2->UL3 mappings.
129 * The kind that we want is indicated using the svbr_type member.
130 */
131 typedef enum svp_bulk_type {
132 SVP_BULK_VL2 = 0x01,
133 SVP_BULK_VL3 = 0x02
134 } svp_bulk_type_t;
135
136 typedef struct svp_bulk_req {
137 uint32_t svbr_type;
138 } svp_bulk_req_t;
139
140 /*
141 * When replying to a bulk request (SVP_R_BULK_ACK), data is streamed back
142 * across. The format of the data is currently undefined and as we work on the
143 * system, we'll get a better understanding of what this should look like. A
144 * client may need to stream such a request to disk, or the format will need to
145 * be in a streamable format that allows the client to construct data.
146 */
216 */
217 typedef struct svp_lrm_ack {
218 uint32_t svra_status;
219 } svp_lrm_ack_t;
220
221 /*
222 * A shootdown (SVP_R_SHOOTDOWN) is used by a CN to reply to another CN that it
223 * sent an invalid entry that could not be processed. This should be a
224 * relatively infrequent occurrence. Unlike the rest of the messages, there is
225 * no reply to it. It's a single request to try and help get us out there. When
226 * a node receives this, it will issue a conditional revocation ioctl, that
227 * removes the entry if and only if, it matches the IP. That way if we've
228 * already gotten an updated entry for this, we don't remove it again.
229 */
230 typedef struct svp_shootdown {
231 uint8_t svsd_mac[ETHERADDRL];
232 uint8_t svsd_pad[2];
233 uint32_t svsd_vnetid;
234 } svp_shootdown_t;
235
236 /*
237 * A route-request (SVP_R_ROUTE_REQ) queries the local SVP server to get a
238 * far-remote (i.e. another Triton Data Center, nee. SDC) SVP server for
239 * far-remote networks. Modern overlay modules will request IP destinations
240 * for remote-Triton networks, but they must know how to reach the
241 * remote-Triton SVP server.
242 */
243 typedef struct svp_route_req {
244 uint32_t srr_vnetid; /* Requester's vnet ID. */
245 uint16_t srr_vlan; /* Requester's VLAN ID. */
246 uint16_t srr_pad; /* Zero on xmit, ignore on receipt. */
247 uint8_t srr_srcip[16]; /* VL3 Source IP. */
248 uint8_t srr_dstip[16]; /* VL3 Destination IP. */
249 } svp_route_req_t;
250
251 /*
252 * The far-remote Triton Data Center will answer with the requisite information
253 * to send overlay packets to the appropriate far-remote CNs.
254 */
255 typedef struct svp_route_ack {
256 uint32_t sra_status; /* Status. */
257 uint32_t sra_dcid; /* Far-remote Data Center ID. */
258 uint32_t sra_vnetid; /* Far-remote vnet ID. */
259 uint16_t sra_vlan; /* Far-remote VLAN ID. */
260 uint16_t sra_port; /* Destination UL3 port. */
261 uint8_t sra_ip[16]; /* Destination UL3 address. */
262 uint8_t sra_srcmac[ETHERADDRL]; /* Far-remote VL2 source. */
263 uint8_t sra_dstmac[ETHERADDRL]; /* Far-remote VL2 dest. */
264 uint8_t sra_src_pfx; /* Far-remote VL3 source prefix */
265 uint8_t sra_dst_pfx; /* Far-remote VL3 dest. prefix */
266 } svp_route_ack_t;
267
268 #ifdef __cplusplus
269 }
270 #endif
271
272 #endif /* _LIBVARPD_SVP_PROT_H */
|