X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=core%2Fcontrol_ping.go;h=ed8d274788d22463329f18e8834082dce0390fa6;hb=5de7f6b85458615fa592a335d45c546397f32c9a;hp=904068a8903c94fd9e74044654f6c98a0cf7a512;hpb=a3bb834db727a3ac9a1ffcfeae9265e5dead851f;p=govpp.git diff --git a/core/control_ping.go b/core/control_ping.go index 904068a..ed8d274 100644 --- a/core/control_ping.go +++ b/core/control_ping.go @@ -1,36 +1,41 @@ package core -import "git.fd.io/govpp.git/api" +import ( + "git.fd.io/govpp.git/api" +) var ( msgControlPing api.Message = new(ControlPing) msgControlPingReply api.Message = new(ControlPingReply) ) -type ControlPing struct{} - -func (*ControlPing) GetMessageName() string { - return "control_ping" +// SetControlPing sets the control ping message used by core. +func SetControlPing(m api.Message) { + msgControlPing = m } -func (*ControlPing) GetCrcString() string { - return "51077d14" -} -func (*ControlPing) GetMessageType() api.MessageType { - return api.RequestMessage + +// SetControlPingReply sets the control ping reply message used by core. +func SetControlPingReply(m api.Message) { + msgControlPingReply = m } +type ControlPing struct{} + +func (*ControlPing) GetMessageName() string { return "control_ping" } +func (*ControlPing) GetCrcString() string { return "51077d14" } +func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage } + type ControlPingReply struct { Retval int32 ClientIndex uint32 VpePID uint32 } -func (*ControlPingReply) GetMessageName() string { - return "control_ping_reply" -} -func (*ControlPingReply) GetCrcString() string { - return "f6b0b8ca" -} -func (*ControlPingReply) GetMessageType() api.MessageType { - return api.ReplyMessage +func (*ControlPingReply) GetMessageName() string { return "control_ping_reply" } +func (*ControlPingReply) GetCrcString() string { return "f6b0b8ca" } +func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } + +func init() { + api.RegisterMessage((*ControlPing)(nil), "ControlPing") + api.RegisterMessage((*ControlPingReply)(nil), "ControlPingReply") }