ethtool.h

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 15 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Linux/Ethtool/Constants.pm ↑ Summary lib/Linux/Ethtool.xs »
1 #include <sys/types.h>
2 #include <sys/socket.h>
3 #include <sys/ioctl.h>
4 #include <net/if.h>
5 #include <linux/ethtool.h>
6 #include <linux/sockios.h>
7  
8 0 static int _do_ioctl(const char *dev, void *data)
9 {
10 0 int sock = socket(AF_INET, SOCK_DGRAM, 0);
11 0 ▶ if(sock == -1)
Branch: 1 branch
BranchTrueFalseTotal
if(sock == -1) 0 0 0
12 {
13 0 return 0;
14 }
15
16 struct ifreq ifr;
17 0 strcpy(ifr.ifr_name, dev);
18 0 ifr.ifr_data = data;
19
20 0 ▶ if(ioctl(sock, SIOCETHTOOL, &ifr) == -1)
Branch: 1 branch
BranchTrueFalseTotal
if(ioctl(sock, SIOCETHTOOL, &ifr) == -1) 0 0 0
21 {
22 0 close(sock);
23 0 return 0;
24 }
25
26 0 close(sock);
27 0 return 1;
28 }
« blib/lib/Linux/Ethtool/Constants.pm ↑ Summary lib/Linux/Ethtool.xs »