[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Porting lldpd



 ❦ 25 septembre 2013 00:15 CEST, Samuel Thibault <sthibault@debian.org> :

>> To get information from the system, currently, I plan to rely on
>> getifaddrs() to get the list of interfaces as well as their IP
>> addresses.
>
> Yes, that part should work.

It seems that AF_LINK is unimplemented. What is the right way to get the
MAC address of an interface?

>> I also need to receive and send raw Ethernet packets. tcpdump does seem
>> to be able to receive packets with Hurd. Maybe I could just read
>> /dev/eth0 but it would be better to be able to provide a BPF
>> filter. From what I have gathered, I would need something like
>> eth-filter. Is that the right way to go?
>> 
>>  settrans -c /var/run/lldpd/dev/lldpd-eth0 /hurd/eth-filter \
>>      -i /dev/eth0 -r "some filter" -s "some filter"
>
> Well, that's a way to do it indeed.  You however may want to simply
> directly open eth0 and apply the BPF filter, without an intermediary
> translator doing it. That depends on your workflow.

I am reading the documentation about ports library. Do I have to create
a port or can I just open the master device of the interface I want to
use and use that to read/write?

I see that I get some device_t/mach_port_t stuff. Is there a way to get
a simple file descriptor of it? This would allow to select() on it or to
pass it around via Unix sockets.
-- 
Make sure comments and code agree.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: signature.asc
Description: PGP signature


Reply to: