mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
8ca185e2ee
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
35 lines
632 B
Go
35 lines
632 B
Go
package bridge
|
|
|
|
type SetupStep func(*Interface) error
|
|
|
|
type BridgeSetup struct {
|
|
bridge *Interface
|
|
steps []SetupStep
|
|
}
|
|
|
|
func NewBridgeSetup(i *Interface) *BridgeSetup {
|
|
return &BridgeSetup{bridge: i}
|
|
}
|
|
|
|
func (b *BridgeSetup) Apply() error {
|
|
for _, fn := range b.steps {
|
|
if err := fn(b.bridge); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (b *BridgeSetup) QueueStep(step SetupStep) {
|
|
b.steps = append(b.steps, step)
|
|
}
|
|
|
|
//---------------------------------------------------------------------------//
|
|
|
|
func SetupIPTables(i *Interface) error {
|
|
return nil
|
|
}
|
|
|
|
func SetupIPForwarding(i *Interface) error {
|
|
return nil
|
|
}
|