Add support for using multiple generated versions
[govpp.git] / core / control_ping.go
index 904068a..cd447b7 100644 (file)
@@ -7,6 +7,16 @@ var (
        msgControlPingReply api.Message = new(ControlPingReply)
 )
 
+// SetControlPing sets the control ping message used by core.
+func SetControlPing(m api.Message) {
+       msgControlPing = m
+}
+
+// SetControlPingReply sets the control ping reply message used by core.
+func SetControlPingReply(m api.Message) {
+       msgControlPingReply = m
+}
+
 type ControlPing struct{}
 
 func (*ControlPing) GetMessageName() string {
@@ -34,3 +44,8 @@ func (*ControlPingReply) GetCrcString() string {
 func (*ControlPingReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
+
+func init() {
+       api.RegisterMessage((*ControlPing)(nil), "ControlPing")
+       api.RegisterMessage((*ControlPingReply)(nil), "ControlPingReply")
+}