aboutsummaryrefslogtreecommitdiffstats
path: root/codec/msg_codec.go
diff options
context:
space:
mode:
Diffstat (limited to 'codec/msg_codec.go')
-rw-r--r--codec/msg_codec.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/codec/msg_codec.go b/codec/msg_codec.go
index 68cf3b1..6534e7d 100644
--- a/codec/msg_codec.go
+++ b/codec/msg_codec.go
@@ -24,6 +24,16 @@ import (
var DefaultCodec = new(MsgCodec)
+func EncodeMsg(msg api.Message, msgID uint16) (data []byte, err error) {
+ return DefaultCodec.EncodeMsg(msg, msgID)
+}
+func DecodeMsg(data []byte, msg api.Message) (err error) {
+ return DefaultCodec.DecodeMsg(data, msg)
+}
+func DecodeMsgContext(data []byte, msg api.Message) (context uint32, err error) {
+ return DefaultCodec.DecodeMsgContext(data, msg)
+}
+
// MsgCodec provides encoding and decoding functionality of `api.Message` structs into/from
// binary format as accepted by VPP.
type MsgCodec struct{}