Akshay
Akshay

Reputation: 329

Data-link layer libraries linux kernel

I am implementing a routing protocol. For this to work, I need to know failures at the data-link layer. Are there libraries available irrespective of the underlying data-link layer protocol, which gives me hooks (like netfilter) to capture such information.

Since, this is an experiment on the protocol, I'm trying to find if there is anything that is available so that it can be implemented on the user-space rather than writing a kernel-module for the same.(Since, I'm totally new to kernel programming)

Any heads-up for the same will be really helpful.

Upvotes: 0

Views: 870

Answers (1)

xzhao28
xzhao28

Reputation: 406

Just a guess:

you can view sysfs entries ( suppose you have sysfs configured in your kernel) about your network interface, like:

cat /sys/class/net/eth0/carrier # link carrier status 1

cat /sys/class/net/eth0/operstate # should be also related, but up # forget about what it means.

Upvotes: 1

Related Questions