Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cli.Command{ Category: "Misc", Name: "parser", Usage: "Parse some file", Commands: []*cli.Command{ { Name: "procnet", Aliases: []string{"net"}, Usage: "Parse /proc/net/tcp|udp", Flags: []cli.Flag{ &cli.StringFlag{ Name: "filepath", Aliases: []string{"f"}, Usage: "Which file for parse", }, }, Action: func(c *cli.Context) (err error) { filepath := c.String("filepath") if filepath == "" { if c.NArg() > 0 { filepath = c.Args().First() } else if data, err := utils.GetFromPipe(); err == nil { filepath = string(data) } else { return fmt.Errorf("invalid filepath") } } r, err := ParseProcNet(filepath) if err != nil { return err } _, err = fmt.Println(r) return }, }, DsStoreCmd, }, }
View Source
var DsStoreCmd = &cli.Command{ Name: "dsstore", Usage: ".DS_Store Parser", Action: func(c *cli.Context) (err error) { target := c.Args().First() if err := utils.ValidArg(target, "url|file"); err != nil { return err } r, err := DSStore(target) if err != nil { return err } _, err = fmt.Println(r) return }, }
View Source
var TcpState = map[string]string{
"01": "ESTABLISHED",
"02": "SYN-SENT",
"03": "SYN-RECEIVED",
"04": "FIN-WAIT-1",
"05": "FIN-WAIT-2",
"06": "TIME-WAIT",
"07": "CLOSED",
"08": "CLOSE-WAIT",
"09": "LAST-ACK",
"0A": "LISTEN",
"0B": "CLOSING",
"0C": "NEW-SYN-RECEIVED",
}
Functions ¶
func ParseProcNet ¶
ParseProcNet Parse /proc/net/tcp|udp
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.