Navigation


Changeset 120:d7acdc46134d in freeDiameter for extensions/test_app/ta_serv.c


Ignore:
Timestamp:
Dec 9, 2009, 5:36:38 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Renamed several extensions

File:
1 moved

Legend:

Unmodified
Added
Removed
  • extensions/test_app/ta_serv.c

    r112 r120  
    3636/* Install the dispatch callbacks */
    3737
    38 #include "app_test.h"
     38#include "test_app.h"
    3939
    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 */
     40static struct disp_hdl * ta_hdl_fb = NULL; /* handler for fallback cb */
     41static struct disp_hdl * ta_hdl_tr = NULL; /* handler for Test-Request req cb */
    4242
    4343/* Default callback for the application. */
    44 static int atst_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)
     44static int ta_fb_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)
    4545{
    4646        /* This CB should never be called */
     
    5353
    5454/* 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)
     55static int ta_tr_cb( struct msg ** msg, struct avp * avp, struct session * sess, enum disp_action * act)
    5656{
    5757        struct msg *ans, *qry;
     
    7373                struct avp_hdr * hdr = NULL;
    7474               
    75                 CHECK_FCT( fd_msg_search_avp ( qry, atst_avp, &src) );
     75                CHECK_FCT( fd_msg_search_avp ( qry, ta_avp, &src) );
    7676                CHECK_FCT( fd_msg_avp_hdr( src, &hdr )  );
    7777               
    78                 CHECK_FCT( fd_msg_avp_new ( atst_avp, 0, &avp ) );
     78                CHECK_FCT( fd_msg_avp_new ( ta_avp, 0, &avp ) );
    7979                CHECK_FCT( fd_msg_avp_setvalue( avp, hdr->avp_value ) );
    8080                CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_LAST_CHILD, avp ) );
     
    9090}
    9191
    92 int atst_serv_init(void)
     92int ta_serv_init(void)
    9393{
    9494        struct disp_when data;
     
    9797       
    9898        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;
    101101       
    102102        /* 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 ) );
    104104       
    105105        /* 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 ) );
    107107       
    108108        return 0;
    109109}
    110110
    111 void atst_serv_fini(void)
     111void ta_serv_fini(void)
    112112{
    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);
    115115        }
    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);
    118118        }
    119119       
Note: See TracChangeset for help on using the changeset viewer.