diff extensions/test_app/ta_serv.c @ 639:95a784729cac

Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 20 Dec 2010 13:07:06 +0900
parents 66f188b3ca84
children 4a9f08d6b6ba
line wrap: on
line diff
--- a/extensions/test_app/ta_serv.c	Fri Dec 17 18:41:19 2010 +0900
+++ b/extensions/test_app/ta_serv.c	Mon Dec 20 13:07:06 2010 +0900
@@ -41,7 +41,7 @@
 static struct disp_hdl * ta_hdl_tr = NULL; /* handler for Test-Request req cb */
 
 /* Default callback for the application. */
-static int ta_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)
+static int ta_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act)
 {
 	/* This CB should never be called */
 	TRACE_ENTRY("%p %p %p %p", msg, avp, sess, act);
@@ -52,7 +52,7 @@
 }
 
 /* Callback for incoming Test-Request messages */
-static int ta_tr_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)
+static int ta_tr_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act)
 {
 	struct msg *ans, *qry;
 	struct avp * a;
@@ -119,10 +119,10 @@
 	data.command = ta_cmd_r;
 	
 	/* fallback CB if command != Test-Request received */
-	CHECK_FCT( fd_disp_register( ta_fb_cb, DISP_HOW_APPID, &data, &ta_hdl_fb ) );
+	CHECK_FCT( fd_disp_register( ta_fb_cb, DISP_HOW_APPID, &data, NULL, &ta_hdl_fb ) );
 	
 	/* Now specific handler for Test-Request */
-	CHECK_FCT( fd_disp_register( ta_tr_cb, DISP_HOW_CC, &data, &ta_hdl_tr ) );
+	CHECK_FCT( fd_disp_register( ta_tr_cb, DISP_HOW_CC, &data, NULL, &ta_hdl_tr ) );
 	
 	return 0;
 }
@@ -130,10 +130,10 @@
 void ta_serv_fini(void)
 {
 	if (ta_hdl_fb) {
-		(void) fd_disp_unregister(&ta_hdl_fb);
+		(void) fd_disp_unregister(&ta_hdl_fb, NULL);
 	}
 	if (ta_hdl_tr) {
-		(void) fd_disp_unregister(&ta_hdl_tr);
+		(void) fd_disp_unregister(&ta_hdl_tr, NULL);
 	}
 	
 	return;
"Welcome to our mercurial repository"