AM261x MCU+ SDK  10.02.00
ieee802-dot1ab-lldp_access.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Texas Instruments Incorporated
3  * Copyright (c) 2023 Excelfore Corporation (https://excelfore.com)
4  *
5  * All rights reserved not granted herein.
6  * Limited License.
7  *
8  * Texas Instruments Incorporated grants a world-wide, royalty-free,
9  * non-exclusive license under copyrights and patents it now or hereafter
10  * owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
11  * this software subject to the terms herein. With respect to the foregoing patent
12  * license, such license is granted solely to the extent that any such patent is necessary
13  * to Utilize the software alone. The patent license shall not apply to any combinations which
14  * include this software, other than combinations with devices manufactured by or for TI ("TI Devices").
15  * No hardware patent is licensed hereunder.
16  *
17  * Redistributions must preserve existing copyright notices and reproduce this license (including the
18  * above copyright notice and the disclaimer and (if applicable) source code license limitations below)
19  * in the documentation and/or other materials provided with the distribution
20  *
21  * Redistribution and use in binary form, without modification, are permitted provided that the following
22  * conditions are met:
23  *
24  * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any
25  * software provided in binary form.
26  * * any redistribution and use are licensed by TI for use only with TI Devices.
27  * * Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
28  *
29  * If software source code is provided to you, modification and redistribution of the source code are permitted
30  * provided that the following conditions are met:
31  *
32  * * any redistribution and use of the source code, including any resulting derivative works, are licensed by
33  * TI for use only with TI Devices.
34  * * any redistribution and use of any object code compiled from the source code and any resulting derivative
35  * works, are licensed by TI for use only with TI Devices.
36  *
37  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or
38  * promote products derived from this software without specific prior written permission.
39  *
40  * DISCLAIMER.
41  *
42  * THIS SOFTWARE IS PROVIDED BY TI AND TI"S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
43  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44  * IN NO EVENT SHALL TI AND TI"S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
46  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
48  * POSSIBILITY OF SUCH DAMAGE.
49 */
50 #ifndef IEEE802_DOT1AB_LLDP_ACCESS_H_
51 #define IEEE802_DOT1AB_LLDP_ACCESS_H_
52 #include "yang_db_access.h"
53 
54 typedef struct
55 {
56  kvs_t vk;
57  uint8_t vk_sz;
59 
60 //ieee802-types.yang -> port-id-subtype-type
61 typedef enum {
71 
72 typedef struct remote_portid_info {
73  const char *brname;
74  const char *ifname;
75  uint8_t *dstmacaddr;
76  uint32_t timemarks;
77  uint32_t remoteidx;
79  const char *portid;
81 
82 int ydbi_get_item_abk1vk0(yang_db_item_access_t *ydbia, void **rval, uint8_t k1, bool status);
83 
84 int ydbi_get_item_abk2vk0(yang_db_item_access_t *ydbia, void **rval, uint8_t k1, uint8_t k2, bool status);
85 
86 int ydbi_set_item_abk1vk0(yang_db_item_access_t *ydbia, void *rval, uint32_t vsize, uint8_t k1, bool status, uint8_t notice);
87 
88 int ydbi_set_item_abk2vk0(yang_db_item_access_t *ydbia, void *rval, uint32_t vsize, uint8_t k1, uint8_t k2, bool status, uint8_t notice);
89 
94 int ydbi_get_item_abknvkn(yang_db_item_access_t *ydbia,
95  void **rval,
96  uint8_t kn[],
97  uint8_t kn_sz,
98  attribute_pair_t attrs[],
99  uint8_t kvs_sz,
100  bool status);
101 
106 int ydbi_set_item_abknvkn(yang_db_item_access_t *ydbia,
107  uint8_t kn[],
108  uint8_t kn_sz,
109  attribute_pair_t attrs[],
110  uint8_t kvs_sz,
111  bool status,
112  void* value,
113  uint32_t vsize,
114  uint8_t notice);
115 
120 int ydbi_del_item_abknvkn(yang_db_item_access_t *ydbia,
121  uint8_t kn[],
122  uint8_t kn_sz,
123  attribute_pair_t attrs[],
124  uint8_t kvs_sz,
125  bool status,
126  uint8_t notice);
137 void ydbi_set_dbpara_abk1vk1(yang_db_item_access_t *ydbia, char* brname,
138  char *name, uint8_t *destmac, uint8_t k1,
139  bool ismirror, bool iswildcard);
140 
151 int ydbi_iterate_portid(yang_db_item_access_t *ydbia, uc_range **range,
152  lldp_remote_portid_info_t *portid, bool ismirror);
153 
164 int ydbi_get_portid_subtype(yang_db_item_access_t *ydbia,
165  lldp_remote_portid_info_t *portid, bool ismirror);
166 
178 int ydbi_del_remote_systems_data(yang_db_item_access_t *ydbia, uint8_t k1,
179  lldp_remote_portid_info_t *portid, bool ismirror);
180 
181 #endif /* IEEE802_DOT1AB_LLDP_ACCESS_H_ */
ePORT_ID_SUBTYPE_INTERFACE_ALIAS
@ ePORT_ID_SUBTYPE_INTERFACE_ALIAS
Definition: ieee802-dot1ab-lldp_access.h:62
attribute_pair_t
Definition: ieee802-dot1ab-lldp_access.h:55
ePORT_ID_SUBTYPE_AGENT_CIRCUIT_ID
@ ePORT_ID_SUBTYPE_AGENT_CIRCUIT_ID
Definition: ieee802-dot1ab-lldp_access.h:67
ePORT_ID_SUBTYPE_MAX
@ ePORT_ID_SUBTYPE_MAX
Definition: ieee802-dot1ab-lldp_access.h:69
ydbi_del_remote_systems_data
int ydbi_del_remote_systems_data(yang_db_item_access_t *ydbia, uint8_t k1, lldp_remote_portid_info_t *portid, bool ismirror)
deleted the given remote-system-data leaf (k1) with the given port-id info
lldp_remote_portid_info_t::ifname
const char * ifname
Definition: ieee802-dot1ab-lldp_access.h:74
ydbi_get_item_abknvkn
int ydbi_get_item_abknvkn(yang_db_item_access_t *ydbia, void **rval, uint8_t kn[], uint8_t kn_sz, attribute_pair_t attrs[], uint8_t kvs_sz, bool status)
Get val base on n key from LLDP until end Also provided vkn as attribute.
lldp_remote_portid_info_t::remoteidx
uint32_t remoteidx
Definition: ieee802-dot1ab-lldp_access.h:77
ydbi_set_item_abk2vk0
int ydbi_set_item_abk2vk0(yang_db_item_access_t *ydbia, void *rval, uint32_t vsize, uint8_t k1, uint8_t k2, bool status, uint8_t notice)
ePORT_ID_SUBTYPE_LOCAL
@ ePORT_ID_SUBTYPE_LOCAL
Definition: ieee802-dot1ab-lldp_access.h:68
ePORT_ID_SUBTYPE_MAC_ADDRESS
@ ePORT_ID_SUBTYPE_MAC_ADDRESS
Definition: ieee802-dot1ab-lldp_access.h:64
lldp_remote_portid_info_t::timemarks
uint32_t timemarks
Definition: ieee802-dot1ab-lldp_access.h:76
ydbi_get_portid_subtype
int ydbi_get_portid_subtype(yang_db_item_access_t *ydbia, lldp_remote_portid_info_t *portid, bool ismirror)
get the port-id-subtype of the given port-id info
attribute_pair_t::vk
kvs_t vk
Definition: ieee802-dot1ab-lldp_access.h:56
lldp_remote_portid_info_t::portid
const char * portid
Definition: ieee802-dot1ab-lldp_access.h:79
attribute_pair_t::vk_sz
uint8_t vk_sz
size of kv
Definition: ieee802-dot1ab-lldp_access.h:57
ydbi_get_item_abk2vk0
int ydbi_get_item_abk2vk0(yang_db_item_access_t *ydbia, void **rval, uint8_t k1, uint8_t k2, bool status)
lldp_port_id_subtype_t
lldp_port_id_subtype_t
Definition: ieee802-dot1ab-lldp_access.h:61
ePORT_ID_SUBTYPE_PORT_COMPONENT
@ ePORT_ID_SUBTYPE_PORT_COMPONENT
Definition: ieee802-dot1ab-lldp_access.h:63
ePORT_ID_SUBTYPE_INTERFACE_NAME
@ ePORT_ID_SUBTYPE_INTERFACE_NAME
Definition: ieee802-dot1ab-lldp_access.h:66
ydbi_set_item_abknvkn
int ydbi_set_item_abknvkn(yang_db_item_access_t *ydbia, uint8_t kn[], uint8_t kn_sz, attribute_pair_t attrs[], uint8_t kvs_sz, bool status, void *value, uint32_t vsize, uint8_t notice)
Set val base on n key from LLDP until end Also provided vkn as attribute.
ydbi_iterate_portid
int ydbi_iterate_portid(yang_db_item_access_t *ydbia, uc_range **range, lldp_remote_portid_info_t *portid, bool ismirror)
iterate remote port-id data in db
ydbi_set_dbpara_abk1vk1
void ydbi_set_dbpara_abk1vk1(yang_db_item_access_t *ydbia, char *brname, char *name, uint8_t *destmac, uint8_t k1, bool ismirror, bool iswildcard)
set ydbi db parameters for remote-systems-data leafs
ydbi_get_item_abk1vk0
int ydbi_get_item_abk1vk0(yang_db_item_access_t *ydbia, void **rval, uint8_t k1, bool status)
lldp_remote_portid_info_t::subtype
lldp_port_id_subtype_t subtype
Definition: ieee802-dot1ab-lldp_access.h:78
lldp_remote_portid_info_t::dstmacaddr
uint8_t * dstmacaddr
Definition: ieee802-dot1ab-lldp_access.h:75
ydbi_del_item_abknvkn
int ydbi_del_item_abknvkn(yang_db_item_access_t *ydbia, uint8_t kn[], uint8_t kn_sz, attribute_pair_t attrs[], uint8_t kvs_sz, bool status, uint8_t notice)
Set val base on n key from LLDP until end Also provided vkn as attribute.
ydbi_set_item_abk1vk0
int ydbi_set_item_abk1vk0(yang_db_item_access_t *ydbia, void *rval, uint32_t vsize, uint8_t k1, bool status, uint8_t notice)
ePORT_ID_SUBTYPE_NETWORK_ADDRESS
@ ePORT_ID_SUBTYPE_NETWORK_ADDRESS
Definition: ieee802-dot1ab-lldp_access.h:65
lldp_remote_portid_info_t::brname
const char * brname
Definition: ieee802-dot1ab-lldp_access.h:73
lldp_remote_portid_info_t
Definition: ieee802-dot1ab-lldp_access.h:72