diff --git a/go.mod b/go.mod index 86c4a3c..fa2d01d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/cakturk/go-netstat +module github.com/eyalasulin999/go-netstat go 1.13 diff --git a/netstat/netstat.go b/netstat/netstat.go index 4d95c51..5b93ef4 100644 --- a/netstat/netstat.go +++ b/netstat/netstat.go @@ -17,7 +17,7 @@ func (s *SockAddr) String() string { // SockTabEntry type represents each line of the /proc/net/[tcp|udp] type SockTabEntry struct { - ino string + Inode string LocalAddr *SockAddr RemoteAddr *SockAddr State SkState diff --git a/netstat/netstat_linux.go b/netstat/netstat_linux.go index 05fb56d..8b96c07 100644 --- a/netstat/netstat_linux.go +++ b/netstat/netstat_linux.go @@ -152,7 +152,7 @@ func parseSocktab(r io.Reader, accept AcceptFn) ([]SockTabEntry, error) { return nil, err } e.UID = uint32(u) - e.ino = fields[9] + e.Inode = fields[9] if accept(&e) { tab = append(tab, e) } @@ -202,7 +202,7 @@ func (p *procFd) iterFdDir() { for i := range p.sktab { sk := &p.sktab[i] - ss := sockPrefix + sk.ino + "]" + ss := sockPrefix + sk.Inode + "]" if ss != lname { continue }