aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/mma_template.c
blob: e66f2919720c883ca74d1b734fe9e62f2bbf02c1 (plain)
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
/*
 * Copyright (c) 2017-2019 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

#include <vppinfra/error.h>

u8 RT (rule_is_exact_match) (RTT (mma_rule) * key, RTT (mma_rule) * r)
{
  int i;

  for (i = 0; i < ARRAY_LEN (key->match.as_u64); i++)
    {
      if (key->match.as_u64[i] != r->match.as_u64[i])
	return 0;
    }
  for (i = 0; i < ARRAY_LEN (key->mask.as_u64); i++)
    {
      if (key->mask.as_u64[i] != r->mask.as_u64[i])
	return 0;
    }
  return 1;
}

u8
RT (rule_is_match_for_key) (RTT (mma_mask_or_match) * key, RTT (mma_rule) * r)
{
  RTT (mma_mask_or_match) _tmp_key, *tkp = &_tmp_key;
  int i;

  *tkp = *key;
  for (i = 0; i < ARRAY_LEN (tkp->as_u64); i++)
    tkp->as_u64[i] &= r->mask.as_u64[i];
  for (i = 0; i < ARRAY_LEN (tkp->as_u64); i++)
    {
      if (tkp->as_u64[i] != r->match.as_u64[i])
	return 0;
    }
  return 1;
}

RTT (mma_rule) * RT (mma_rules_table_rule_alloc) (RTT (mma_rules_table) * srt)
{
  RTT (mma_rule) * rule;
  pool_get (srt->rules, rule);
  clib_memset (rule, 0, sizeof (*rule));
  return rule;
}

RTT (mma_rule) *
RT (mma_rule_free) (RTT (mma_rules_table) * srt, RTT (mma_rule) * rule)
{
  pool_put (srt->rules, rule);
  clib_memset (rule, 0xfa, sizeof (*rule));
  return rule;
}

RTT (mma_rule) *
RT (mma_rules_table_get_rule) (RTT (mma_rules_table) * srt, u32 srt_index)
{
  if (!pool_is_free_index (srt->rules, srt_index))
    return (srt->rules + srt_index);
  return 0;
}

u32
RT (mma_rules_table_rule_index) (RTT (mma_rules_table) * srt,
				 RTT (mma_rule) * sr)
{
  ASSERT (sr);
  return (sr - srt->rules);
}

/**
 * Lookup key in table
 *
 * This should be optimized .. eventually
 */
u32
RT (mma_rules_table_lookup) (RTT (mma_rules_table) * srt,
			     RTT (mma_mask_or_match) * key, u32 rule_index)
{
  RTT (mma_rule) * rp;
  u32 rv;
  int i;

  ASSERT (rule_index != MMA_TABLE_INVALID_INDEX);
  rp = RT (mma_rules_table_get_rule) (srt, rule_index);
  ASSERT (rp);

  if (!RT (rule_is_match_for_key) (key, rp))
    return MMA_TABLE_INVALID_INDEX;
  for (i = 0; i < vec_len (rp->next_indices); i++)
    {
      rv = RT (mma_rules_table_lookup) (srt, key, rp->next_indices[i]);
      if (rv != MMA_TABLE_INVALID_INDEX)
	return (rv);
    }
  return (rp->action_index);
}

u32
RT (mma_rules_table_lookup_rule) (RTT (mma_rules_table) * srt,
				  RTT (mma_mask_or_match) * key,
				  u32 rule_index)
{
  RTT (mma_rule) * rp;
  u32 rv;
  int i;

  ASSERT (rule_index != MMA_TABLE_INVALID_INDEX);
  rp = RT (mma_rules_table_get_rule) (srt, rule_index);
  ASSERT (rp);

  if (!RT (rule_is_match_for_key) (key, rp))
    return MMA_TABLE_INVALID_INDEX;
  for (i = 0; i < vec_len (rp->next_indices); i++)
    {
      rv = RT (mma_rules_table_lookup_rule) (srt, key, rp->next_indices[i]);
      if (rv != MMA_TABLE_INVALID_INDEX)
	return (rv);
    }
  return rule_index;
}

