FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
interface_types_api.c
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2020 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
19 
20 STATIC_ASSERT_SIZEOF (vl_api_direction_t, 1);
21 
22 int
23 direction_decode (vl_api_direction_t _dir, vlib_dir_t * out)
24 {
25  switch (_dir)
26  {
27  case RX:
28  *out = VLIB_RX;
29  return (0);
30  case TX:
31  *out = VLIB_TX;
32  return (0);
33  }
34  return (VNET_API_ERROR_INVALID_VALUE);
35 }
36 
37 vl_api_direction_t
39 {
40  return (vl_api_direction_t) dir;
41 }
42 
43 /*
44  * fd.io coding-style-patch-verification: ON
45  *
46  * Local Variables:
47  * eval: (c-set-style "gnu")
48  * End:
49  */
STATIC_ASSERT_SIZEOF
STATIC_ASSERT_SIZEOF(vl_api_direction_t, 1)
RX
@ RX
Definition: interface_types.api:78
interface_types_api.h
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
direction_encode
vl_api_direction_t direction_encode(vlib_dir_t dir)
Definition: interface_types_api.c:38
vlib_rx_or_tx_t
vlib_rx_or_tx_t
Definition: defs.h:44
TX
@ TX
Definition: interface_types.api:79
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
direction_decode
int direction_decode(vl_api_direction_t _dir, vlib_dir_t *out)
Definition: interface_types_api.c:23