1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the MIT License which is available at
6 * https://opensource.org/licenses/MIT.
7 *
8 * SPDX-License-Identifier: MIT
9 **************************************************************************/
10
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** NetX Component */
16 /** */
17 /** User Datagram Protocol (UDP) */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22 #define NX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27 #include "nx_api.h"
28 #include "nx_udp.h"
29
30 /**************************************************************************/
31 /* */
32 /* FUNCTION RELEASE */
33 /* */
34 /* _nx_udp_socket_vlan_priority_set PORTABLE C */
35 /* 6.4.0 */
36 /* AUTHOR */
37 /* */
38 /* Yajun Xia, Microsoft Corporation */
39 /* */
40 /* DESCRIPTION */
41 /* */
42 /* This function is used for settting udp socket vlan priority. */
43 /* */
44 /* INPUT */
45 /* */
46 /* socket_ptr Pointer to udp socket */
47 /* vlan_priority Vlan priority */
48 /* */
49 /* OUTPUT */
50 /* */
51 /* status Actual completion status */
52 /* */
53 /* CALLS */
54 /* */
55 /* CALLED BY */
56 /* */
57 /* Application Code */
58 /* */
59 /* RELEASE HISTORY */
60 /* */
61 /* DATE NAME DESCRIPTION */
62 /* */
63 /* 12-31-2023 Yajun Xia Initial Version 6.4.0 */
64 /* */
65 /**************************************************************************/
_nx_udp_socket_vlan_priority_set(NX_UDP_SOCKET * socket_ptr,UINT vlan_priority)66 UINT _nx_udp_socket_vlan_priority_set(NX_UDP_SOCKET *socket_ptr, UINT vlan_priority)
67 {
68 #ifdef NX_ENABLE_VLAN
69 socket_ptr -> nx_udp_socket_vlan_priority = (UCHAR)(vlan_priority & 0xFF);
70
71 return(NX_SUCCESS);
72 #else
73 NX_PARAMETER_NOT_USED(socket_ptr);
74 NX_PARAMETER_NOT_USED(vlan_priority);
75
76 return(NX_NOT_SUPPORTED);
77 #endif /* NX_ENABLE_VLAN */
78 }
79
80