Skip to content

Commit a068815

Browse files
silabs-aydoganerzr
authored andcommitted
libs2: SWPROT-9245: "NLS Node List Get/Report" implementation (#52)
(cherry picked from commit 6d87a823ccc19bd113f52b8f546c1759efc2d684) Forwarded: #52 Relate-to: #50 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent 1302b2a commit a068815

File tree

6 files changed

+999
-47
lines changed

6 files changed

+999
-47
lines changed

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,29 @@ void S2_get_commands_supported(node_t lnode, uint8_t class_id, const uint8_t **
120120
* \param nls_capability The NLS capability of the source node
121121
* \param nls_state The NLS state of the source node
122122
*/
123-
void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state);
123+
void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state);
124124

125125
/**
126126
* Get the NLS nodes list
127127
* \param srcNode Source node ID of the frame
128-
* \param class_id the security class this request was on
129128
* \param request request field. 0 for the first node in the list, 1 for the next node in the list
129+
* \param is_last_node out pointer to be filled by the host indicating whether the node in question is the last one or not
130+
* \param node_id out pointer to be filled by the host indicating the node ID in question
131+
* \param granted_keys out pointer to be filled by the host indicating the granted keys of the node in question
132+
* \param nls_state out pointer to be filled by the host indicating the NLS state of the node in question
133+
* \return 0 in case of success or else in case of error
130134
*/
131-
void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request);
135+
int8_t S2_get_nls_node_list(node_t srcNode, bool request, bool *is_last_node, uint16_t *node_id, uint8_t *granted_keys, bool *nls_state);
132136

133137
/**
134138
* Get the NLS node list report
135139
* \param srcNode Source node ID of the frame
136-
* \param class_id the security class this request was on
137-
* \param last_node wether the node in list is last or not
138140
* \param id_of_node the Node ID of the node being advertised
139141
* \param keys_node_bitmask granted keys for current Node ID
140142
* \param nls_state NLS state of the current node ID
143+
* \return 0 in case of success or else in case of error
141144
*/
142-
void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state);
145+
int8_t S2_notify_nls_node_list_report(node_t srcNode, uint16_t id_of_node, uint8_t keys_node_bitmask, bool nls_state);
143146

144147
/**
145148
* Makes time in ms available to LibS2

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/mock/s2_extern_mock.c

+13-9
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ uint8_t S2_send_frame(struct S2* ctxt,const s2_connection_t* conn, uint8_t* buf,
8080
MOCK_CALL_RETURN_VALUE(p_mock, uint8_t);
8181
}
8282

83-
void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_capability, uint8_t nls_state)
83+
void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, bool nls_capability, bool nls_state)
8484
{
8585
mock_t * p_mock;
8686

@@ -90,24 +90,28 @@ void S2_notify_nls_state_report(node_t srcNode, uint8_t class_id, uint8_t nls_ca
9090
MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, nls_capability, nls_state);
9191
}
9292

93-
void S2_nls_node_list_get(node_t srcNode, uint8_t class_id, uint8_t request)
93+
int8_t S2_get_nls_node_list(node_t srcNode, bool request, bool *is_last_node, uint16_t *node_id, uint8_t *granted_keys, bool *nls_state)
9494
{
9595
mock_t * p_mock;
9696

97-
MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB();
98-
MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock);
97+
MOCK_CALL_RETURN_IF_USED_AS_STUB(0);
98+
MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, -1);
99+
100+
MOCK_CALL_ACTUAL(p_mock, srcNode, request, is_last_node, node_id, granted_keys, nls_state);
99101

100-
MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, request);
102+
MOCK_CALL_RETURN_VALUE(p_mock, int8_t);
101103
}
102104

103-
void S2_nls_node_list_report(node_t srcNode, uint8_t class_id, uint8_t last_node, uint16_t id_of_node, uint8_t keys_node_bitmask, uint8_t nls_state)
105+
int8_t S2_notify_nls_node_list_report(node_t srcNode, uint16_t id_of_node, uint8_t keys_node_bitmask, bool nls_state)
104106
{
105107
mock_t * p_mock;
106108

107-
MOCK_CALL_RETURN_VOID_IF_USED_AS_STUB();
108-
MOCK_CALL_FIND_RETURN_VOID_ON_FAILURE(p_mock);
109+
MOCK_CALL_RETURN_IF_USED_AS_STUB(0);
110+
MOCK_CALL_FIND_RETURN_ON_FAILURE(p_mock, -1);
111+
112+
MOCK_CALL_ACTUAL(p_mock, srcNode, id_of_node, keys_node_bitmask, nls_state);
109113

110-
MOCK_CALL_ACTUAL(p_mock, srcNode, class_id, last_node, id_of_node, keys_node_bitmask, nls_state);
114+
MOCK_CALL_RETURN_VALUE(p_mock, int8_t);
111115
}
112116

113117
void S2_set_timeout(struct S2* ctxt, uint32_t interval)

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_classcmd.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@
123123

124124
/** Following define are related to the NLS Node List Report frame. */
125125
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_FIELD 0x01 //< Field denoting if its the last node of the list
126-
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS 0x01 //< Position of last node field
127-
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS 2 //< Position of MSB byte of NodeID
128-
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS 3 //< Position of LSB byte of NodeID
129-
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS 4 //< Position of granted keys byte of NodeID
130-
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS 5 //< Position of NLS state byte of NodeID
126+
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS 2 //< Position of last node field
127+
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS 3 //< Position of MSB byte of NodeID
128+
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS 4 //< Position of LSB byte of NodeID
129+
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS 5 //< Position of granted keys byte of NodeID
130+
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS 6 //< Position of NLS state byte of NodeID
131131

