From: Alan T. DeKok Date: Wed, 1 May 2019 17:26:17 +0000 (-0400) Subject: move to C99 initializers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21d16bbe6dd3ead34be1dc321f8d4db5905bcf88;p=thirdparty%2Ffreeradius-server.git move to C99 initializers in preparation for adding fields to the compile struct --- diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_base.c b/src/modules/proto_dhcpv4/proto_dhcpv4_base.c index b1d475210e1..f419b7922b2 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_base.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_base.c @@ -282,22 +282,74 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "recv", "DHCP-Discover", MOD_POST_AUTH }, - { "send", "DHCP-Offer", MOD_POST_AUTH }, - { "recv", "DHCP-Request", MOD_POST_AUTH }, - - { "send", "DHCP-Ack", MOD_POST_AUTH }, - { "send", "DHCP-NAK", MOD_POST_AUTH }, - { "send", "DHCP-Decline", MOD_POST_AUTH }, - - { "recv", "DHCP-Release", MOD_POST_AUTH }, - { "recv", "DHCP-Inform", MOD_POST_AUTH }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, - - { "recv", "DHCP-Lease-Query", MOD_POST_AUTH }, - { "send", "DHCP-Lease-Unassigned", MOD_POST_AUTH }, - { "send", "DHCP-Lease-Unknown", MOD_POST_AUTH }, - { "send", "DHCP-Lease-Active", MOD_POST_AUTH }, + { + .name = "recv", + .name2 = "DHCP-Discover", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-Offer", + .component = MOD_POST_AUTH, + }, + { + .name = "recv", + .name2 = "DHCP-Request", + .component = MOD_POST_AUTH, + }, + + { + .name = "send", + .name2 = "DHCP-Ack", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-NAK", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-Decline", + .component = MOD_POST_AUTH, + }, + + { + .name = "recv", + .name2 = "DHCP-Release", + .component = MOD_POST_AUTH, + }, + { + .name = "recv", + .name2 = "DHCP-Inform", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, + + { + .name = "recv", + .name2 = "DHCP-Lease-Query", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-Lease-Unassigned", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-Lease-Unknown", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "DHCP-Lease-Active", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_radius/proto_radius_acct.c b/src/modules/proto_radius/proto_radius_acct.c index 8c34d8f423d..25728908b0e 100644 --- a/src/modules/proto_radius/proto_radius_acct.c +++ b/src/modules/proto_radius/proto_radius_acct.c @@ -240,11 +240,31 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "recv", "Accounting-Request", MOD_PREACCT }, - { "send", "Accounting-Response", MOD_ACCOUNTING }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, - { "send", "Protocol-Error", MOD_POST_AUTH }, - { "accounting", CF_IDENT_ANY, MOD_ACCOUNTING }, + { + .name = "recv", + .name2 = "Accounting-Request", + .component = MOD_PREACCT, + }, + { + .name = "send", + .name2 = "Accounting-Response", + .component = MOD_ACCOUNTING, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Protocol-Error", + .component = MOD_POST_AUTH, + }, + { + .name = "accounting", + .name2 = CF_IDENT_ANY, + .component = MOD_ACCOUNTING, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_radius/proto_radius_auth.c b/src/modules/proto_radius/proto_radius_auth.c index 7581f076714..e39cbabcd72 100644 --- a/src/modules/proto_radius/proto_radius_auth.c +++ b/src/modules/proto_radius/proto_radius_auth.c @@ -632,13 +632,41 @@ static fr_io_final_t mod_process(void const *instance, REQUEST *request, fr_io_a } static virtual_server_compile_t compile_list[] = { - { "recv", "Access-Request", MOD_AUTHORIZE }, - { "send", "Access-Accept", MOD_POST_AUTH }, - { "send", "Access-Challenge", MOD_POST_AUTH }, - { "send", "Access-Reject", MOD_POST_AUTH }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, - { "send", "Protocol-Error", MOD_POST_AUTH }, - { "authenticate", CF_IDENT_ANY, MOD_AUTHENTICATE }, + { + .name = "recv", + .name2 = "Access-Request", + .component = MOD_AUTHORIZE, + }, + { + .name = "send", + .name2 = "Access-Accept", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Access-Challenge", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Access-Reject", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Protocol-Error", + .component = MOD_POST_AUTH, + }, + { + .name = "authenticate", + .name2 = CF_IDENT_ANY, + .component = MOD_AUTHENTICATE, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_radius/proto_radius_coa.c b/src/modules/proto_radius/proto_radius_coa.c index e60d5c72314..3e8bb382996 100644 --- a/src/modules/proto_radius/proto_radius_coa.c +++ b/src/modules/proto_radius/proto_radius_coa.c @@ -228,14 +228,45 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, } static virtual_server_compile_t compile_list[] = { - { "recv", "CoA-Request", MOD_RECV_COA }, - { "send", "CoA-ACK", MOD_SEND_COA }, - { "send", "CoA-NAK", MOD_SEND_COA }, - { "recv", "Disconnect-Request", MOD_RECV_COA }, - { "send", "Disconnect-ACK", MOD_SEND_COA }, - { "send", "Disconnect-NAK", MOD_SEND_COA }, - { "send", "Protocol-Error", MOD_POST_AUTH }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, + { + .name = "recv", + .name2 = "CoA-Request",\ + .component = MOD_RECV_COA, + }, + { + .name = "send", + .name2 = "CoA-ACK", + .component = MOD_SEND_COA, + }, + { + .name = "send",.name2 = "CoA-NAK", + .component = MOD_SEND_COA, + }, + { + .name = "recv", + .name2 = "Disconnect-Request", + .component = MOD_RECV_COA, + }, + { + .name = "send", + .name2 = "Disconnect-ACK", + .component = MOD_SEND_COA, + }, + { + .name = "send", + .name2 = "Disconnect-NAK", + .component = MOD_SEND_COA, + }, + { + .name = "send", + .name2 = "Protocol-Error", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_radius/proto_radius_dynamic_client.c b/src/modules/proto_radius/proto_radius_dynamic_client.c index 9b18ff52353..bd9c1e24ead 100644 --- a/src/modules/proto_radius/proto_radius_dynamic_client.c +++ b/src/modules/proto_radius/proto_radius_dynamic_client.c @@ -205,9 +205,21 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "new", "client", MOD_AUTHORIZE }, - { "add", "client", MOD_POST_AUTH }, - { "deny", "client", MOD_POST_AUTH }, + { + .name = "new", + .name2 = "client", + .component = MOD_AUTHORIZE, + }, + { + .name = "add", + .name2 = "client", + .component = MOD_POST_AUTH, + }, + { + .name = "deny", + .name2 = "client", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_radius/proto_radius_status.c b/src/modules/proto_radius/proto_radius_status.c index fbc1d7b90e8..40d54235d9a 100644 --- a/src/modules/proto_radius/proto_radius_status.c +++ b/src/modules/proto_radius/proto_radius_status.c @@ -196,11 +196,31 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "recv", "Status-Server", MOD_AUTHORIZE }, - { "send", "Access-Accept", MOD_POST_AUTH }, - { "send", "Access-Reject", MOD_POST_AUTH }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, - { "send", "Protocol-Error", MOD_POST_AUTH }, + { + .name = "recv", + .name2 = "Status-Server", + .component = MOD_AUTHORIZE, + }, + { + .name = "send", + .name2 = "Access-Accept", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Access-Reject", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Protocol-Error", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_vmps/proto_vmps_all.c b/src/modules/proto_vmps/proto_vmps_all.c index 630338d89ca..327d31359a3 100644 --- a/src/modules/proto_vmps/proto_vmps_all.c +++ b/src/modules/proto_vmps/proto_vmps_all.c @@ -204,11 +204,31 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "recv", "Join-Request", MOD_AUTHORIZE }, - { "send", "Join-Response", MOD_POST_AUTH }, - { "recv", "Reconfirm-Request", MOD_AUTHORIZE }, - { "send", "Reconfirm-Response", MOD_POST_AUTH }, - { "send", "Do-Not-Respond", MOD_POST_AUTH }, + { + .name = "recv", + .name2 = "Join-Request", + .component = MOD_AUTHORIZE, + }, + { + .name = "send", + .name2 = "Join-Response", + .component = MOD_POST_AUTH, + }, + { + .name = "recv", + .name2 = "Reconfirm-Request", + .component = MOD_AUTHORIZE, + }, + { + .name = "send", + .name2 = "Reconfirm-Response", + .component = MOD_POST_AUTH, + }, + { + .name = "send", + .name2 = "Do-Not-Respond", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR }; diff --git a/src/modules/proto_vmps/proto_vmps_dynamic_client.c b/src/modules/proto_vmps/proto_vmps_dynamic_client.c index 4794398f85b..498281bbc94 100644 --- a/src/modules/proto_vmps/proto_vmps_dynamic_client.c +++ b/src/modules/proto_vmps/proto_vmps_dynamic_client.c @@ -199,9 +199,21 @@ static fr_io_final_t mod_process(UNUSED void const *instance, REQUEST *request, static virtual_server_compile_t compile_list[] = { - { "new", "client", MOD_AUTHORIZE }, - { "add", "client", MOD_POST_AUTH }, - { "deny", "client", MOD_POST_AUTH }, + { + .name = "new", + .name2 = "client", + .component = MOD_AUTHORIZE, + }, + { + .name = "add", + .name2 = "client", + .component = MOD_POST_AUTH, + }, + { + .name = "deny", + .name2 = "client", + .component = MOD_POST_AUTH, + }, COMPILE_TERMINATOR };