2022-04-09 14:30:36 +00:00
|
|
|
package constant
|
|
|
|
|
|
|
|
type Sniffer interface {
|
|
|
|
SupportNetwork() NetWork
|
|
|
|
SniffTCP(bytes []byte) (string, error)
|
|
|
|
Protocol() string
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
TLS SnifferType = iota
|
2022-05-01 21:34:20 +00:00
|
|
|
HTTP SnifferType
|
2022-04-09 14:30:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-05-01 21:10:18 +00:00
|
|
|
SnifferList = []SnifferType{TLS, HTTP}
|
2022-04-09 14:30:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type SnifferType int
|
|
|
|
|
|
|
|
func (rt SnifferType) String() string {
|
|
|
|
switch rt {
|
|
|
|
case TLS:
|
|
|
|
return "TLS"
|
2022-05-01 21:10:18 +00:00
|
|
|
case HTTP:
|
|
|
|
return "HTTP"
|
2022-04-09 14:30:36 +00:00
|
|
|
default:
|
|
|
|
return "Unknown"
|
|
|
|
}
|
|
|
|
}
|