@@ -448,7 +448,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
448448 size_t len ;
449449 int j ;
450450 module_instance_t * mi ;
451- module_method_name_t const * methods ;
451+ module_method_binding_t const * methods ;
452452 char const * method_name1 , * method_name2 ;
453453 module_rlm_t const * mrlm ;
454454
@@ -470,7 +470,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
470470 */
471471 mi = module_rlm_static_by_name (NULL , name );
472472 if (mi ) {
473- virtual_server_method_t const * allowed_list ;
473+ section_name_t const * * allowed_list ;
474474
475475 if (!method ) return mi ;
476476
@@ -481,20 +481,20 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
481481 * module has no named methods. Try to return a
482482 * method based on the component.
483483 */
484- if (!method_name1 || !mrlm -> method_names ) goto return_component ;
484+ if (!method_name1 || !mrlm -> bindings ) goto return_component ;
485485
486486 /*
487487 * Walk through the module, finding a matching
488488 * method.
489489 */
490- for (j = 0 ; mrlm -> method_names [j ].name1 != NULL ; j ++ ) {
491- methods = & mrlm -> method_names [j ];
490+ for (j = 0 ; mrlm -> bindings [j ].section ; j ++ ) {
491+ methods = & mrlm -> bindings [j ];
492492
493493 /*
494494 * Wildcard match name1, we're
495495 * done.
496496 */
497- if (methods -> name1 == CF_IDENT_ANY ) {
497+ if (methods -> section -> name1 == CF_IDENT_ANY ) {
498498 found :
499499 * method = methods -> method ;
500500 if (method_env ) * method_env = methods -> method_env ;
@@ -506,26 +506,26 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
506506 /*
507507 * If name1 doesn't match, skip it.
508508 */
509- if (strcasecmp (methods -> name1 , method_name1 ) != 0 ) continue ;
509+ if (strcasecmp (methods -> section -> name1 , method_name1 ) != 0 ) continue ;
510510
511511 /*
512512 * The module can declare a
513513 * wildcard for name2, in which
514514 * case it's a match.
515515 */
516- if (methods -> name2 == CF_IDENT_ANY ) goto found ;
516+ if (methods -> section -> name2 == CF_IDENT_ANY ) goto found ;
517517
518518 /*
519519 * No name2 is also a match to no name2.
520520 */
521- if (!methods -> name2 && !method_name2 ) goto found ;
521+ if (!methods -> section -> name2 && !method_name2 ) goto found ;
522522
523523 /*
524524 * Don't do strcmp on NULLs
525525 */
526- if (!methods -> name2 || !method_name2 ) continue ;
526+ if (!methods -> section -> name2 || !method_name2 ) continue ;
527527
528- if (strcasecmp (methods -> name2 , method_name2 ) == 0 ) goto found ;
528+ if (strcasecmp (methods -> section -> name2 , method_name2 ) == 0 ) goto found ;
529529 }
530530
531531 if (!vs ) goto skip_section_method ;
@@ -558,22 +558,22 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
558558 * then any module method would match, which is
559559 * bad.
560560 */
561- for (j = 0 ; allowed_list [j ]. name1 != NULL ; j ++ ) {
561+ for (j = 0 ; allowed_list [j ]; j ++ ) {
562562 int k ;
563- virtual_server_method_t const * allowed = & allowed_list [j ];
563+ section_name_t const * allowed = allowed_list [j ];
564564
565- for (k = 0 ; mrlm -> method_names [k ].name1 != NULL ; k ++ ) {
566- methods = & mrlm -> method_names [k ];
565+ for (k = 0 ; mrlm -> bindings [k ].section ; k ++ ) {
566+ methods = & mrlm -> bindings [k ];
567567
568- fr_assert (methods -> name1 != CF_IDENT_ANY ); /* should have been caught above */
568+ fr_assert (methods -> section -> name1 != CF_IDENT_ANY ); /* should have been caught above */
569569
570- if (strcasecmp (methods -> name1 , allowed -> name1 ) != 0 ) continue ;
570+ if (strcasecmp (methods -> section -> name1 , allowed -> name1 ) != 0 ) continue ;
571571
572572 /*
573573 * The module matches "recv *",
574574 * call this method.
575575 */
576- if (methods -> name2 == CF_IDENT_ANY ) {
576+ if (methods -> section -> name2 == CF_IDENT_ANY ) {
577577 found_allowed :
578578 * method = methods -> method ;
579579 return mi ;
@@ -582,14 +582,14 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
582582 /*
583583 * No name2 is also a match to no name2.
584584 */
585- if (!methods -> name2 && !allowed -> name2 ) goto found_allowed ;
585+ if (!methods -> section -> name2 && !allowed -> name2 ) goto found_allowed ;
586586
587587 /*
588588 * Don't do strcasecmp on NULLs
589589 */
590- if (!methods -> name2 || !allowed -> name2 ) continue ;
590+ if (!methods -> section -> name2 || !allowed -> name2 ) continue ;
591591
592- if (strcasecmp (methods -> name2 , allowed -> name2 ) == 0 ) goto found_allowed ;
592+ if (strcasecmp (methods -> section -> name2 , allowed -> name2 ) == 0 ) goto found_allowed ;
593593 }
594594 }
595595
@@ -663,7 +663,7 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
663663 /*
664664 * We've found the module, but it has no named methods.
665665 */
666- if (!mrlm -> method_names ) {
666+ if (!mrlm -> bindings ) {
667667 * name1 = name + (p - inst_name );
668668 * name2 = NULL ;
669669 goto finish ;
@@ -675,24 +675,24 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
675675 * matches anything else.
676676 */
677677 if (!q ) {
678- for (j = 0 ; mrlm -> method_names [j ].name1 != NULL ; j ++ ) {
679- methods = & mrlm -> method_names [j ];
678+ for (j = 0 ; mrlm -> bindings [j ].section ; j ++ ) {
679+ methods = & mrlm -> bindings [j ];
680680
681681 /*
682682 * If we do not have the second $method, then ignore it!
683683 */
684- if (methods -> name2 && (methods -> name2 != CF_IDENT_ANY )) continue ;
684+ if (methods -> section -> name2 && (methods -> section -> name2 != CF_IDENT_ANY )) continue ;
685685
686686 /*
687687 * Wildcard match name1, we're
688688 * done.
689689 */
690- if (!methods -> name1 || (methods -> name1 == CF_IDENT_ANY )) goto found_name1 ;
690+ if (!methods -> section -> name1 || (methods -> section -> name1 == CF_IDENT_ANY )) goto found_name1 ;
691691
692692 /*
693693 * If name1 doesn't match, skip it.
694694 */
695- if (strcasecmp (methods -> name1 , p ) != 0 ) continue ;
695+ if (strcasecmp (methods -> section -> name1 , p ) != 0 ) continue ;
696696
697697 found_name1 :
698698 /*
@@ -729,41 +729,41 @@ module_instance_t *module_rlm_by_name_and_method(module_method_t *method, call_e
729729 *
730730 * Loop over the method names, seeing if we have a match.
731731 */
732- for (j = 0 ; mrlm -> method_names [j ].name1 != NULL ; j ++ ) {
733- methods = & mrlm -> method_names [j ];
732+ for (j = 0 ; mrlm -> bindings [j ].section ; j ++ ) {
733+ methods = & mrlm -> bindings [j ];
734734
735735 /*
736736 * If name1 doesn't match, skip it.
737737 */
738- if (strncasecmp (methods -> name1 , p , len ) != 0 ) continue ;
738+ if (strncasecmp (methods -> section -> name1 , p , len ) != 0 ) continue ;
739739
740740 /*
741741 * It may have been a partial match, like "rec",
742742 * instead of "recv". In which case check if it
743743 * was a FULL match.
744744 */
745- if (strlen (methods -> name1 ) != len ) continue ;
745+ if (strlen (methods -> section -> name1 ) != len ) continue ;
746746
747747 /*
748748 * The module can declare a
749749 * wildcard for name2, in which
750750 * case it's a match.
751751 */
752- if (!methods -> name2 || (methods -> name2 == CF_IDENT_ANY )) goto found_name2 ;
752+ if (!methods -> section -> name2 || (methods -> section -> name2 == CF_IDENT_ANY )) goto found_name2 ;
753753
754754 /*
755755 * Don't do strcmp on NULLs
756756 */
757- if (!methods -> name2 ) continue ;
757+ if (!methods -> section -> name2 ) continue ;
758758
759- if (strcasecmp (methods -> name2 , q ) != 0 ) continue ;
759+ if (strcasecmp (methods -> section -> name2 , q ) != 0 ) continue ;
760760
761761 found_name2 :
762762 /*
763763 * Update name1/name2 with the methods
764764 * that were found.
765765 */
766- * name1 = methods -> name1 ;
766+ * name1 = methods -> section -> name1 ;
767767 * name2 = name + (q - inst_name );
768768 * method = methods -> method ;
769769 if (method_env ) * method_env = methods -> method_env ;
0 commit comments