Navigation


Changeset 536:f95cfc35d960 in freeDiameter


Ignore:
Timestamp:
Sep 10, 2010, 10:59:14 AM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Add User Name in translated Accounting Responses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgwx_acct.c

    r535 r536  
    159159        int              send_str;      /* If not 0, we must send a STR when the ACA is received. */
    160160        uint32_t         term_cause;    /* If not 0, the Termination-Cause to put in the STR. */
     161        /* Temporary : try sending the User-Name back in Accounting-Response for RADIUS */
     162        uint8_t         *username;
     163        size_t           un_size;
    161164};
     165
     166static void free_sess_state(struct sess_state *s) {
     167        if (s)
     168                free(s->username);
     169        free(s);
     170}
    162171
    163172/* Initialize the plugin */
     
    173182        memset(new, 0, sizeof(struct rgwp_config));
    174183       
    175         CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free ) );
     184        CHECK_FCT( fd_sess_handler_create( &new->sess_hdl, free_sess_state ) );
    176185        new->confstr = conffile;
    177186       
     
    11871196                }
    11881197                st->term_cause = str_cause;
     1198                if (un && un_len) {
     1199                        CHECK_MALLOC( st->username = malloc(un_len) );
     1200                        memcpy(st->username, un, un_len);
     1201                        st->un_size = un_len;
     1202                }
    11891203                CHECK_FCT( fd_sess_state_store( cs->sess_hdl, *session, &st ) );
    11901204        }
     
    13531367                   Specific.
    13541368        */
     1369       
     1370        /* Well, it seems some devices are expecting the user name ??? */
     1371        if (st->username) {
     1372                CHECK_MALLOC(radius_msg_add_attr(*rad_fw, RADIUS_ATTR_USER_NAME, st->username, st->un_size));
     1373        }
    13551374
    13561375        /* Now loop in the list of AVPs and convert those that we know how */
     
    14251444              -- done in radius_msg_finish_srv
    14261445        */
     1446       
     1447        free_sess_state(st);
    14271448
    14281449        return 0;
Note: See TracChangeset for help on using the changeset viewer.