Changeset 120:d7acdc46134d in freeDiameter for extensions/test_app/ta_serv.c
- Timestamp:
- Dec 9, 2009, 5:36:38 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/test_app/ta_serv.c
r112 r120 36 36 /* Install the dispatch callbacks */ 37 37 38 #include " app_test.h"38 #include "test_app.h" 39 39 40 static struct disp_hdl * atst_hdl_fb = NULL; /* handler for fallback cb */41 static struct disp_hdl * atst_hdl_tr = NULL; /* handler for Test-Request req cb */40 static struct disp_hdl * ta_hdl_fb = NULL; /* handler for fallback cb */ 41 static struct disp_hdl * ta_hdl_tr = NULL; /* handler for Test-Request req cb */ 42 42 43 43 /* Default callback for the application. */ 44 static int atst_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)44 static int ta_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act) 45 45 { 46 46 /* This CB should never be called */ … … 53 53 54 54 /* Callback for incoming Test-Request messages */ 55 static int atst_tr_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)55 static int ta_tr_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act) 56 56 { 57 57 struct msg *ans, *qry; … … 73 73 struct avp_hdr * hdr = NULL; 74 74 75 CHECK_FCT( fd_msg_search_avp ( qry, atst_avp, &src) );75 CHECK_FCT( fd_msg_search_avp ( qry, ta_avp, &src) ); 76 76 CHECK_FCT( fd_msg_avp_hdr( src, &hdr ) ); 77 77 78 CHECK_FCT( fd_msg_avp_new ( atst_avp, 0, &avp ) );78 CHECK_FCT( fd_msg_avp_new ( ta_avp, 0, &avp ) ); 79 79 CHECK_FCT( fd_msg_avp_setvalue( avp, hdr->avp_value ) ); 80 80 CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_LAST_CHILD, avp ) ); … … 90 90 } 91 91 92 int atst_serv_init(void)92 int ta_serv_init(void) 93 93 { 94 94 struct disp_when data; … … 97 97 98 98 memset(&data, 0, sizeof(data)); 99 data.app = atst_appli;100 data.command = atst_cmd_r;99 data.app = ta_appli; 100 data.command = ta_cmd_r; 101 101 102 102 /* fallback CB if command != Test-Request received */ 103 CHECK_FCT( fd_disp_register( atst_fb_cb, DISP_HOW_APPID, &data, &atst_hdl_fb ) );103 CHECK_FCT( fd_disp_register( ta_fb_cb, DISP_HOW_APPID, &data, &ta_hdl_fb ) ); 104 104 105 105 /* Now specific handler for Test-Request */ 106 CHECK_FCT( fd_disp_register( atst_tr_cb, DISP_HOW_CC, &data, &atst_hdl_tr ) );106 CHECK_FCT( fd_disp_register( ta_tr_cb, DISP_HOW_CC, &data, &ta_hdl_tr ) ); 107 107 108 108 return 0; 109 109 } 110 110 111 void atst_serv_fini(void)111 void ta_serv_fini(void) 112 112 { 113 if ( atst_hdl_fb) {114 (void) fd_disp_unregister(& atst_hdl_fb);113 if (ta_hdl_fb) { 114 (void) fd_disp_unregister(&ta_hdl_fb); 115 115 } 116 if ( atst_hdl_tr) {117 (void) fd_disp_unregister(& atst_hdl_tr);116 if (ta_hdl_tr) { 117 (void) fd_disp_unregister(&ta_hdl_tr); 118 118 } 119 119
Note: See TracChangeset
for help on using the changeset viewer.