Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
example/ | H | 20-Apr-2016 | - | |||
LICENSE | H A D | 20-Apr-2016 | 11.1 KiB | |||
README.md | H A D | 20-Apr-2016 | 672 | |||
pingscanner.go | H A D | 20-Apr-2016 | 2.7 KiB | |||
version.go | H A D | 20-Apr-2016 | 130 |
README.md
1# pingscanner 2 3Scanning alive hosts of the given CIDR range in parallel. 4 5## Usage 6 7```go 8package main 9 10import ( 11 "fmt" 12 13 ps "github.com/kotakanbe/go-pingscanner" 14) 15 16func main() { 17 scanner := ps.PingScanner{ 18 CIDR: "192.168.11.0/24", 19 PingOptions: []string{ 20 "-c1", 21 "-t1", 22 }, 23 NumOfConcurrency: 100, 24 } 25 if aliveIPs, err := scanner.Scan(); err != nil { 26 fmt.Println(err) 27 } else { 28 if len(aliveIPs) < 1 { 29 fmt.Println("no alive hosts") 30 } 31 for _, ip := range aliveIPs { 32 fmt.Println(ip) 33 } 34 } 35} 36``` 37 38## Author 39 40[kotakanbe](https://github.com/kotakanbe) 41 42## License 43 44Please see [LICENSE](https://github.com/kotakanbe/go-pingscanner/blob/master/LICENSE). 45