// srcByPort sets the address with the given port number as the source address
// in the TCPTuple.  If neither address has the given port or if both do it is
// considered an error and nothing is changed.
srcByPort sets the address with the given port number as the source address
in the TCPTuple.  If neither address has the given port or if both do it is
considered an error and nothing is changed.
// srcByPort sets the address with the given port number as the source address // in the TCPTuple . If neither address has the given port or if both do it is // considered an error and nothing is changed .
func (t *TCPTuple) srcByPort(p int) error {
	if t.Src.Port != p {
		if t.Dst.Port != p {
			return ErrBadPort
		}
		tmp := t.Src
		t.Src = t.Dst
		t.Dst = tmp
	}
	if t.Dst.Port == p {
		return ErrSameSrcDstPorts
	}
	return nil
}
func ( t * TCPTuple ) srcByPort ( p int ) error { if t . Src . Port != p { if t . Dst . Port != p { return ErrBadPort } tmp := t . Src t . Src = t . Dst t . Dst = tmp } if t . Dst . Port == p { return ErrSameSrcDstPorts } return nil }
srcByPort sets the address with the given port number as the source address
in the TCPTuple.
srcByPort sets the address with the given port number as the source address in the TCPTuple .