summaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-19 14:01:02 +0000
committerDamjan Marion <dmarion@me.com>2019-07-26 13:27:14 +0000
commit038e1dfbdfd0bd785852c364011da0a1d828093e (patch)
tree4e3a039c240e9e91123ff363f909caabc4c909f4 /src/vnet/dhcp/dhcp_api.c
parent08ac303e43492c8b25911340fb62811289dd3935 (diff)
dhcp ip: DSCP settings for transmitted DHCP packets
Type: feature - Define the ip_dscp_t and use in the IP headers - Add DSCP setting to the DHCP client for use with packet TX Change-Id: If220dde0017ea78793747d65f53e11daf23a28fa Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/dhcp/dhcp_api.c')
-rw-r--r--src/vnet/dhcp/dhcp_api.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vnet/dhcp/dhcp_api.c b/src/vnet/dhcp/dhcp_api.c
index 7eb2bf46a06..7935ad8ba01 100644
--- a/src/vnet/dhcp/dhcp_api.c
+++ b/src/vnet/dhcp/dhcp_api.c
@@ -28,6 +28,7 @@
#include <vnet/dhcp/dhcp6_ia_na_client_dp.h>
#include <vnet/dhcp/dhcp6_client_common_dp.h>
#include <vnet/fib/fib_table.h>
+#include <vnet/ip/ip_types_api.h>
#include <vnet/vnet_msg_enum.h>
@@ -263,6 +264,7 @@ dhcp_client_data_encode (vl_api_dhcp_client_t * vclient,
else
vclient->want_dhcp_event = 0;
vclient->set_broadcast_flag = client->set_broadcast_flag;
+ vclient->dscp = ip_dscp_encode (client->dscp);
vclient->pid = client->pid;
}
@@ -292,14 +294,13 @@ static void vl_api_dhcp_client_config_t_handler
vlib_main_t *vm = vlib_get_main ();
vl_api_dhcp_client_config_reply_t *rmp;
u32 sw_if_index;
+ ip_dscp_t dscp;
int rv = 0;
+ VALIDATE_SW_IF_INDEX (&(mp->client));
+
sw_if_index = ntohl (mp->client.sw_if_index);
- if (!vnet_sw_if_index_is_api_valid (sw_if_index))
- {
- rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
- goto bad_sw_if_index;
- }
+ dscp = ip_dscp_decode (mp->client.dscp);
rv = dhcp_client_config (mp->is_add,
mp->client_index,
@@ -310,10 +311,10 @@ static void vl_api_dhcp_client_config_t_handler
(mp->client.want_dhcp_event ?
dhcp_compl_event_callback :
NULL),
- mp->client.set_broadcast_flag, mp->client.pid);
+ mp->client.set_broadcast_flag,
+ dscp, mp->client.pid);
BAD_SW_IF_INDEX_LABEL;
-
REPLY_MACRO (VL_API_DHCP_CLIENT_CONFIG_REPLY);
}