Navigation


Changeset 127:8ee43cf85a5f in freeDiameter


Ignore:
Timestamp:
Dec 10, 2009, 2:39:55 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added User-Name AVP in test_app extension

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • doc/test_app.conf.sample

    r120 r127  
    4949# dest-host = "server.foreign.net";
    5050
     51# The User-Name for the message (may be useful for some routing tests).
     52# (default is not providing this AVP).
     53# user-name = "user@server.foreign.net";
     54
    5155# The signal that triggers sending the test message
    5256# Note: Symbolic names are now recognized, you must use integers
  • extensions/test_app/ta_cli.c

    r121 r127  
    196196        CHECK_FCT_DO( fd_msg_add_origin ( req, 0 ), goto out  );
    197197       
     198        /* Set the User-Name AVP if needed*/
     199        if (ta_conf->user_name) {
     200                CHECK_FCT_DO( fd_msg_avp_new ( ta_user_name, 0, &avp ), goto out  );
     201                val.os.data = (unsigned char *)(ta_conf->user_name);
     202                val.os.len  = strlen(ta_conf->user_name);
     203                CHECK_FCT_DO( fd_msg_avp_setvalue( avp, &val ), goto out  );
     204                CHECK_FCT_DO( fd_msg_avp_add( req, MSG_BRW_LAST_CHILD, avp ), goto out  );
     205        }
    198206       
    199207        /* Set the Test-AVP AVP */
  • extensions/test_app/ta_conf.l

    r120 r127  
    145145                        }
    146146
     147(?i:"user-name")        {
     148                                return USER_NAME;
     149                        }
     150
    147151(?i:"Signal")           {
    148152                                return SIGNAL;
  • extensions/test_app/ta_conf.y

    r120 r127  
    124124%token          DEST_REALM
    125125%token          DEST_HOST
     126%token          USER_NAME
    126127%token          SIGNAL
    127128
     
    147148                        | conffile dstrealm
    148149                        | conffile dsthost
     150                        | conffile usrname
    149151                        | conffile signal
    150152                        ;
     
    194196                        ;
    195197
     198usrname:                USER_NAME '=' QSTRING ';'
     199                        {
     200                                free(ta_conf->user_name);
     201                                ta_conf->user_name = $3;
     202                        }
     203                        ;
     204
    196205signal:                 SIGNAL '=' INTEGER ';'
    197206                        {
  • extensions/test_app/ta_dict.c

    r120 r127  
    4949struct dict_object * ta_dest_host = NULL;
    5050struct dict_object * ta_dest_realm = NULL;
     51struct dict_object * ta_user_name = NULL;
    5152struct dict_object * ta_res_code = NULL;
    5253
     
    102103        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Host", &ta_dest_host, ENOENT) );
    103104        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Realm", &ta_dest_realm, ENOENT) );
     105        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "User-Name", &ta_user_name, ENOENT) );
    104106        CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Result-Code", &ta_res_code, ENOENT) );
    105107       
  • extensions/test_app/test_app.h

    r120 r127  
    6161        char    *       dest_realm;     /* default local realm */
    6262        char    *       dest_host;      /* default NULL */
     63        char    *       user_name;      /* default NULL */
    6364        int             signal;         /* default TEST_APP_DEFAULT_SIGNAL */
    6465};
     
    9697extern struct dict_object * ta_dest_host;
    9798extern struct dict_object * ta_dest_realm;
     99extern struct dict_object * ta_user_name;
    98100extern struct dict_object * ta_res_code;
Note: See TracChangeset for help on using the changeset viewer.