Commit 8665535e authored by Adam Wujek's avatar Adam Wujek 💬 Committed by Grzegorz Daniluk

lib/lldp.c: no technical change, change indentation

Change indentation of switch statement.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent a62a8c85
......@@ -88,8 +88,7 @@ static void lldp_add_tlv(int tlv_type) {
/* TLV Time to Live */
/* use LLDP_TX_TICK_INTERVAL in seconds times 4 */
lldpdu[lldpdu_len + TTL_BYTE_MSB] =
(((LLDP_TX_TICK_INTERVAL / 1000) * 4) >> 8)
& 0xff;
(((LLDP_TX_TICK_INTERVAL / 1000) * 4) >> 8) & 0xff;
lldpdu[lldpdu_len + TTL_BYTE_LSB] =
((LLDP_TX_TICK_INTERVAL / 1000) * 4) & 0xff;
break;
......@@ -105,8 +104,8 @@ static void lldp_add_tlv(int tlv_type) {
/* TODO get host system name from wr-core outer world */
/* NOTE: according to 802.1AB-2005 9.5.6.2 and then
* IETF RFC 3418:
* "If the name is unknown, the value is
* the zero-length string."
* "If the name is unknown, the value is the zero-length
* string."
* However, we put the IP, if not set MAC to be able to
* identify a system */
char buf[32];
......@@ -142,15 +141,13 @@ static void lldp_add_tlv(int tlv_type) {
pdu_p = &lldpdu[lldpdu_len + LLDP_HEADER];
/* TLV Info srting */
strncpy((char *)(pdu_p), wrc_hw_name,
HW_NAME_LENGTH - 1);
strncpy((char *)(pdu_p), wrc_hw_name, HW_NAME_LENGTH - 1);
pdu_p += strnlen(wrc_hw_name, HW_NAME_LENGTH - 1);
strcpy((char *)(pdu_p), ": ");
pdu_p += 2; /* length of ": " */
strncpy((char *)(pdu_p), build_revision, 32);
pdu_p += strnlen(build_revision, 32);
tlv_len =
(uint8_t)(pdu_p - &lldpdu[lldpdu_len + LLDP_HEADER]);
tlv_len = (uint8_t)(pdu_p - &lldpdu[lldpdu_len + LLDP_HEADER]);
lldp_header_tlv(tlv_type, tlv_len);
break;
......@@ -180,7 +177,8 @@ static void lldp_add_tlv(int tlv_type) {
/* mngt add subtype */
lldpdu[lldpdu_len + LLDP_SUBTYPE] = MNG_ADDR_SUBTYPE_IPv4;
/* if subtype (ifIndex)*/
lldpdu[lldpdu_len + MNT_IF_SUBTYPE] = MNG_IF_NUM_SUBTYPE_IFINDEX;
lldpdu[lldpdu_len + MNT_IF_SUBTYPE] =
MNG_IF_NUM_SUBTYPE_IFINDEX;
/* if number */
lldpdu[lldpdu_len + MNT_IF_NUM] = 0x1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment