Navigation



Ignore:
Timestamp:
Jul 1, 2010, 3:47:34 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Updated the app_radgw extension to allow more souple management of sessions, and stateful gateway features.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgw_plugins.c

    r271 r356  
    349349                if (plg->descriptor->rgwp_rad_req) {
    350350                        TRACE_DEBUG(ANNOYING, "Calling next plugin: %s", plg->descriptor->rgwp_name);
    351                         ret = (*plg->descriptor->rgwp_rad_req)(plg->cs, *session, &(*rad)->radius, &rad_ans, diam_msg, cli);
     351                        ret = (*plg->descriptor->rgwp_rad_req)(plg->cs, session, &(*rad)->radius, &rad_ans, diam_msg, cli);
    352352                        if (ret)
    353353                                break;
     
    391391
    392392/* Loop in the extension list (same as req) to convert data from diam_ans to rad_ans */
    393 int rgw_plg_loop_ans(struct rgw_radius_msg_meta *req, struct session *session, struct msg **diam_ans, struct radius_msg ** rad_ans, struct rgw_client * cli)
     393int rgw_plg_loop_ans(struct rgw_radius_msg_meta *req, struct session *session, struct msg **diam_ans, struct radius_msg ** rad_ans, struct rgw_client * cli, int * stateful)
    394394{
    395395        int ret = 0;
    396396        struct fd_list * head = NULL, *li;
    397397       
    398         TRACE_ENTRY("%p %p %p %p %p", req, session, diam_ans, rad_ans, cli);
    399         CHECK_PARAMS( req && session && diam_ans && *diam_ans && rad_ans && *rad_ans && cli);
     398        TRACE_ENTRY("%p %p %p %p %p %p", req, session, diam_ans, rad_ans, cli, stateful);
     399        CHECK_PARAMS( req && session && diam_ans && *diam_ans && rad_ans && *rad_ans && cli && stateful);
     400       
     401        *stateful = 0; /* default: stateless gateway */
    400402       
    401403        /* Get the list of extensions of the RADIUS request */
     
    407409        for (li = head->next; li != head; li = li->next) {
    408410                struct plg_descr * plg = ((struct plg_accel_item *) li)->plg;
     411                int locstateful = 0;
    409412               
    410413                if (plg->descriptor->rgwp_diam_ans) {
    411414                        TRACE_DEBUG(ANNOYING, "Calling next plugin: %s", plg->descriptor->rgwp_name);
    412                         ret = (*plg->descriptor->rgwp_diam_ans)(plg->cs, session, diam_ans, rad_ans, (void *)cli);
     415                        ret = (*plg->descriptor->rgwp_diam_ans)(plg->cs, session, diam_ans, rad_ans, (void *)cli, &locstateful);
    413416                        if (ret)
    414417                                break;
     418                        *stateful |= locstateful;
    415419                } else {
    416420                        TRACE_DEBUG(ANNOYING, "Skipping extension '%s' (NULL callback)", plg->descriptor->rgwp_name);
Note: See TracChangeset for help on using the changeset viewer.