132132
/** Length definitions */
133133
#define SECURITY_2_NONCE_GET_LENGTH 3
@@ -143,7 +143,7 @@
143143
#define SECURITY_2_V2_NLS_STATE_SET_LENGTH 3
144144
#define SECURITY_2_V2_NLS_STATE_GET_LENGTH 2
145145
#define SECURITY_2_V2_NLS_STATE_REPORT_LENGTH 3
146-
#define SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH 2
146+
#define SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH 3
147147
#define SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH 7
148148

149149
#define SECURITY_2_EC_PUBLIC_KEY_LENGTH 32

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/s2_protocol.h

+26
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,32 @@ struct S2
229229

230230
public_key_t public_key;
231231
bool is_keys_restored;
232+
233+
#ifdef ZW_CONTROLLER
234+
/* This structure stores flags that are associated to some NLS related
235+
commands that are used to retransmit the frames that cannot be sent due
236+
to the S2 state machine not being IDLE. */
237+
struct {
238+
uint8_t send_nls_node_list_get: 1;
239+
uint8_t send_nls_node_list_report: 1;
240+
uint8_t reserved: 6;
241+
} delayed_transmission_flags;
242+
243+
/* This union stores some parameters that are associated to some NLS related
244+
commands. They are used to cache information to be sent later on using the flags
245+
above. */
246+
union {
247+
struct {
248+
uint8_t is_last_node;
249+
uint8_t granted_keys;
250+
uint16_t node_id;
251+
uint8_t nls_state;
252+
} nls_node_report;
253+
struct {
254+
uint8_t request; // 0: first node, 1: next node
255+
} get_nls_node_list;
256+
} delayed_transmission_cache;
257+
#endif
232258
//network_key_t temp_network_key;
233259
uint8_t nls_state;
234260
};

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c

+148-18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ S2_is_peernode(struct S2* p_context, const s2_connection_t* peer);
6666
#ifdef ZW_CONTROLLER
6767
static void S2_send_nls_state_set(struct S2* p_context, s2_connection_t* con, bool nls_active);
6868
static void S2_send_nls_state_get(struct S2* p_context, s2_connection_t* con);
69+
static void S2_prepare_nls_node_list_get(uint8_t *buf, bool request);
70+
static void S2_send_nls_node_list_get(struct S2* p_context, s2_connection_t* con, bool request);
71+
static void S2_prepare_nls_node_list_report(uint8_t *buf, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state);
72+
static void S2_send_nls_node_list_report(struct S2* p_context, s2_connection_t* con, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state);
6973
#endif /* ZW_CONTROLLER */
7074
static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con);
7175
static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8_t* cmd, uint16_t cmd_length);
@@ -1432,6 +1436,10 @@ static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8
14321436
if (cmd_length == SECURITY_2_V2_NLS_STATE_GET_LENGTH)
14331437
{
14341438
S2_send_nls_state_report(ctxt, src);
1439+
#ifdef ZW_CONTROLLER
1440+
ctxt->delayed_transmission_flags.send_nls_node_list_get = 1;
1441+
ctxt->delayed_transmission_cache.get_nls_node_list.request = 0; // request first node
1442+
#endif
14351443
}
14361444
break;
14371445
case NLS_STATE_SET_V2:
@@ -1445,25 +1453,58 @@ static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8
14451453
case NLS_STATE_REPORT_V2:
14461454
if (cmd_length == SECURITY_2_V2_NLS_STATE_REPORT_LENGTH)
14471455
{
1448-
S2_notify_nls_state_report(src->r_node, src->class_id,
1449-
cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD,
1450-
cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD);
1456+
bool capability = (cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD) ? true : false;
1457+
bool state = (cmd[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] & SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD) ? true : false;
1458+
1459+
if (state) {
1460+
ctxt->nls_state = 1; // There is at least one an NLS-enabled node in the network
1461+
}
1462+
1463+
S2_notify_nls_state_report(src->r_node, src->class_id, capability, state);
14511464
}
14521465
break;
14531466
case NLS_NODE_LIST_GET_V2:
14541467
if (cmd_length == SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH)
14551468
{
1456-
S2_nls_node_list_get(src->l_node, src->class_id, cmd[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS]);
1469+
bool is_last_node = false;
1470+
uint16_t node_id = 0;
1471+
uint8_t granted_keys = 0;
1472+
bool nls_state = false;
1473+
uint8_t retval;
1474+
bool request = (cmd[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS] == 1) ? true : false;
1475+
1476+
retval = S2_get_nls_node_list(src->r_node, request, &is_last_node, &node_id, &granted_keys, &nls_state);
1477+
if (nls_state && retval == 0) {
1478+
if (S2_is_send_data_busy(ctxt)) {
1479+
ctxt->delayed_transmission_flags.send_nls_node_list_report = 1;
1480+
ctxt->delayed_transmission_cache.nls_node_report.is_last_node = (uint8_t)is_last_node;
1481+
ctxt->delayed_transmission_cache.nls_node_report.node_id = node_id;
1482+
ctxt->delayed_transmission_cache.nls_node_report.granted_keys = granted_keys;
1483+
ctxt->delayed_transmission_cache.nls_node_report.nls_state = (uint8_t)nls_state;
1484+
} else {
1485+
S2_send_nls_node_list_report(ctxt, src, is_last_node, node_id, granted_keys, nls_state);
1486+
}
1487+
}
14571488
}
14581489
break;
14591490
case NLS_NODE_LIST_REPORT_V2:
14601491
if (cmd_length == SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH)
14611492
{
1462-
S2_nls_node_list_report(src->l_node, src->class_id,
1463-
cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS],
1464-
(uint16_t) (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] << 8 | cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS]),
1465-
cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS],
1466-
cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS]);
1493+
bool is_last_node = (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS] & SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_FIELD) ? true : false;
1494+
bool nls_state = (cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS] != 0) ? true : false;
1495+
1496+
int8_t retval = S2_notify_nls_node_list_report(src->r_node,
1497+
(uint16_t)(cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] << 8 | cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS]),
1498+
cmd[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS],
1499+
nls_state);
1500+
if (!is_last_node && retval == 0) {
1501+
if (S2_is_send_data_busy(ctxt)) {
1502+
ctxt->delayed_transmission_flags.send_nls_node_list_get = 1;
1503+
ctxt->delayed_transmission_cache.get_nls_node_list.request = 1; // request next node
1504+
} else {
1505+
S2_send_nls_node_list_get(ctxt, src, true);
1506+
}
1507+
}
14671508
}
14681509
break;
14691510
#endif // ZW_CONTROLLER
@@ -1612,6 +1653,51 @@ S2_fsm_post_event(struct S2* p_context, event_t e, event_data_t* d)
16121653
{
16131654
ctxt->fsm = IDLE;
16141655
S2_post_send_done_event(ctxt, d->d.tx.status);
1656+
#ifdef ZW_CONTROLLER
1657+
if (ctxt->delayed_transmission_flags.send_nls_node_list_get && ctxt->nls_state)
1658+
{
1659+
ctxt->delayed_transmission_flags.send_nls_node_list_get = 0;
1660+
1661+
uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH] = { 0 };
1662+
1663+
S2_prepare_nls_node_list_get(
1664+
buf,
1665+
ctxt->delayed_transmission_cache.get_nls_node_list.request);
1666+
1667+
ctxt->buf = buf;
1668+
ctxt->length = sizeof(buf);
1669+
1670+
// Clear cache
1671+
ctxt->delayed_transmission_cache.get_nls_node_list.request = 0;
1672+
1673+
goto send_msg_state_enter;
1674+
}
1675+
1676+
if (ctxt->delayed_transmission_flags.send_nls_node_list_report && ctxt->nls_state)
1677+
{
1678+
ctxt->delayed_transmission_flags.send_nls_node_list_report = 0;
1679+
1680+
uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH] = { 0 };
1681+
1682+
S2_prepare_nls_node_list_report(
1683+
buf,
1684+
ctxt->delayed_transmission_cache.nls_node_report.is_last_node,
1685+
ctxt->delayed_transmission_cache.nls_node_report.node_id,
1686+
ctxt->delayed_transmission_cache.nls_node_report.granted_keys,
1687+
ctxt->delayed_transmission_cache.nls_node_report.nls_state);
1688+
1689+
ctxt->buf = buf;
1690+
ctxt->length = sizeof(buf);
1691+
1692+
// Clear cache
1693+
ctxt->delayed_transmission_cache.nls_node_report.is_last_node = 0;
1694+
ctxt->delayed_transmission_cache.nls_node_report.node_id = 0;
1695+
ctxt->delayed_transmission_cache.nls_node_report.granted_keys = 0;
1696+
ctxt->delayed_transmission_cache.nls_node_report.nls_state = 0;
1697+
1698+
goto send_msg_state_enter;
1699+
}
1700+
#endif
16151701
}
16161702
else if (e == GOT_NONCE_REPORT && !S2_is_peernode(ctxt, d->con))
16171703
{
@@ -1882,6 +1968,22 @@ S2_is_send_data_multicast_busy(struct S2* p_context)
18821968
return ctxt->fsm != IDLE;
18831969
}
18841970

