Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
5884ef61
Commit
5884ef61
authored
Jul 04, 2017
by
Adam Wujek
💬
Committed by
Grzegorz Daniluk
Jul 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/lldp: fix formating
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
c81b799e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
lldp.c
lib/lldp.c
+12
-15
No files found.
lib/lldp.c
View file @
5884ef61
...
...
@@ -17,6 +17,7 @@
#include "endpoint.h"
#include "ipv4.h"
#include "shell.h"
#include <wrpc.h>
/*needed for htons()*/
static
char
lldpdu
[
LLDP_PKT_LEN
];
static
uint16_t
lldpdu_len
;
...
...
@@ -38,10 +39,6 @@ static void lldp_header_tlv(int tlv_type) {
lldpdu_len
+=
LLDP_HEADER
;
}
#ifndef htons
#define htons(x) x
#endif
static
void
lldp_add_tlv
(
int
tlv_type
)
{
unsigned
char
mac
[
6
];
...
...
@@ -138,7 +135,7 @@ static void lldp_init(void)
struct
wr_sockaddr
saddr
;
int
i
;
/* LLDP: raw ethernet*/
/* LLDP: raw ethernet*/
memset
(
&
saddr
,
0x0
,
sizeof
(
saddr
));
saddr
.
ethertype
=
htons
(
LLDP_ETH_TYP
);
...
...
@@ -158,7 +155,7 @@ static void lldp_init(void)
/* add optional TLVs */
lldp_add_tlv
(
MNG_ADD
);
/* end TLVs */
/* end TLVs */
lldp_add_tlv
(
END_LLDP
);
}
...
...
@@ -167,19 +164,19 @@ static void lldp_poll(void)
static
int
ticks
;
/* periodic tasks */
if
(
ticks
>
LLDP_TX_FQ
)
{
if
(
ticks
>
LLDP_TX_FQ
)
{
if
(
HAS_IP
&
(
ip_status
!=
IP_TRAINING
))
{
lldp_add_tlv
(
PORT
);
/* update other dynamic TLVs */
}
if
(
HAS_IP
&
&
(
ip_status
!=
IP_TRAINING
))
{
lldp_add_tlv
(
PORT
);
/* update other dynamic TLVs */
}
ptpd_netif_sendto
(
lldp_socket
,
&
addr
,
lldpdu
,
LLDP_PKT_LEN
,
0
);
ticks
=
0
;
}
else
ticks
+=
1
;
ticks
=
0
;
}
else
{
ticks
+=
1
;
}
}
DEFINE_WRC_TASK
(
lldp
)
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment