comparison libfdproto/messages.c @ 1098:f38d77f9cfd3

Initial implementation of the hook mechanism
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 09 May 2013 11:59:34 +0800
parents 97a257c80de0
children 40b48a3997a2
comparison
equal deleted inserted replaced
1097:4d2dcb54d9a6 1098:f38d77f9cfd3
134 void * data; 134 void * data;
135 struct timespec timeout; 135 struct timespec timeout;
136 } msg_cb; /* Callback to be called when an answer is received, or timeout expires, if not NULL */ 136 } msg_cb; /* Callback to be called when an answer is received, or timeout expires, if not NULL */
137 DiamId_t msg_src_id; /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */ 137 DiamId_t msg_src_id; /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */
138 size_t msg_src_id_len; /* cached length of this string */ 138 size_t msg_src_id_len; /* cached length of this string */
139 139 struct fd_msg_pmdl msg_pmdl; /* list of permessagedata structures. */
140 }; 140 };
141 141
142 /* Macro to compute the message header size */ 142 /* Macro to compute the message header size */
143 #define GETMSGHDRSZ() 20 143 #define GETMSGHDRSZ() 20
144 144
671 671
672 if ((obj->type == MSG_MSG) && (_M(obj)->msg_sess != NULL)) { 672 if ((obj->type == MSG_MSG) && (_M(obj)->msg_sess != NULL)) {
673 CHECK_FCT_DO( fd_sess_reclaim_msg ( &_M(obj)->msg_sess ), /* continue */); 673 CHECK_FCT_DO( fd_sess_reclaim_msg ( &_M(obj)->msg_sess ), /* continue */);
674 } 674 }
675 675
676 if ((obj->type == MSG_MSG) && (_M(obj)->msg_pmdl.sentinel.o != NULL)) {
677 ((void (*)(struct fd_msg_pmdl *))_M(obj)->msg_pmdl.sentinel.o)(&_M(obj)->msg_pmdl);
678 }
679
676 /* free the object */ 680 /* free the object */
677 free(obj); 681 free(obj);
678 682
679 return 0; 683 return 0;
680 } 684 }
1493 TRACE_DEBUG(FULL, "Session-Id AVP with 0-byte length found in message %p", msg); 1497 TRACE_DEBUG(FULL, "Session-Id AVP with 0-byte length found in message %p", msg);
1494 *session = NULL; 1498 *session = NULL;
1495 } 1499 }
1496 1500
1497 return 0; 1501 return 0;
1502 }
1503
1504 /* Retrieve the location of the pmd list for the message; return NULL if failed */
1505 struct fd_msg_pmdl * fd_msg_pmdl_get(struct msg * msg)
1506 {
1507 CHECK_PARAMS_DO( CHECK_MSG(msg), return NULL );
1508 return &msg->msg_pmdl;
1498 } 1509 }
1499 1510
1500 1511
1501 /******************* End-to-end counter *********************/ 1512 /******************* End-to-end counter *********************/
1502 static uint32_t fd_eteid; 1513 static uint32_t fd_eteid;
"Welcome to our mercurial repository"