Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
mapme_ctrl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * Copyright (c) 2017-2019 by Cisco Systems Inc. All Rights Reserved.
18  *
19  */
20 
21 #ifndef HICN_MAPME_CTRL_H
22 #define HICN_MAPME_CTRL_H
23 
24 #include <vlib/vlib.h>
25 #include <vnet/vnet.h>
26 
32 /* Node context data */
34 {
35  int id;
37 
38 /* Trace context struct */
39 typedef struct
40 {
41  u32 next_index;
42  u32 sw_if_index;
43  u8 pkt_type;
45 
46 typedef enum
47 {
48  HICN_MAPME_CTRL_NEXT_IP4_OUTPUT,
49  HICN_MAPME_CTRL_NEXT_IP6_OUTPUT,
50  HICN_MAPME_CTRL_NEXT_ERROR_DROP,
51  HICN_MAPME_CTRL_N_NEXT,
52 } hicn_mapme_ctrl_next_t;
56 always_inline hicn_mapme_ctrl_next_t
57 hicn_mapme_ctrl_get_iface_node (hicn_face_id_t face_id)
58 {
59  hicn_face_t *face = hicn_dpoi_get_from_idx (face_id);
60 
61  switch (face->dpo.dpoi_proto)
62  {
63  case DPO_PROTO_IP4:
64  return HICN_MAPME_CTRL_NEXT_IP4_OUTPUT;
65  case DPO_PROTO_IP6:
66  return HICN_MAPME_CTRL_NEXT_IP6_OUTPUT;
67  default:
68  return HICN_MAPME_CTRL_NEXT_ERROR_DROP;
69  }
70 }
71 
72 #endif /* HICN_MAPME_CTRL_H */
73 
74 /*
75  * fd.io coding-style-patch-verification: ON
76  *
77  * Local Variables: eval: (c-set-style "gnu") End:
78  */
hicn_mapme_ctrl_runtime_s
Definition: mapme_ctrl.h:33
hicn_mapme_ctrl_trace_t
Definition: mapme_ctrl.h:39
hicn_dpoi_get_from_idx
always_inline hicn_face_t * hicn_dpoi_get_from_idx(hicn_face_id_t dpoi_index)
Return the face from the face id. Face id must be valid.
Definition: face.h:244
hicn_mapme_ctrl_get_iface_node
always_inline hicn_mapme_ctrl_next_t hicn_mapme_ctrl_get_iface_node(hicn_face_id_t face_id)
Returns the next hop node on which we can send an ACK packet.
Definition: mapme_ctrl.h:57