static
RTT (mma_rules_table) *
RTT (sort_srt);

     int RT (mma_sort_indices) (void *e1, void *e2)
{
  u32 *ri1 = e1, *ri2 = e2;
  RTT (mma_rule) * rule1, *rule2;
  rule1 = RT (mma_rules_table_get_rule) (RTT (sort_srt), *ri1);
  rule2 = RT (mma_rules_table_get_rule) (RTT (sort_srt), *ri2);
  return RTT (sort_srt)->rule_cmp_fn (rule1, rule2);
}

void RT (mma_sort) (RTT (mma_rules_table) * srt, u32 * next_indices)
{
  RTT (sort_srt) = srt;
  vec_sort_with_function (next_indices, RT (mma_sort_indices));
}

int
RT (mma_rules_table_add_rule) (RTT (mma_rules_table) * srt,
			       RTT (mma_rule) * rule)
{
  u32 parent_index, i, *next_indices = 0, added = 0, rule_index;
  RTT (mma_rule) * parent, *child;

  rule_index = RT (mma_rules_table_rule_index) (srt, rule);
  parent_index = RT (mma_rules_table_lookup_rule) (srt, &rule->match,
						   srt->root_index);
  parent = RT (mma_rules_table_get_rule) (srt, parent_index);
  if (RT (rule_is_exact_match) (rule, parent))
    {
      parent->action_index = rule->action_index;
      RT (mma_rule_free) (srt, rule);
      return -1;
    }

  if (vec_len (parent->next_indices) == 0)
    {
      vec_add1 (parent->next_indices, rule_index);
      return 0;
    }

  /* Check if new rule is parent of some of the existing children */
  for (i = 0; i < vec_len (parent->next_indices); i++)
    {
      child = RT (mma_rules_table_get_rule) (srt, parent->next_indices[i]);
      if (RT (rule_is_match_for_key) (&child->match, rule))
	{
	  vec_add1 (rule->next_indices, parent->next_indices[i]);
	  if (!added)
	    {
	      vec_add1 (next_indices, rule_index);
	      added = 1;
	    }
	}
      else
	{
	  if (!added && srt->rule_cmp_fn (rule, child) < 0)
	    {
	      vec_add1 (next_indices, rule_index);
	      added = 1;
	    }
	  vec_add1 (next_indices, parent->next_indices[i]);
	}
    }
  if (!added)
    vec_add1 (next_indices, rule_index);
  vec_free (parent->next_indices);
  parent->next_indices = next_indices;
  return 0;
}

