Skip to content

Commit 436ddbf

Browse files
authored
Merge pull request #61 from safchain/update-doc
update readme and doc
2 parents 02fff4c + 310c832 commit 436ddbf

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@
44
[![GoDoc](https://godoc.org/github.com/safchain/ethtool?status.svg)](https://godoc.org/github.com/safchain/ethtool)
55

66

7-
The ethtool package aims to provide a library giving a simple access to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve informations from a network device like statistics, driver related informations or even the peer of a VETH interface.
7+
The ethtool package aims to provide a library that provides easy access to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve information from a network device such as statistics, driver related information or even the peer of a VETH interface.
88

9-
## Build and Test ##
9+
# Installation
1010

11-
go get command:
12-
13-
go get github.com/safchain/ethtool
14-
15-
Testing
16-
17-
In order to run te
18-
19-
go test github.com/safchain/ethtool
11+
```shell
12+
go get github.com/safchain/ethtool
13+
```
2014

21-
## Examples ##
15+
# How to use
2216

2317
```go
2418
package main

ethtool.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
*
2020
*/
2121

22-
// Package ethtool aims to provide a library giving a simple access to the
23-
// Linux SIOCETHTOOL ioctl operations. It can be used to retrieve informations
24-
// from a network device like statistics, driver related informations or
25-
// even the peer of a VETH interface.
22+
// The ethtool package aims to provide a library that provides easy access
23+
// to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve information
24+
// from a network device such as statistics, driver related information or even
25+
// the peer of a VETH interface.
2626
package ethtool
2727

2828
import (
@@ -47,12 +47,14 @@ const (
4747

4848
// ethtool stats related constants.
4949
const (
50-
ETH_GSTRING_LEN = 32
51-
ETH_SS_STATS = 1
52-
ETH_SS_FEATURES = 4
53-
ETHTOOL_GDRVINFO = 0x00000003
54-
ETHTOOL_GSTRINGS = 0x0000001b
55-
ETHTOOL_GSTATS = 0x0000001d
50+
ETH_GSTRING_LEN = 32
51+
ETH_SS_STATS = 1
52+
ETH_SS_FEATURES = 4
53+
54+
// CMD supported
55+
ETHTOOL_GDRVINFO = 0x00000003 /* Get driver info. */
56+
ETHTOOL_GSTRINGS = 0x0000001b /* get specified string set */
57+
ETHTOOL_GSTATS = 0x0000001d /* get NIC-specific statistics */
5658
// other CMDs from ethtool-copy.h of ethtool-3.5 package
5759
ETHTOOL_GSET = 0x00000001 /* Get settings. */
5860
ETHTOOL_SSET = 0x00000002 /* Set settings. */
@@ -66,7 +68,7 @@ const (
6668
ETHTOOL_GLINK = 0x0000000a
6769
ETHTOOL_GMODULEINFO = 0x00000042 /* Get plug-in module information */
6870
ETHTOOL_GMODULEEEPROM = 0x00000043 /* Get plug-in module eeprom */
69-
ETHTOOL_GPERMADDR = 0x00000020
71+
ETHTOOL_GPERMADDR = 0x00000020 /* Get permanent hardware address */
7072
ETHTOOL_GFEATURES = 0x0000003a /* Get device offload settings */
7173
ETHTOOL_SFEATURES = 0x0000003b /* Change device offload settings */
7274
ETHTOOL_GFLAGS = 0x00000025 /* Get flags bitmap(ethtool_value) */

0 commit comments

Comments
 (0)