Skip to content

Commit

Permalink
Merge pull request #61 from safchain/update-doc
Browse files Browse the repository at this point in the history
update readme and doc
  • Loading branch information
safchain committed Mar 9, 2023
2 parents 02fff4c + 310c832 commit 436ddbf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
[![GoDoc](https://godoc.org/github.com/safchain/ethtool?status.svg)](https://godoc.org/github.com/safchain/ethtool)


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.
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.

## Build and Test ##
# Installation

go get command:

go get github.com/safchain/ethtool

Testing

In order to run te

go test github.com/safchain/ethtool
```shell
go get github.com/safchain/ethtool
```

## Examples ##
# How to use

```go
package main
Expand Down
24 changes: 13 additions & 11 deletions ethtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*
*/

// Package ethtool 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.
// 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.
package ethtool

import (
Expand All @@ -47,12 +47,14 @@ const (

// ethtool stats related constants.
const (
ETH_GSTRING_LEN = 32
ETH_SS_STATS = 1
ETH_SS_FEATURES = 4
ETHTOOL_GDRVINFO = 0x00000003
ETHTOOL_GSTRINGS = 0x0000001b
ETHTOOL_GSTATS = 0x0000001d
ETH_GSTRING_LEN = 32
ETH_SS_STATS = 1
ETH_SS_FEATURES = 4

// CMD supported
ETHTOOL_GDRVINFO = 0x00000003 /* Get driver info. */
ETHTOOL_GSTRINGS = 0x0000001b /* get specified string set */
ETHTOOL_GSTATS = 0x0000001d /* get NIC-specific statistics */
// other CMDs from ethtool-copy.h of ethtool-3.5 package
ETHTOOL_GSET = 0x00000001 /* Get settings. */
ETHTOOL_SSET = 0x00000002 /* Set settings. */
Expand All @@ -66,7 +68,7 @@ const (
ETHTOOL_GLINK = 0x0000000a
ETHTOOL_GMODULEINFO = 0x00000042 /* Get plug-in module information */
ETHTOOL_GMODULEEEPROM = 0x00000043 /* Get plug-in module eeprom */
ETHTOOL_GPERMADDR = 0x00000020
ETHTOOL_GPERMADDR = 0x00000020 /* Get permanent hardware address */
ETHTOOL_GFEATURES = 0x0000003a /* Get device offload settings */
ETHTOOL_SFEATURES = 0x0000003b /* Change device offload settings */
ETHTOOL_GFLAGS = 0x00000025 /* Get flags bitmap(ethtool_value) */
Expand Down

0 comments on commit 436ddbf

Please sign in to comment.