aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-09-08 19:52:02 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-09-09 20:11:03 +0000
commit56dd5438b04b869065d8e901c315496bb6777455 (patch)
tree517190c53cfd2725d716eda6dddf9a64ad814084 /src/vnet/devices/af_packet/af_packet.c
parent816122e303efb5012f6897bd53ff8fe28cd8fa1c (diff)
move unix_file_* code to vppinfra
This will allow us to use this code in client libraries without vlib. Change-Id: I8557b752496841ba588aa36b6082cbe2cd1867fe Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/af_packet/af_packet.c')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index e7e6921421b..62bb228f04f 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -89,7 +89,7 @@ af_packet_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi,
}
static clib_error_t *
-af_packet_fd_read_ready (unix_file_t * uf)
+af_packet_fd_read_ready (clib_file_t * uf)
{
af_packet_main_t *apm = &af_packet_main;
vnet_main_t *vnm = vnet_get_main ();
@@ -281,12 +281,12 @@ af_packet_create_if (vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
clib_spinlock_init (&apif->lockp);
{
- unix_file_t template = { 0 };
+ clib_file_t template = { 0 };
template.read_function = af_packet_fd_read_ready;
template.file_descriptor = fd;
template.private_data = if_index;
template.flags = UNIX_FILE_EVENT_EDGE_TRIGGERED;
- apif->unix_file_index = unix_file_add (&unix_main, &template);
+ apif->clib_file_index = clib_file_add (&file_main, &template);
}
/*use configured or generate random MAC address */
@@ -371,10 +371,10 @@ af_packet_delete_if (vlib_main_t * vm, u8 * host_if_name)
vnet_hw_interface_unassign_rx_thread (vnm, apif->hw_if_index, 0);
/* clean up */
- if (apif->unix_file_index != ~0)
+ if (apif->clib_file_index != ~0)
{
- unix_file_del (&unix_main, unix_main.file_pool + apif->unix_file_index);
- apif->unix_file_index = ~0;
+ clib_file_del (&file_main, file_main.file_pool + apif->clib_file_index);
+ apif->clib_file_index = ~0;
}
else
close (apif->fd);