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 /** \brief Create memory interface
17 @param client_index - opaque cookie to identify the sender
18 @param context - sender context, to match reply w/ request
19 @param role - role of the interface in the connection (master/slave)
20 @param key - 64bit integer used to authenticate and match opposite sides
22 @param socket_filename - filename of the socket to be used for connection
24 @param ring_size - the number of entries of RX/TX rings
25 @param buffer_size - size of the buffer allocated for each ring entry
26 @param hw_addr - interface MAC address
33 u8 role; /* 0 = master, 1 = slave */
34 u64 key; /* optional, default is 0 */
35 u8 socket_filename[128]; /* optional, default is "/var/vpp/memif.sock"
36 and can be changed in VPP startup config */
38 u32 ring_size; /* optional, default is 1024 entries, must be power of 2 */
39 u16 buffer_size; /* optional, default is 2048 bytes */
40 u8 hw_addr[6]; /* optional, randomly generated if not defined */
43 /** \brief Create memory interface response
44 @param context - sender context, to match reply w/ request
45 @param retval - return value for request
46 @param sw_if_index - software index of the newly created interface
48 define memif_create_reply
55 /** \brief Delete memory interface
56 @param client_index - opaque cookie to identify the sender
57 @param context - sender context, to match reply w/ request
58 @param sw_if_index - software index of the interface to delete
60 autoreply define memif_delete
68 /** \brief Memory interface details structure
69 @param context - sender context, to match reply w/ request (memif_dump)
70 @param sw_if_index - index of the interface
71 @param if_name - name of the interface
72 @param hw_addr - interface MAC address
73 @param key - key associated with the interface
74 @param role - role of the interface in the connection (master/slave)
75 @param socket_filename - name of the socket used by this interface
76 to establish new connections
77 @param ring_size - the number of entries of RX/TX rings
78 @param buffer_size - size of the buffer allocated for each ring entry
79 @param admin_up_down - interface administrative status
80 @param link_up_down - interface link status
91 /* memif specific parameters */
93 u8 role; /* 0 = master, 1 = slave */
94 u8 socket_filename[128];
96 u16 buffer_size; /* optional, default is 2048 bytes */
98 /* 1 = up, 0 = down */
103 /** \brief Dump all memory interfaces
104 @param client_index - opaque cookie to identify the sender
105 @param context - sender context, to match reply w/ request
115 * eval: (c-set-style "gnu")