Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| ifreq_ethtool [2018/09/02 06:52] – rpjday | ifreq_ethtool [2018/09/02 06:56] (current) – [Userspace and struct ifreq] rpjday | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * [[https:// | * [[https:// | ||
| - | ===== struct ifreq ===== | + | ===== Userspace and struct ifreq ===== |
| + | |||
| + | From ethtool' | ||
| + | |||
| + | < | ||
| + | /* Context for sub-commands */ | ||
| + | struct cmd_context { | ||
| + | const char *devname; | ||
| + | int fd; /* socket suitable for ethtool ioctl */ | ||
| + | struct ifreq ifr; /* ifreq suitable for ethtool ioctl */ | ||
| + | int argc; /* number of arguments to the sub-command */ | ||
| + | char **argp; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | and from '' | ||
| + | |||
| + | < | ||
| + | #ifndef TEST_ETHTOOL | ||
| + | int send_ioctl(struct cmd_context *ctx, void *cmd) | ||
| + | { | ||
| + | ctx-> | ||
| + | return ioctl(ctx-> | ||
| + | } | ||
| + | #endif | ||
| + | </ | ||
| From '' | From '' | ||