Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
strategy.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 #ifndef __HICN_STRATEGY__
17 #define __HICN_STRATEGY__
18 
19 #include "hicn.h"
20 #include "hashtb.h"
21 #include "mgmt.h"
22 #include "faces/face.h"
23 
41 /* Trace context struct */
42 typedef struct
43 {
44  u32 next_index;
45  u32 sw_if_index;
46  u8 pkt_type;
47  dpo_type_t dpo_type;
49 
50 typedef struct hicn_strategy_vft_s
51 {
52  void (*hicn_receive_data) (index_t dpo_idx, int nh_idx);
53  void (*hicn_on_interest_timeout) (index_t dpo_idx);
54  void (*hicn_add_interest) (index_t dpo_idx, hicn_hash_entry_t *pit_entry);
55  u32 (*hicn_select_next_hop) (index_t dpo_idx, int *nh_idx,
56  hicn_face_id_t *outface);
57  u8 *(*hicn_format_strategy_trace) (u8 *, hicn_strategy_trace_t *);
58  u8 *(*hicn_format_strategy) (u8 *s, va_list *ap);
61 
62 typedef enum
63 {
64  HICN_STRATEGY_NEXT_INTEREST_HITPIT,
65  HICN_STRATEGY_NEXT_INTEREST_HITCS,
66  HICN_STRATEGY_NEXT_INTEREST_FACE4,
67  HICN_STRATEGY_NEXT_INTEREST_FACE6,
68  HICN_STRATEGY_NEXT_ERROR_DROP,
69  HICN_STRATEGY_N_NEXT,
70 } hicn_strategy_next_t;
71 
72 const static char *const hicn_ip6_nodes[] = {
73  "hicn6-iface-input", // this is the name you give your node in
74  // VLIB_REGISTER_NODE
75  NULL,
76 };
77 
78 const static char *const hicn_ip4_nodes[] = {
79  "hicn4-iface-input", // this is the name you give your node in
80  // VLIB_REGISTER_NODE
81  NULL,
82 };
83 
84 const static char *const *const hicn_nodes_strategy[DPO_PROTO_NUM] = {
85  [DPO_PROTO_IP6] = hicn_ip6_nodes,
86  [DPO_PROTO_IP4] = hicn_ip4_nodes,
87 };
88 
89 extern vlib_node_registration_t hicn_strategy_node;
90 
91 #endif /* //__HICN_STRATEGY__ */
92 
93 /*
94  * fd.io coding-style-patch-verification: ON
95  *
96  * Local Variables: eval: (c-set-style "gnu") End:
97  */
face.h
hicn.h
hashtb.h
hicn_strategy_trace_t
Definition: strategy.h:42
mgmt.h
hicn_strategy_vft_s
Definition: strategy.h:50