gomemif: Add mode support
Type: feature Change-Id: I0bc51288bc63a0583b98314e4e2a62383b0d6e43 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
This commit is contained in:

committed by
Beno�t Ganne

parent
a1400cecb8
commit
176373caed
@ -375,7 +375,6 @@ func (socket *Socket) addListener() (err error) {
|
|||||||
return fmt.Errorf("Failed to create UNIX domain socket")
|
return fmt.Errorf("Failed to create UNIX domain socket")
|
||||||
}
|
}
|
||||||
usa := &syscall.SockaddrUnix{Name: socket.filename}
|
usa := &syscall.SockaddrUnix{Name: socket.filename}
|
||||||
|
|
||||||
// Bind to address and start listening
|
// Bind to address and start listening
|
||||||
err = syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_PASSCRED, 1)
|
err = syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_PASSCRED, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -518,7 +517,7 @@ func (cc *controlChannel) msgEnqInit() (err error) {
|
|||||||
init := MsgInit{
|
init := MsgInit{
|
||||||
Version: Version,
|
Version: Version,
|
||||||
Id: cc.i.args.Id,
|
Id: cc.i.args.Id,
|
||||||
Mode: interfaceModeEthernet,
|
Mode: cc.i.args.Mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(init.Name[:], []byte(cc.socket.appName))
|
copy(init.Name[:], []byte(cc.socket.appName))
|
||||||
|
@ -71,6 +71,7 @@ type MemoryConfig struct {
|
|||||||
type Arguments struct {
|
type Arguments struct {
|
||||||
Id uint32 // Interface identifier unique across socket. Used to identify peer interface when connecting
|
Id uint32 // Interface identifier unique across socket. Used to identify peer interface when connecting
|
||||||
IsMaster bool // Interface role master/slave
|
IsMaster bool // Interface role master/slave
|
||||||
|
Mode interfaceMode
|
||||||
Name string
|
Name string
|
||||||
Secret [24]byte // optional parameter, secrets of the interfaces must match if they are to connect
|
Secret [24]byte // optional parameter, secrets of the interfaces must match if they are to connect
|
||||||
MemoryConfig MemoryConfig
|
MemoryConfig MemoryConfig
|
||||||
|
@ -52,9 +52,9 @@ const (
|
|||||||
type interfaceMode uint8
|
type interfaceMode uint8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
interfaceModeEthernet interfaceMode = iota
|
InterfaceModeEthernet interfaceMode = iota
|
||||||
interfaceModeIp
|
InterfaceModeIp
|
||||||
interfaceModePuntInject
|
InterfaceModePuntInject
|
||||||
)
|
)
|
||||||
|
|
||||||
const msgSize = 128
|
const msgSize = 128
|
||||||
|
Reference in New Issue
Block a user