2 * Copyright (c) 2017 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 option version = "2.0.0";
18 /** \brief Create or remove named socket file for memif interfaces
19 @param client_index - opaque cookie to identify the sender
20 @param context - sender context, to match reply w/ request
21 @param is_add - 0 = remove, 1 = add association
22 @param socket_id - non-0 32-bit integer used to identify a socket file
23 @param socket_filename - filename of the socket to be used for connection
24 establishment; id 0 always maps to default "/var/vpp/memif.sock";
25 no socket filename needed when is_add == 0.
27 autoreply define memif_socket_filename_add_del
31 u8 is_add; /* 0 = remove, 1 = add association */
32 u32 socket_id; /* unique non-0 id for given socket file name */
33 u8 socket_filename[128]; /* NUL terminated filename */
36 /** \brief Create memory interface
37 @param client_index - opaque cookie to identify the sender
38 @param context - sender context, to match reply w/ request
39 @param role - role of the interface in the connection (master/slave)
40 @param mode - interface mode
41 @param rx_queues - number of rx queues (only valid for slave)
42 @param tx_queues - number of tx queues (only valid for slave)
43 @param id - 32bit integer used to authenticate and match opposite sides
45 @param socket_id - socket filename id to be used for connection
47 @param ring_size - the number of entries of RX/TX rings
48 @param buffer_size - size of the buffer allocated for each ring entry
49 @param hw_addr - interface MAC address
56 u8 role; /* 0 = master, 1 = slave */
57 u8 mode; /* 0 = ethernet, 1 = ip, 2 = punt/inject */
58 u8 rx_queues; /* optional, default is 1 */
59 u8 tx_queues; /* optional, default is 1 */
60 u32 id; /* optional, default is 0 */
61 u32 socket_id; /* optional, default is 0, "/var/vpp/memif.sock" */
62 u8 secret[24]; /* optional, default is "" */
63 u32 ring_size; /* optional, default is 1024 entries, must be power of 2 */
64 u16 buffer_size; /* optional, default is 2048 bytes */
65 u8 hw_addr[6]; /* optional, randomly generated if not defined */
68 /** \brief Create memory interface response
69 @param context - sender context, to match reply w/ request
70 @param retval - return value for request
71 @param sw_if_index - software index of the newly created interface
73 define memif_create_reply
80 /** \brief Delete memory interface
81 @param client_index - opaque cookie to identify the sender
82 @param context - sender context, to match reply w/ request
83 @param sw_if_index - software index of the interface to delete
85 autoreply define memif_delete
93 /** \brief Memory interface details structure
94 @param context - sender context, to match reply w/ request
95 @param socket_id - u32 used to identify the given socket filename
96 @param socket_filename - correpsonding NUL terminated socket filename
98 define memif_socket_filename_details
102 u8 socket_filename[128];
105 /** \brief Dump the table of socket ids and corresponding filenames
106 @param client_index - opaque cookie to identify the sender
107 @param context - sender context, to match reply w/ request
109 define memif_socket_filename_dump
115 /** \brief Memory interface details structure
116 @param context - sender context, to match reply w/ request (memif_dump)
117 @param sw_if_index - index of the interface
118 @param if_name - name of the interface
119 @param hw_addr - interface MAC address
120 @param id - id associated with the interface
121 @param role - role of the interface in the connection (master/slave)
122 @param mode - interface mode
123 @param socket_id - id of the socket filename used by this interface
124 to establish new connections
125 @param ring_size - the number of entries of RX/TX rings
126 @param buffer_size - size of the buffer allocated for each ring entry
127 @param admin_up_down - interface administrative status
128 @param link_up_down - interface link status
139 /* memif specific parameters */
141 u8 role; /* 0 = master, 1 = slave */
142 u8 mode; /* 0 = ethernet, 1 = ip, 2 = punt/inject */
145 u16 buffer_size; /* optional, default is 2048 bytes */
147 /* 1 = up, 0 = down */
152 /** \brief Dump all memory interfaces
153 @param client_index - opaque cookie to identify the sender
154 @param context - sender context, to match reply w/ request
164 * eval: (c-set-style "gnu")