int
RT (mma_rules_table_del_rule) (RTT (mma_rules_table) * srt,
			       RTT (mma_rule) * rule, u32 rule_index)
{
  RTT (mma_rule) * rp;
  u32 rv;
  int i;

  ASSERT (rule_index != MMA_TABLE_INVALID_INDEX);
  rp = RT (mma_rules_table_get_rule) (srt, rule_index);

  if (!RT (rule_is_match_for_key) (&rule->match, rp))
    return MMA_TABLE_INVALID_INDEX;
  if (RT (rule_is_exact_match) (rule, rp))
    {
      if (rule_index == srt->root_index)
	rp->action_index = MMA_TABLE_INVALID_INDEX;
      return 1;
    }
  for (i = 0; i < vec_len (rp->next_indices); i++)
    {
      rv = RT (mma_rules_table_del_rule) (srt, rule, rp->next_indices[i]);
      if (rv == 1)
	{
	  RTT (mma_rule) * child;
	  u32 *next_indices = 0, *new_elts, left_to_add;
	  child = RT (mma_rules_table_get_rule) (srt, rp->next_indices[i]);
	  ASSERT (RT (rule_is_exact_match) (rule, child));

	  if (i != 0)
	    {
	      vec_add2 (next_indices, new_elts, i);
	      clib_memcpy_fast (new_elts, rp->next_indices, i * sizeof (u32));
	    }
	  if (vec_len (child->next_indices))
	    vec_append (next_indices, child->next_indices);
	  left_to_add = vec_len (rp->next_indices) - i - 1;
	  if (left_to_add)
	    {
	      vec_add2 (next_indices, new_elts, left_to_add);
	      clib_memcpy_fast (new_elts, &rp->next_indices[i + 1],
				left_to_add * sizeof (u32));
	    }
	  RT (mma_rule_free) (srt, child);
	  vec_free (rp->next_indices);
	  rp->next_indices = next_indices;
	  return 0;
	}
      else if (rv == 0)
	return rv;
    }
  return MMA_TABLE_INVALID_INDEX;
}

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
/span>, "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460539962712, "name": "List ifcs - cfg", "description": "List ifcs - cfg", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "2ca639f4-f4a4-07c7-9419-79fd66061458", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464804304987, "name": "Add sub interface - cfg", "description": "Adds sub interface. Corresponsing vpp cli command:\n\nvppctl create sub GigabitEthernet0/9/0 1 dot1q 100 inner-dot1q any\n\nTo verify run:\n./build-root/install-vpp-native/vpp-api-test/bin/vpp_api_test json\nand invoke:\n\n#vat sw_interface_dump", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "{\r\n \"sub-interface\": [\r\n {\r\n \"identifier\": \"1\",\r\n \"vlan-type\": \"802dot1q\",\r\n \"tags\": {\r\n \"tag\": [\r\n {\r\n \"index\": \"0\",\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:s-vlan\",\r\n \"vlan-id\": \"100\"\r\n }\r\n },\r\n {\r\n \"index\": \"1\",\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:c-vlan\",\r\n \"vlan-id\": \"any\"\r\n }\r\n }\r\n ]\r\n },\r\n \"match\": {\r\n \"vlan-tagged\": {\r\n \"match-exact-tags\": \"true\"\r\n }\r\n },\r\n \"enabled\": \"false\"\r\n }\r\n ]\r\n}" }, { "id": "2f1d8e0d-4961-4b7f-50ad-0210e52e59aa", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/v3po:vpp", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460540006597, "name": "Read vpp - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "3a93e78e-21ec-e0c9-94df-c69b60d9edcd", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/local0/ipv4", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1465473589796, "name": "Read local0/ipv4 - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "7a914134-23ea-3154-1557-d29dc8d464e7", "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "3f9588e4-885f-3792-bdf4-d0f10704ae4d", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/tapp", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462535811974, "name": "Add simple tap ifc -cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "60596aab-a4f1-bb64-d701-816de9482201", "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"tapp\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"v3po:tap\",\r\n \"tap\" :{\r\n \"tap-name\" : \"tapp\"\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "3fccc4cd-f14b-0333-83d5-924afe3938e4", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/local0", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460640004531, "name": "Set vrf id for local0 - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"local0\",\r\n \"description\": \"for testing purposes only\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"routing\" : {\r\n \"vrf-id\" : \"7\"\r\n },\r\n \"v3po:ethernet\": {\r\n \"mtu\": 64\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "44de3eff-ace5-90a9-dd16-af3f5f13daad", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1/l2/rewrite", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464805188780, "name": "Enable tag-rewrite translate 1-2 - cfg", "description": "Enables tag-rewrite translate 1-2 operation for GigabitEthernet0/9/0.1 sub-interface. Corresponsing vpp cli command:\n\nvppctl set interface l2 tag-rewrite GigabitEthernet0/9/0.1 translate 1-2 dot1q 111 222\n\nTo verify run:\n./build-root/install-vpp-native/vpp-api-test/bin/vpp_api_test json\nand invoke:\n\n#vat sw_interface_dump\n\nor if sub-interface was added to bridge domain:\n\nvppctl show bridge-domain [bd_id] detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "{\r\n \"rewrite\": {\r\n \"vlan-type\": \"vpp-vlan:802dot1q\",\r\n \"pop-tags\": \"1\",\r\n \"push-tags\": [\r\n {\r\n \"index\": 0,\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:s-vlan\",\r\n \"vlan-id\": 111\r\n }\r\n },\r\n {\r\n \"index\": 1,\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:c-vlan\",\r\n \"vlan-id\": 222\r\n }\r\n }\r\n ]\r\n }\r\n}" }, { "id": "4db9b360-0d57-6ce6-7e3c-a6acfe17d512", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/tapp2", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462796801468, "name": "Modify complex tap ifc - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"tapp2\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"v3po:tap\",\r\n \"tap\" :{\r\n \"tap-name\" : \"tapp2\",\r\n \"mac\" : \"00:ff:ff:ff:ff:ae\",\r\n \"device-instance\" : 77\r\n }\r\n }\r\n ]\r\n \r\n}", "folder": "60596aab-a4f1-bb64-d701-816de9482201" }, { "id": "4f15d0e9-8530-157e-0fe8-d24034bc31df", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun1", "preRequestScript": "", "pathVariables": {}, "method": "DELETE", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": "{}", "time": 1462892071867, "name": "Delete virtual ifc - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "3868e66d-0ee5-bd4d-6b35-075c4841b5c1", "timestamp": null, "rawModeData": "" }, { "id": "55102dbd-1fc9-5f91-2082-40a2dc311f4f", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/vhost1", "preRequestScript": "", "pathVariables": {}, "method": "DELETE", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": "{}", "time": 1462891488523, "name": "Delete vhost user ifc - cfg", "description": "Deletes vhost user interface.\nCorresponding vpp CLI command:\n\nvppctl delete vhost-user sw_if_index [index]\n\nTo verify invoke:\n\nvppctl show vhost-user\n\nor\n\nvppctl show int", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "c97b9ad9-64e6-5de3-09b8-851c1189d767", "rawModeData": "", "descriptionFormat": null }, { "id": "5995dcf7-51c0-42ef-448b-a70bb68735d5", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/tapp2", "preRequestScript": "", "pathVariables": {}, "method": "DELETE", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462796994090, "name": "Delete complex tap ifc - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "", "folder": "60596aab-a4f1-bb64-d701-816de9482201" }, { "id": "5dc1d9f4-e7ae-bb21-e558-8a56ac825922", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/operational/v3po:vpp-state", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460539994330, "name": "Read vpp-state - oper", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "6c5c9786-3619-ccaf-c276-0ada45711b70", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/operational/ietf-interfaces:interfaces-state/interface/local0/ipv4", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1465473594194, "name": "Read local0/ipv4 - oper", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "7a914134-23ea-3154-1557-d29dc8d464e7", "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "77383f38-941c-a136-99a6-91f9799a0b06", "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n", "url": "http://localhost:8181/restconf/config/v3po:vpp/bridge-domains/bridge-domain/testBD", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460540096743, "name": "Add bridge domain - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \"bridge-domain\": [\r\n {\r\n \"name\": \"testBD\",\r\n \"flood\": \"true\",\r\n \"forward\": \"false\",\r\n \"learn\": \"false\",\r\n \"unknown-unicast-flood\": \"false\",\r\n \"arp-termination\": \"false\"\r\n }\r\n ]\r\n}" }, { "id": "7f312f15-a81e-b513-83b7-a5f7755eae67", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/vhost1", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462891472552, "name": "Add vhost user ifc - cfg", "description": "Adds vhost-user interface.\nCorresponsing vpp cli command:\n\ncreate vhost-user socket /tmp/soc1 server\n\nTo verify invoke:\n\nvppctl show vhost-user\n\nor\n\nvppctl show int", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"vhost1\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"v3po:vhost-user\",\r\n \"enabled\": \"true\",\r\n \"vhost-user\" : {\r\n \"socket\": \"/tmp/soc1\",\r\n \"role\": \"server\"\r\n }\r\n }\r\n ]\r\n \r\n}", "folder": "c97b9ad9-64e6-5de3-09b8-851c1189d767" }, { "id": "86db54f1-a60b-98d4-2639-a845d1305141", "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/local0", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462534221488, "name": "Add local0 to bridge domain", "description": "Adds l2 interconnection of bridge-based type to local0 interface\n\nTo verify invoke:\n\nvppctl show bridge-domain [bd_id] detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\n \"interface\": [\n {\n \"name\": \"local0\",\n \"description\": \"for testing purposes\",\n \"type\": \"iana-if-type:ethernetCsmacd\",\n \"v3po:routing\": {\n \"vrf-id\": 7\n },\n \"v3po:ethernet\": {\n \"mtu\": 64\n },\n \"enabled\": true,\n \"v3po:l2\": {\n \"bridge-domain\": \"testBD\",\n \"split-horizon-group\": \"0\",\n \"bridged-virtual-interface\": \"false\"\n }\n }\n ]\n}" }, { "id": "8b339568-b60a-715f-d4fd-416bafe981a9", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1/l2/rewrite", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": "{}", "time": 1464803940412, "name": "Enable tag-rewrite push - cfg", "description": "Enables tag-rewrite push operation for GigabitEthernet0/9/0.1 sub-interface. Corresponsing vpp cli command:\n\nvppctl set interface l2 tag-rewrite GigabitEthernet0/9/0.1 push dot1q 123 456\n\nTo verify run:\n./build-root/install-vpp-native/vpp-api-test/bin/vpp_api_test json\nand invoke:\n\n#vat sw_interface_dump\n\nor if sub-interface was added to bridge domain:\n\nvppctl show bridge-domain [bd_id] detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "timestamp": null, "rawModeData": "{\r\n \"rewrite\": {\r\n \"vlan-type\": \"vpp-vlan:802dot1q\",\r\n \"push-tags\": [\r\n {\r\n \"index\": 0,\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:s-vlan\",\r\n \"vlan-id\": 123\r\n }\r\n },\r\n {\r\n \"index\": 1,\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:c-vlan\",\r\n \"vlan-id\": 456\r\n }\r\n }\r\n ]\r\n }\r\n}" }, { "id": "8b867c90-459f-68f6-4b2e-fa653098c28d", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/local0", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460540047356, "name": "Enable local0 interface - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"local0\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"v3po:ethernet\": {\r\n \"mtu\": 64\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "93022e97-24fa-5784-1e59-94674817215f", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/operational/naming-context:contexts", "pathVariables": {}, "preRequestScript": "", "method": "GET", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "data": [], "dataMode": "raw", "name": "List naming contexts - context", "description": "List mapping context stored in context datastore", "descriptionFormat": "html", "time": 1463556756647, "version": 2, "responses": [], "tests": "", "currentHelper": "normal", "helperAttributes": {}, "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "945138cf-d1f0-4674-b221-7b271010be42", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/operational/ietf-interfaces:interfaces-state/interface/local0", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1465472429324, "name": "Read local0 - oper", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "7a914134-23ea-3154-1557-d29dc8d464e7", "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "a95120a1-5661-edc4-30cf-53afeb104440", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/local0/ipv4", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1465472513661, "name": "Set ipv4 local0 interface - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "7a914134-23ea-3154-1557-d29dc8d464e7", "rawModeData": "{\r\n\r\n \"ipv4\" : {\r\n \"address\": [{\r\n \"ip\" : \"127.0.0.1\",\r\n \"prefix-length\" : \"24\"\r\n }]\r\n }\r\n}" }, { "id": "ac161bec-e046-4bb7-d695-60bdfb0c6cea", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/vhost1", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1462891483790, "name": "Modify vhost user ifc - cfg", "description": "Modifies vhost-user interface socket.\nTo verify invoke:\n\nvppctl show vhost-user", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"vhost1\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"v3po:vhost-user\",\r\n \"enabled\": \"true\",\r\n \"vhost-user\" : {\r\n \"socket\": \"/tmp/soc2\",\r\n \"role\": \"server\"\r\n }\r\n }\r\n ]\r\n \r\n}", "folder": "c97b9ad9-64e6-5de3-09b8-851c1189d767" }, { "id": "b08a0677-6b59-74ea-e5c6-7383194b19dd", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1/l2/rewrite", "preRequestScript": "", "pathVariables": {}, "method": "DELETE", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464804511683, "name": "Disable tag-rewrite - cfg", "description": "Disables tag-rewrite operation for GigabitEthernet0/9/0.1 sub-interface. Corresponsing vpp cli command:\n\nvppctl set interface l2 tag-rewrite GigabitEthernet0/9/0.1 disable\n\nTo verify run:\n./build-root/install-vpp-native/vpp-api-test/bin/vpp_api_test json\nand invoke:\n\n#vat sw_interface_dump\n\nor if sub-interface was added to bridge domain:\n\nvppctl show bridge-domain [bd_id] detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "" }, { "id": "bd2897c6-5fc7-bec5-87be-4fd52bb8e471", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1/l2/rewrite", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464805111410, "name": "Enable tag-rewrite pop 1 - cfg", "description": "Enables tag-rewrite pop 1 operation for GigabitEthernet0/9/0.1 sub-interface. Corresponsing vpp cli command:\n\nvppctl set interface l2 tag-rewrite GigabitEthernet0/9/0.1 pop 1\n\nTo verify run:\n./build-root/install-vpp-native/vpp-api-test/bin/vpp_api_test json\nand invoke:\n\n#vat sw_interface_dump\n\nor if sub-interface was added to bridge domain:\n\nvppctl show bridge-domain [bd_id] detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "{\r\n \"rewrite\": {\r\n \"pop-tags\": \"1\"\r\n }\r\n}" }, { "id": "cbb77318-52e0-5647-cd1c-8c679ea7b830", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1/l2", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464813539029, "name": "Add sub interface to bridge-domain", "description": "Adds sub interface to bridge domain. Corresponsing vpp cli command:\n\nvppctl set interface l2 bridge GigabitEthernet0/9/0.1 1 1\n\nTo verify invoke:\nvppctl show bridge-domain 1 detail", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "{\r\n \"l2\": {\r\n \"bridge-domain\": \"testBD\",\r\n \"split-horizon-group\": 1,\r\n \"bridged-virtual-interface\": \"false\"\r\n }\r\n}" }, { "id": "d27322b8-59d5-a2dc-a7a2-8f7197057164", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/operational/ietf-interfaces:interfaces-state/", "preRequestScript": "", "pathVariables": {}, "method": "GET", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460539972177, "name": "List ifcs - oper", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" }, { "id": "e611d23a-c205-192b-e8f9-dd99fa169274", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1460636113690, "name": "Set interfaces bulk edit - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\n \"interfaces\": {\n \"interface\": [\n {\n \"name\": \"pg/stream-2\",\n \"enabled\": true,\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n {\n \"name\": \"pg/stream-3\",\n \"enabled\": true,\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n {\n \"name\": \"pg/stream-0\",\n \"enabled\": true,\n \"type\": \"iana-if-type:ethernetCsmacd\"\n },\n {\n \"name\": \"local0\",\n \"description\": \"for testing purposes\",\n \"type\": \"iana-if-type:ethernetCsmacd\",\n \"enabled\": true\n },\n {\n \"name\": \"pg/stream-1\",\n \"enabled\": true,\n \"type\": \"iana-if-type:ethernetCsmacd\"\n }\n ]\n }\n}" }, { "id": "f014ab21-8e40-c344-a68b-0f1b86578bd8", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/vxlanTun1", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464767860505, "name": "Add virtual ifc - cfg", "description": "", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "rawModeData": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"vxlanTun1\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"v3po:vxlan-tunnel\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"routing\" : {\r\n \"vrf-id\" : \"0\"\r\n },\r\n \"vxlan\" : {\r\n \"src\" : \"192.168.1.6\",\r\n \"dst\" : \"192.168.1.9\",\r\n \"vni\" : \"88\",\r\n \"encap-vrf-id\" : \"0\"\r\n }\r\n }\r\n ]\r\n \r\n}", "folder": "3868e66d-0ee5-bd4d-6b35-075c4841b5c1" }, { "id": "f2e9a3cb-f3cc-f501-6015-8ebf7d8b2c3e", "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n", "url": "http://localhost:8181/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F9%2F0/vpp-vlan:sub-interfaces/sub-interface/1", "preRequestScript": "", "pathVariables": {}, "method": "PUT", "data": [], "dataMode": "raw", "version": 2, "tests": "", "currentHelper": "normal", "helperAttributes": {}, "time": 1464804333865, "name": "Enable GigabitEthernet0/9/0.1 interface - cfg", "description": "Enables GigabitEthernet0/9/0.1 sub interface. Equivalent vppctl command:\n\nvppctl set in state GigabitEthernet0/9/0.1 up\n\nTo enable sub interface, super interface should be enabled first.\n\nTo verify invoke:\n\nvppctl show int", "collectionId": "7c35192d-9085-20f6-9fcd-3f8570aaefd7", "responses": [], "folder": "37fd9569-06e3-1f08-fbcc-4b1462107a32", "rawModeData": "{\r\n \"sub-interface\": [\r\n {\r\n \"identifier\": \"1\",\r\n \"vlan-type\": \"802dot1q\",\r\n \"tags\": {\r\n \"tag\": [\r\n {\r\n \"index\": \"0\",\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:s-vlan\",\r\n \"vlan-id\": \"100\"\r\n }\r\n },\r\n {\r\n \"index\": \"1\",\r\n \"dot1q-tag\": {\r\n \"tag-type\": \"dot1q-types:c-vlan\",\r\n \"vlan-id\": \"any\"\r\n }\r\n }\r\n ]\r\n },\r\n \"match\": {\r\n \"vlan-tagged\": {\r\n \"match-exact-tags\": \"true\"\r\n }\r\n },\r\n \"enabled\": \"true\"\r\n }\r\n ]\r\n}" } ] }