Skip to content

Export inode field of SockTabEntry #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cakturk/go-netstat
module github.com/eyalasulin999/go-netstat

go 1.13
2 changes: 1 addition & 1 deletion netstat/netstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions netstat/netstat_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down