feat(keep-alive): add keep-alive option
This commit is contained in:
@@ -8,17 +8,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func GenerateOutputPaths(outputDir, upstream string, dnssec bool) (jsonPath, pcapPath string) {
|
||||
func GenerateOutputPaths(outputDir, upstream string, dnssec, keepAlive bool) (jsonPath, pcapPath string) {
|
||||
proto := DetectProtocol(upstream)
|
||||
serverName := ExtractServerName(upstream)
|
||||
ts := time.Now().Format("20060102_1504")
|
||||
dnssecStr := map[bool]string{true: "on", false: "off"}[dnssec]
|
||||
keepAliveStr := map[bool]string{true: "on", false: "off"}[keepAlive]
|
||||
|
||||
base := fmt.Sprintf("%s_%s_dnssec_%s_%s",
|
||||
proto, sanitize(serverName), dnssecStr, ts)
|
||||
base := fmt.Sprintf("%s_%s_dnssec_%s_keepalive_%s_%s",
|
||||
proto, sanitize(serverName), dnssecStr, keepAliveStr, ts)
|
||||
|
||||
return filepath.Join(outputDir, base+".jsonl"),
|
||||
filepath.Join(outputDir, base+".pcap")
|
||||
filepath.Join(outputDir, base+".pcap")
|
||||
}
|
||||
|
||||
func sanitize(s string) string {
|
||||
|
||||
Reference in New Issue
Block a user