| Summary: | getifaddrs: Missing struct net_device_stats in linux/netdevice.h | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | fireboxled |
| Component: | Networking | Assignee: | Bernhard Reutner-Fischer <aldot> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
fireboxled
2011-05-16 14:20:59 UTC
Workaround:
In a application .h:
#ifdef __UCLIBC__
struct net_device_stats {unsigned long rx_packets; unsigned long tx_packets; /* and then some... */};
#endif
Suggested Solution:
Add the struct definition in <linux/netdevice.h>
struct net_device_stats
{
unsigned long rx_packets; /* total packets received */
unsigned long tx_packets; /* total packets transmitted */
unsigned long rx_bytes; /* total bytes received */
unsigned long tx_bytes; /* total bytes transmitted */
unsigned long rx_errors; /* bad packets received */
unsigned long tx_errors; /* packet transmit problems */
unsigned long rx_dropped; /* no space in linux buffers */
unsigned long tx_dropped; /* no space available in linux */
unsigned long multicast; /* multicast packets received */
unsigned long collisions;
/* detailed rx_errors: */
unsigned long rx_length_errors;
unsigned long rx_over_errors; /* receiver ring buff overflow */
unsigned long rx_crc_errors; /* recved pkt with crc error */
unsigned long rx_frame_errors; /* recv'd frame alignment error */
unsigned long rx_fifo_errors; /* recv'r fifo overrun */
unsigned long rx_missed_errors; /* receiver missed packet */
/* detailed tx_errors */
unsigned long tx_aborted_errors;
unsigned long tx_carrier_errors;
unsigned long tx_fifo_errors;
unsigned long tx_heartbeat_errors;
unsigned long tx_window_errors;
/* for cslip etc */
unsigned long rx_compressed;
unsigned long tx_compressed;
};
When using buildroot, uClibc needs to be configured with the UCLIBC_SUPPORT_AI_ADDRCONFIG option (make uclibc-menuconfig, then Networking/Support the AI_ADDRCONFIG flag). This is how support for getifaddrs() and <ifaddrs.h> are made available. Upstream commit changed <linux/netdevice.h> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be1f3c2c027cc5ad735df6a45a542ed1db7ec48b Seems like I need <linux/if_link.h>, struct rtnl_link_stats instead. |