func (a *AddrPort) String() string {
	if a.Name == "" {
		return net.JoinHostPort(a.Addr, a.Port)
	}
	return net.JoinHostPort(a.Name, a.Port)
}
String returns the string representation of the AddrPort.
package tcpflow
import (
	"encoding/json"
	"fmt"
	"net"
	"strconv"
	"github.com/yuuki/lstf/netutil"
)
type FlowDirection int
const (
	FlowUnknown FlowDirection = 1 << iota
	FlowActive
	FlowPassive
	FilterAll     = "all"
	FilterPublic  = "public"
	FilterPrivate = "private"
)
func (c FlowDirection) String() string {
	switch c {
	case FlowActive:
		return "active"
	case FlowPassive:
		return "passive"
	case FlowUnknown:
		return "unknown"
	}
	return ""
}
func (c FlowDirection) MarshalJSON() ([]byte, error) {
	return json.Marshal(c.String())
}
type AddrPort struct {
	Name string `json:"name"`
	Addr string `json:"addr"`
	Port string `json:"port"`
}