ladvd icon indicating copy to clipboard operation
ladvd copied to clipboard

I'd like to get PLATFORM and DUPLEX added to the "batch" mode (-b option to ladvdc)

Open quakec opened this issue 8 years ago • 5 comments

I've modified output as below, created defs in the headers and also added code to cdp.c to add the values to the struct msg. At runtime I get no output what so ever when I run 'ladvdc -b eth0'. I'm new to Cpp and was hoping you could point me in the right direction.

printf("INTERFACE_%u='%s'\n", count, STR(msg->name));
printf("HOSTNAME_%u='%s'\n", count, STR(peer_host));
printf("PLATFORM_%u='%s'\n", count, STR(peer_platform));
printf("PORTNAME_%u='%s'\n", count, STR(peer_portname));
printf("PORTDESCR_%u='%s'\n", count, STR(peer_portdescr));
printf("DUPLEX_%u='%s'\n", count, STR(peer_duplex));
printf("PROTOCOL_%u='%s'\n", count, protos[msg->proto].name);
printf("ADDR_INET4_%u='%s'\n", count, STR(msg->peer[PEER_ADDR_INET4]));
printf("ADDR_INET6_%u='%s'\n", count, STR(msg->peer[PEER_ADDR_INET6]));
printf("ADDR_802_%u='%s'\n", count, STR(msg->peer[PEER_ADDR_802]));
printf("VLAN_ID_%u='%s'\n", count, STR(msg->peer[PEER_VLAN_ID]));
printf("CAPABILITIES_%u='%s'\n", count, STR(cap));
printf("TTL_%u='%" PRIu16 "'\n", count, msg->ttl);
printf("HOLDTIME_%u='%" PRIu16 "'\n", count, holdtime);

quakec avatar Feb 17 '17 21:02 quakec

I have figured it out now. Also new to Linux and wasn't running my version of the service after compiling :)

quakec avatar Feb 18 '17 09:02 quakec

Care to share your diff? Perhaps it's useful to add to ladvd.

sspans avatar Apr 20 '17 16:04 sspans

I've forked your dist, only three files changed so I've also contained them in a tarball here... ladvd-1.1.0.001.tar.gz

quakec avatar May 21 '17 17:05 quakec

Ack, I'll take a look at the diff. Hopefully this can be merged for the next release.

sspans avatar May 21 '17 20:05 sspans

Great stuff, not a lot changed really. I couldn't achieve what I wanted in the end because I didn't know how move string data in C

On Sun, 21 May 2017 at 21:00, Sten Spans [email protected] wrote:

Ack, I'll take a look at the diff. Hopefully this can be merged for the next release.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/sspans/ladvd/issues/26#issuecomment-302959357, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtJb3QZ_K3gVaPBOivhzUVDK4cy0-OHks5r8JfXgaJpZM4MEvky .

-- Sent from my iPhone

quakec avatar May 22 '17 14:05 quakec