c - get an ioctl file descriptor for ethernet port -
To use the IOctl () call in the Ethernet port in Linux, I need to get the file descriptor
To ensure that For how to do it.
Use the file descriptor of an open socket using the name of the file ifreq structure in
ioctl ()
, assume that your program has sufficient permissions to do this.
From Docs:
Supports some standard ioctls for configuring Linux network devices. Regardless of family or type, they can be used on a file descriptor of a socket. They pass an IREAC composition:
The socket should not be bound to the target device, or should be of a specific family. Open any socket FD (again, with the appropriate privileges), just open one for your specific work, wait for the return of ioctl ()
and close it.
See Man 7 NetVoice
for more, or if you do not have the proper documentation package installed (signals, packages are typically manpages-dev
Or manpages-devel
, depending on your disto)
You can also look at the source code in the net-device
package, Can be named separately on the basis of Sorry for the original ambiguity, I thought that you would configure a special multi-function device Trying to do it (not sure why now, maybe lack of sleep).
Comments
Post a Comment