1971+
static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con)
1972+
{
1973+
CTX_DEF
1974+
1975+
uint8_t plain_text[SECURITY_2_V2_NLS_STATE_REPORT_LENGTH] = { 0 };
1976+
uint8_t nls_bitfield;
1977+
nls_bitfield = SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD | (ctxt->nls_state ? SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD : 0); // A node sending this frame will always support NLS
1978+
plain_text[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2;
1979+
plain_text[SECURITY_2_COMMAND_POS] = NLS_STATE_REPORT_V2;
1980+
plain_text[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] = nls_bitfield;
1981+
1982+
S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_REPORT_LENGTH);
1983+
}
1984+
1985+
#ifdef ZW_CONTROLLER
1986+
18851987
static void S2_send_nls_state_set(struct S2* p_context, s2_connection_t* con, bool nls_active)
18861988
{
18871989
CTX_DEF
@@ -1905,16 +2007,44 @@ static void S2_send_nls_state_get(struct S2* p_context, s2_connection_t* con)
19052007
S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_GET_LENGTH);
19062008
}
19072009

1908-
static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con)
2010+
static void S2_prepare_nls_node_list_get(uint8_t *buf, bool request)
2011+
{
2012+
buf[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2;
2013+
buf[SECURITY_2_COMMAND_POS] = NLS_NODE_LIST_GET_V2;
2014+
buf[SECURITY_2_V2_NLS_NODE_LIST_GET_REQUEST_POS] = (uint8_t)request;
2015+
}
2016+
2017+
static void S2_send_nls_node_list_get(struct S2* p_context, s2_connection_t* con, bool request)
19092018
{
19102019
CTX_DEF
19112020

1912-
uint8_t plain_text[SECURITY_2_V2_NLS_STATE_REPORT_LENGTH] = { 0 };
1913-
uint8_t nls_bitfield;
1914-
nls_bitfield = SECURITY_2_V2_NLS_STATE_REPORT_CAPABILITY_FIELD | (ctxt->nls_state ? SECURITY_2_V2_NLS_STATE_REPORT_STATE_FIELD : 0); // A node sending this frame will always support NLS
1915-
plain_text[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2;
1916-
plain_text[SECURITY_2_COMMAND_POS] = NLS_STATE_REPORT_V2;
1917-
plain_text[SECURITY_2_V2_NLS_STATE_REPORT_BITFIELD_POS] = nls_bitfield;
2021+
uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH] = { 0 };
19182022

1919-
S2_send_data(ctxt, con, plain_text, SECURITY_2_V2_NLS_STATE_REPORT_LENGTH);
1920-
}
2023+
S2_prepare_nls_node_list_get(buf, request);
2024+
2025+
S2_send_data(ctxt, con, buf, SECURITY_2_V2_NLS_NODE_LIST_GET_LENGTH);
2026+
}
2027+
2028+
static void S2_prepare_nls_node_list_report(uint8_t *buf, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state)
2029+
{
2030+
buf[SECURITY_2_COMMAND_CLASS_POS] = COMMAND_CLASS_SECURITY_2_V2;
2031+
buf[SECURITY_2_COMMAND_POS] = NLS_NODE_LIST_REPORT_V2;
2032+
buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LAST_NODE_POS] = (uint8_t)is_last_node;
2033+
buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_MSB_POS] = (node_id >> 8) & 0xFF;
2034+
buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NODE_ID_LSB_POS] = (node_id >> 0) & 0xFF;
2035+
buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_GRANTED_KEYS_POS] = granted_keys;
2036+
buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_NLS_STATE_POS] = nls_state;
2037+
}
2038+
2039+
static void S2_send_nls_node_list_report(struct S2* p_context, s2_connection_t* con, bool is_last_node, uint16_t node_id, uint8_t granted_keys, uint8_t nls_state)
2040+
{
2041+
CTX_DEF
2042+
2043+
uint8_t buf[SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH] = { 0 };
2044+
2045+
S2_prepare_nls_node_list_report(buf, is_last_node, node_id, granted_keys, nls_state);
2046+
2047+
S2_send_data(ctxt, con, buf, SECURITY_2_V2_NLS_NODE_LIST_REPORT_LENGTH);
2048+
}
2049+
2050+
#endif

0 commit comments

Comments
 (0)