Is there any way to get rx_broadcast value from /sys/class/net//..?
No, as it says at
Each device directory in sysfs contains a statistics directory
(e.g. /sys/class/net/lo/statistics/) with files corresponding to
members of struct rtnl_link_stats64.
rtnl_link_stats64 doesn't have a field representing
Notice that there is a ready to use tool called
at https://git.kernel.org/pub/scm/network/ethtool/ethtool.git that you
can use in your script:
$ ethtool -S eth0 | grep rx_broadcast
If you don't want to add new programs to your system or write C
programs that use
ioctl() you have to use another scripting language
that is available on your system and has ioctl support built-in, for
example ethtool -S in