Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plcstat/int6kstat: allow to query a powerline device for topology directly #119

Merged
merged 1 commit into from
Oct 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion plc/Topology1.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
signed Topology1 (struct plc * plc)

{
extern const byte localcast [ETHER_ADDR_LEN];
struct channel * channel = (struct channel *)(plc->channel);
struct message * message = (struct message *)(plc->message);

Expand Down Expand Up @@ -126,7 +127,16 @@ signed Topology1 (struct plc * plc)
#endif

byte list [255] [ETHER_ADDR_LEN];
signed bridges = LocalDevices (channel, message, list, sizeof (list));
signed bridges;
if (memcmp (channel->peer, localcast, sizeof (channel->peer)) != 0)
{
bridges = 1;
memcpy (&list, channel->peer, sizeof (channel->peer));
}
else
{
bridges = LocalDevices (channel, message, list, sizeof (list));
}
while (bridges--)
{
char address [ETHER_ADDR_LEN * 3];
Expand Down
12 changes: 11 additions & 1 deletion plc/Topology2.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
signed Topology2 (struct plc * plc)

{
extern const byte localcast [ETHER_ADDR_LEN];
struct channel * channel = (struct channel *)(plc->channel);
struct message * message = (struct message *)(plc->message);

Expand Down Expand Up @@ -141,7 +142,16 @@ signed Topology2 (struct plc * plc)
#endif

uint8_t list [255] [ETHER_ADDR_LEN];
signed bridges = LocalDevices (channel, message, list, sizeof (list));
signed bridges;
if (memcmp (channel->peer, localcast, sizeof (channel->peer)) != 0)
{
bridges = 1;
memcpy (&list, channel->peer, sizeof (channel->peer));
}
else
{
bridges = LocalDevices (channel, message, list, sizeof (list));
}
while (bridges--)
{
char address [ETHER_ADDR_LEN * 3];
Expand Down
17 changes: 9 additions & 8 deletions plc/int6kstat.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ int6kstat - Qualcomm Atheros INT6x00 Link Statistics

.SH SYNOPSIS
.BR int6kstat
.RI [ options ]
.RI [ device ]
.RI [ device ]
.RI [ options ]
.RI [ device ]
[...]

.SH DESCRIPTION
Expand All @@ -21,7 +20,7 @@ See the \fBplc\fR man page for an overview and installation instructions.
.SH OPTIONS

.TP
.RB -C
.RB - C
Clear device link statistics using VS_LNK_STATS.
Statistics are read and cleared then displayed.
The statistics that are read and displayed depend on options \fB-d\fR, \fB-p\fR and \fB-s\fR but all link statistics are cleared.
Expand Down Expand Up @@ -78,12 +77,14 @@ The default Link ID is \fB0xFC\fR.
.RB - t
Display network topology using VS_SW_VER and VS_NW_INFO messages.
This option is similar to option \fB-m\fR but provides complete network topology plus device hardware and firmware version.
Topology is always relative to the local host, or local hosts if present.
Powerline devices that appear on the command line are not used for this operation.
PHY rates displaye by this option may saturate at 255 mbps.
Topology is relative to the queried powerline device(s) given on the command line. If no device is given explicitly,
then it is tried to determine all local devices (you can also use \fBlocal\fR instead).
However, this can fail if you have the local powerline device(s) not directly connected but via a switch which
does not broadcast the Qualcomm Atheros vendor specific Local Management Address (LMA) to all ports.
PHY rates displayed by this option may saturate at 255 Mbps.

.TP
.RB - v
.RB - v
Enter verbose mode.
All Etherenet frames sent or received by the program are displayed on stdout.

Expand Down
15 changes: 8 additions & 7 deletions plc/plcstat.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ plcstat - Qualcomm Atheros AR7x00 Link Statistics

.SH SYNOPSIS
.BR plcstat
.RI [ options ]
.RI [ device ]
.RI [ device ]
.RI [ options ]
.RI [ device ]
[...]

.SH DESCRIPTION
Expand All @@ -26,7 +25,7 @@ Older firmware versions may not recognize this message version.
.SH OPTIONS

.TP
.RB -C
.RB - C
Clear device link statistics using VS_LNK_STATS.
Statistics are read and cleared then displayed.
The statistics that are read and displayed depend on options \fB-d\fR, \fB-p\fR and \fB-s\fR but all link statistics are cleared.
Expand Down Expand Up @@ -83,11 +82,13 @@ The default Link ID is \fB0xFC\fR.
.RB - t
Display network topology using VS_SW_VER and VS_NW_INFO messages.
This option is similar to option \fB-m\fR but provides complete network topology plus device hardware and firmware version.
Topology is always relative to the local host, or local hosts if present.
Powerline devices that appear on the command line are not used for this operation.
Topology is relative to the queried powerline device(s) given on the command line. If no device is given explicitly,
then it is tried to determine all local devices (you can also use \fBlocal\fR instead).
However, this can fail if you have the local powerline device(s) not directly connected but via a switch which
does not broadcast the Qualcomm Atheros vendor specific Local Management Address (LMA) to all ports.

.TP
.RB - v
.RB - v
Enter verbose mode.
All Etherenet frames sent or received by the program are displayed on stdout.

Expand Down