Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for extended client definitions #327

Closed
arr2036 opened this issue Jun 25, 2013 · 2 comments
Closed

Support for extended client definitions #327

arr2036 opened this issue Jun 25, 2013 · 2 comments
Labels
feature enhancement category: a new feature (an extension of functionality) v3.x.x meta: relates to the v3.0.x branch

Comments

@arr2036
Copy link
Member

arr2036 commented Jun 25, 2013

The current code for rlm_sql, rlm_ldap, dynamic_clients only supports a subset of the configuration items available in the clients.conf file.

It would be nice to have support for the same functionality for clients no matter where they're added.

Seems like this could be achieved by automatically generating attribute definitions for all the configuration items from here:

static const CONF_PARSER client_config[] = {
    { "ipaddr",  PW_TYPE_IPADDR,
      0, &cl_ip4addr,  NULL },
    { "ipv6addr",  PW_TYPE_IPV6ADDR,
      0, &cl_ip6addr, NULL },
    { "netmask",  PW_TYPE_INTEGER,
      offsetof(RADCLIENT, prefix), 0, NULL },

    { "src_ipaddr",  PW_TYPE_STRING_PTR,
      0, &cl_srcipaddr,  NULL },

    { "require_message_authenticator",  PW_TYPE_BOOLEAN,
      offsetof(RADCLIENT, message_authenticator), 0, "no" },

    { "secret",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, secret), 0, NULL },
    { "shortname",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, shortname), 0, NULL },
    { "nastype",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, nastype), 0, NULL },
    { "login",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, login), 0, NULL },
    { "password",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, password), 0, NULL },
    { "virtual_server",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, server), 0, NULL },

#ifdef WITH_TCP
    { "proto",  PW_TYPE_STRING_PTR,
      0, &hs_proto, NULL },

    { "limit", PW_TYPE_SUBSECTION, 0, NULL, (void const *) limit_config },
#endif

#ifdef WITH_DYNAMIC_CLIENTS
    { "dynamic_clients",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, client_server), 0, NULL },
    { "lifetime",  PW_TYPE_INTEGER,
      offsetof(RADCLIENT, lifetime), 0, NULL },
    { "rate_limit",  PW_TYPE_BOOLEAN,
      offsetof(RADCLIENT, rate_limit), 0, NULL },
#endif

#ifdef WITH_COA
    { "coa_server",  PW_TYPE_STRING_PTR,
      offsetof(RADCLIENT, coa_name), 0, NULL },
#endif

    { NULL, -1, 0, NULL, NULL }
};

Replacing underscores with hyphens. Modules then just need to create VP lists containing the client definition.

This would work well for things like dynamic home servers.

@alandekok
Copy link
Member

This is now done for ldap. I don't think we can do the same for SQL.

@arr2036
Copy link
Member Author

arr2036 commented Oct 26, 2014

We can, but it require mapping

@arr2036 arr2036 closed this as completed Oct 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature enhancement category: a new feature (an extension of functionality) v3.x.x meta: relates to the v3.0.x branch
Projects
None yet
Development

No branches or pull requests

2 participants