// NewFlowMod creates a flow modification message based on the specified
// packet-in message.
//
// It is responsibility of the caller to assign the missing instructions
// and the rest of parameters.
170391
func NewFlowMod(c FlowModCommand, p *PacketIn) *FlowMod {
	var flags FlowModFlag

	switch c {
	case FlowDelete, FlowDeleteStrict:
		// For flow delete requests we cannot set the same flags
		// as for flow insertion and modification.
	default:
		// Use the overlap checking and flow removed notification
		// flags by default for generated message.
		flags = FlowFlagSendFlowRem
	}

	// When the packet-in message was not provided into
	// the constructor, we will use the default values.
	buffer := NoBuffer
	var match Match

	if p != nil {
		buffer, match = p.Buffer, p.Match
	}

	return &FlowMod{
		Command: c,
		Buffer:  buffer,
		Match:   match,
		Flags:   flags,

		// For FlowDelete command, define the output port and
		// group values as "any" to indicate no restrictions.
		OutPort:  PortAny,
		OutGroup: GroupAny,
	}
}
188478
func NewGroupMod() *GroupMod {
	g := new(GroupMod)
	g.Header = NewOfp13Header()
	g.Header.Type = Type_GroupMod

	g.Command = OFPGC_ADD
	g.Type = OFPGT_ALL
	g.GroupId = 0
	g.Buckets = make([]Bucket, 0)
	return g
}
368467
func NewMessage(addr string, args ...interface{}) *Message {
	return &Message{Address: addr, Arguments: args}
}
778540
func NewActionStackFrom(a ActionStackInterface, mod ActionMod) *ActionStack {
	d, e := mod(a)
	return &ActionStack{
		d,
		e,
	}
}
811379
func newBlockNode(blockHeader *wire.BlockHeader, parent *blockNode) *blockNode {
	var node blockNode
	initBlockNode(&node, blockHeader, parent)
	return &node
}
869921
func NewMsgFilterLoad(filter []byte, hashFuncs uint32, tweak uint32, flags BloomUpdateType) *MsgFilterLoad {
	return &MsgFilterLoad{
		Filter:    filter,
		HashFuncs: hashFuncs,
		Tweak:     tweak,
		Flags:     flags,
	}
}
592367
func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
	// Reset the simple key on the next level.
	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})

	// Increase the flow level.
	parser.flow_level++
	return true
}
250228
func NewCommand(module Module, usedModules ...Module) *cli.Command {
	flags := []cli.Flag{}
	flags = append(flags, module.Flags...)
	flags = append(flags, module.Depend.Flags(usedModules...)...)

	beforeActions := Actions{}
	beforeActions.Add(module.Depend.BeforeActions()...)
	beforeActions.Add(module.Before)
	actions := Actions{}
	actions.Add(module.Depend.Actions()...)
	actions.Add(module.Action)
	afterActions := Actions{}
	afterActions.Add(module.After)
	afterActions.Add(module.Depend.AfterActions()...)

	return &cli.Command{
		Name:   module.Name,
		Usage:  module.Usage,
		Flags:  flags,
		Before: cli.BeforeFunc(beforeActions.Wrap()),
		Action: actions.Wrap(),
		After:  cli.AfterFunc(afterActions.Wrap()),
	}
}
114999
func invMod(x *big.Int, p *big.Int) (z *big.Int) {
	z = new(big.Int).ModInverse(x, p)
	return z
}
189983
func NewPINGRESPFromBytes(fixedHeader FixedHeader, remaining []byte) (Packet, error) {
	// Validate the byte data.
	if err := validatePINGRESPBytes(fixedHeader, remaining); err != nil {
		return nil, err
	}

	// Create a PINGRESP Packet.
	p := &PINGRESP{}

	// Set the fixed header to the Packet.
	p.fixedHeader = fixedHeader

	// Return the Packet.
	return p, nil
}
1082657
func AddBlockMessage(message Message, newBlk Block) Message {
	message.Msg.Blocks = append(message.Msg.Blocks, newBlk)
	return message
}
880755
func (e *Env) NewModule(n string) *Env {
	m := &Env{
		env:    make(map[string]reflect.Value),
		typ:    make(map[string]reflect.Type),
		parent: e,
		name:   n,
	}
	e.Define(n, m)
	return m
}
1305957
func (b *BigIP) ModifyRouteDomain(name string, config *RouteDomain) error {
	return b.put(config, uriNet, uriRouteDomain, name)
}
653435
func NewConnectionFlowController(
	receiveWindow protocol.ByteCount,
	maxReceiveWindow protocol.ByteCount,
	queueWindowUpdate func(),
	rttStats *congestion.RTTStats,
	logger utils.Logger,
) ConnectionFlowController {
	return &connectionFlowController{
		baseFlowController: baseFlowController{
			rttStats:             rttStats,
			receiveWindow:        receiveWindow,
			receiveWindowSize:    receiveWindow,
			maxReceiveWindowSize: maxReceiveWindow,
			logger:               logger,
		},
		queueWindowUpdate: queueWindowUpdate,
	}
}
538409
func (tx *Transaction) AddFlow(flow string, args ...interface{}) {
	if len(args) > 0 {
		flow = fmt.Sprintf(flow, args...)
	}
	tx.ofctlExec("add-flow", tx.bridge, flow)
}
140309
func NewMockModule(ctrl *gomock.Controller) *MockModule {
	mock := &MockModule{ctrl: ctrl}
	mock.recorder = &MockModuleMockRecorder{mock}
	return mock
}
1170451
func (f *Flow) Send(pkts ...packet.Generic) *Flow {
	f.add(action{
		kind:    actionSend,
		packets: pkts,
	})

	return f
}