New centos release for debugging rp_realm filter issues
[trust_router.git] / include / tr_msg.h
index 1ab2c72..f5d7c60 100644 (file)
 #ifndef TR_MSG_H
 #define TR_MSG_H
 
-#include <trust_router/tid.h>
 #include <jansson.h>
+#include <trust_router/tid.h>
+
+typedef struct tr_msg TR_MSG;
 
 enum msg_type {
   TR_UNKNOWN = 0,
@@ -45,17 +47,27 @@ enum msg_type {
 };
 
 /* Union of TR message types to hold message of any type. */
-typedef struct tr_msg {
+struct tr_msg {
   enum msg_type msg_type;
   union {
     TID_REQ *tid_req;
     TID_RESP *tid_resp;
   };
-} TR_MSG;
+};
+
+/* Accessors */
+enum msg_type tr_msg_get_msg_type(TR_MSG *msg);
+void tr_msg_set_msg_type(TR_MSG *msg, enum msg_type type);
+TID_REQ *tr_msg_get_req(TR_MSG *msg);
+void tr_msg_set_req(TR_MSG *msg, TID_REQ *req);
+TID_RESP *tr_msg_get_resp(TR_MSG *msg);
+void tr_msg_set_resp(TR_MSG *msg, TID_RESP *resp);
 
+/* Encoders/Decoders */
 char *tr_msg_encode(TR_MSG *msg);
 TR_MSG *tr_msg_decode(char *jmsg, size_t len);
 void tr_msg_free_encoded(char *jmsg);
 void tr_msg_free_decoded(TR_MSG *msg);
 
+
 #endif