|
|
#define | HICN_FACE_FLAGS_DEFAULT 0x00 |
| |
|
#define | HICN_FACE_FLAGS_FACE 0x01 |
| |
|
#define | HICN_FACE_FLAGS_IFACE 0x02 |
| |
|
#define | HICN_FACE_FLAGS_APPFACE_PROD 0x04 /* Currently only IP face can be appface */ |
| |
|
#define | HICN_FACE_FLAGS_APPFACE_CONS 0x08 /* Currently only IP face can be appface */ |
| |
|
#define | HICN_FACE_FLAGS_DELETED 0x10 |
| |
|
#define | HICN_FACE_NULL (hicn_face_id_t) ~0 |
| |
|
#define | HICN_FACE_FLAGS_APPFACE_PROD_BIT 2 |
| |
|
#define | HICN_FACE_FLAGS_APPFACE_CONS_BIT 3 |
| |
|
#define | HICN_BUFFER_FLAGS_DEFAULT 0x00 |
| |
|
#define | HICN_BUFFER_FLAGS_FACE_IS_APP 0x01 |
| |
| #define | foreach_hicn_face_counter |
| |
|
#define | _(a, b, c) HICN_FACE_COUNTERS_##a = (b), |
| |
|
#define | get_face_counter_string(ctrxno) (char *) (HICN_FACE_CTRX_STRING[ctrxno]) |
| |
|
| struct | __attribute__ ((packed)) hicn_face_s |
| | Structure representing a face. It containes the fields shared among all the types of faces as well it leaves some space for storing additional information specific to each type. More...
|
| |
|
| STATIC_ASSERT ((1<< HICN_FACE_FLAGS_APPFACE_PROD_BIT)==HICN_FACE_FLAGS_APPFACE_PROD, "HICN_FACE_FLAGS_APPFACE_PROD_BIT and " "HICN_FACE_FLAGS_APPFACE_PROD must correspond") |
| |
|
| STATIC_ASSERT ((1<< HICN_FACE_FLAGS_APPFACE_CONS_BIT)==HICN_FACE_FLAGS_APPFACE_CONS, "HICN_FACE_FLAGS_APPFACE_CONS_BIT and " "HICN_FACE_FLAGS_APPFACE_CONS must correspond") |
| |
|
| STATIC_ASSERT ((HICN_FACE_FLAGS_APPFACE_PROD >> HICN_FACE_FLAGS_APPFACE_PROD_BIT)==HICN_BUFFER_FLAGS_FACE_IS_APP, "hicn buffer app flag does not correspond to HICN_FACE_FLAGS_APPFACE_PROD") |
| |
|
| STATIC_ASSERT ((HICN_FACE_FLAGS_APPFACE_CONS >> HICN_FACE_FLAGS_APPFACE_CONS_BIT)==HICN_BUFFER_FLAGS_FACE_IS_APP, "hicn buffer app flag does not correspond to HICN_FACE_FLAGS_APPFACE_PROD") |
| |
| always_inline hicn_face_id_t | hicn_dpoi_get_index (hicn_face_t *face_dpoi) |
| | Return the face id from the face object. More...
|
| |
| always_inline hicn_face_t * | hicn_dpoi_get_from_idx_safe (hicn_face_id_t dpoi_index) |
| | Return the face object from the face id. This method is robust to invalid face id. More...
|
| |
| 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. More...
|
| |
|
always_inline int | hicn_dpoi_idx_is_valid (hicn_face_id_t face_id) |
| | Return true if the face id belongs to an existing face.
|
| |
| always_inline void | hicn_face_lock_with_id (hicn_face_id_t face_id) |
| | Add a lock to the face dpo. More...
|
| |
| always_inline void | hicn_face_unlock_with_id (hicn_face_id_t face_id) |
| | Remove a lock to the face dpo. Deallocate the face id locks == 0. More...
|
| |
| always_inline void | hicn_face_lock (dpo_id_t *dpo) |
| | Add a lock to the face through its dpo. More...
|
| |
| always_inline void | hicn_face_unlock (dpo_id_t *dpo) |
| | Remove a lock to the face through its dpo. Deallocate the face id locks == 0. More...
|
| |
| void | hicn_face_module_init (vlib_main_t *vm) |
| | Init the internal structures of the face module. More...
|
| |
|
u8 * | format_hicn_face (u8 *s, va_list *args) |
| |
| u8 * | format_hicn_face_all (u8 *s, int n,...) |
| | Format all the existing faces. More...
|
| |
| int | hicn_face_del (hicn_face_id_t face_id) |
| | Delete a face. More...
|
| |
| always_inline void | hicn_face_get_key (const ip46_address_t *addr, u32 sw_if, const dpo_id_t *dpo, hicn_face_key_t *key) |
| | Create the key object for the mhash. Fill in the key object with the expected values. More...
|
| |
| always_inline hicn_face_t * | hicn_face_get (const ip46_address_t *addr, u32 sw_if, mhash_t *hashtb, index_t adj_index) |
| | Get the face obj from the nat address. Does not add any lock. More...
|
| |
| always_inline hicn_face_t * | hicn_face_get_with_dpo (const ip46_address_t *addr, u32 sw_if, const dpo_id_t *dpo, mhash_t *hashtb) |
| | Get the face obj from the nat address and the dpo. Does not add any lock. More...
|
| |
| always_inline hicn_face_input_faces_t * | hicn_face_get_vec (const ip46_address_t *addr, mhash_t *hashtb) |
| | Get the vector of faces from the ip v4 address. Does not add any lock. More...
|
| |
| int | hicn_face_add (const dpo_id_t *dpo_nh, ip46_address_t *nat_address, int sw_if, hicn_face_id_t *pfaceid, u8 is_app_prod) |
| | Create a new face ip. API for other modules (e.g., routing) More...
|
| |
| always_inline void | hicn_iface_add (ip46_address_t *nat_address, int sw_if, hicn_face_id_t *pfaceid, dpo_proto_t proto, u32 adj_index) |
| | Create a new incomplete face ip. (Meant to be used by the data plane) More...
|
| |
| always_inline int | hicn_face_ip4_lock (hicn_face_id_t *face_id, u32 *in_faces_vec_id, u8 *hicnb_flags, const ip4_address_t *nat_addr) |
| | Retrieve a vector of faces from the ip4 local address and returns its index. More...
|
| |
| always_inline int | hicn_face_ip6_lock (hicn_face_id_t *face_id, u32 *in_faces_vec_id, u8 *hicnb_flags, const ip6_address_t *nat_addr) |
| | Retrieve a face from the ip6 local address and returns its dpo. This method adds a lock on the face state. More...
|
| |
| always_inline void | hicn_iface_ip4_add_and_lock (hicn_face_id_t *index, u8 *hicnb_flags, const ip4_address_t *nat_addr, u32 sw_if, u32 adj_index, u32 node_index) |
| | Retrieve, or create if it doesn't exist, a face from the ip6 local address and returns its dpo. This method adds a lock on the face state. More...
|
| |
| always_inline void | hicn_iface_ip6_add_and_lock (hicn_face_id_t *index, u8 *hicnb_flags, const ip6_address_t *nat_addr, u32 sw_if, u32 adj_index, u32 node_index) |
| | Retrieve, or create if it doesn't exist, a face from the ip6 local address and returns its dpo. This method adds a lock on the face state. More...
|
| |
This file implements a general face type. The purpose of a face is to carry the needed information to forward interest and data packets to the next node in the network. There are two type of faces: complete faces (in short faces), and incomplete faces (in short ifaces).
A face that does not contain the indication of the adjacency is an incomplete face (iface), otherwise it is considered to be complete. Ifaces are used to forward data back to the previous hICN hop from which we received an interest, while faces are used to forward interest packets to the next hicn node. Faces and ifaces are created at two different points in time. Faces are created when a route is added, while ifaces are created when an interest is received. In details, faces and ifaces carry the following information:
- nat_addr: the ip address to perform src nat or dst nat on interest and data packets, respectively;
- pl_id: the path label
- locks: the number of entities using this face. When 0 the face can be deallocated
- dpo: the dpo that identifies the next node in the vlib graph for processing the vlib buffer. The dpo contains the dpo.dpoi_next field that points to the next node in the vlib graph and the dpo.dpoi_index which is an index to adj used by the next node to perform the l2 rewrite. In case of ifaces, it is likely we don't know the adjacency when creting the face. In this case, the next node in the vlib graph will be the node that performs a lookup in the fib. Only in case of udp tunnels, which are bidirectional tunnel we know that the incoming tunnel is also the outgoing one, therefore in this case we store the tunnel in the dpo.dpoi_index fields. For all the other tunnels (which are most likely unidirectional), the source address of the interest will be used to retrieve the outgoing tunnel when sending the corresponding data back.
- sw_if: the incoming interface of the interest
- fib_node, fib_entry_index and fib_sibling are information used to be notified of changes in the adjacency pointed by the dpo.
We maintain two hash tables to retrieve faces and ifaces. In particular one hash table which index faces and ifaces for nat_address, sw_if and dpo. This is used to retrieve existing faces or ifaces when an interest is received and when an new face is created. A second hash table that indexes vectors of faces for nat_address and sw_if. This is used to retrieve a list of possible incoming faces when a data is received.