rc_send_server(3)

πŸ“¦
version 1.5.2 Β· 4 versions
, in alpine 3.24, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’Œ rc_send_server β€” the "hey server, u up?" function (NAME)

okay bestie, welcome to rc_send_server(3), from the Radius client library β€” aka radcli. this is the page where your program slides into a RADIUS server's DMs and then sits there, refreshing, waiting for a reply. it's giving desperate but make it protocol. πŸ’…


✨ SYNOPSIS ✨

#include <radcli/radcli.h>

int rc_send_server(
    rc_handle  *rh,
    SEND_DATA  *data,
    char       *msg,
    rc_type     type
);

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it sends a request to a RADIUS server and then waits for the reply. that's it. that's the whole vibe. you hand it the goods, it yeets them over, and it waits. patiently. like a bestie holding your bag while you try on jeans. 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • rh β€” a handle to your parsed configuration. it's the receipts from all your setup, basically.
  • data β€” a pointer to a SEND_DATA structure. yes, the struct gets its own section, keep scrolling boo.
  • msg β€” must be an array of PW_MAX_MSG_SIZE or NULL; will contain the concatenation of any PW_REPLY_MESSAGE received. so if the server leaves you a lil note, this is where it gets stapled together. πŸ’Œ
  • type β€” must be AUTH or ACCT. those are the only two options, no third door, no secret menu. periodt.

🧚 STRUCTURES 🧚

here's the whole thing, exactly as it lives, no edits no notes:

struct send_data {
  uint8_t      code;          // RADIUS packet code.
  uint8_t      seq_nbr;       // Packet sequence number.
  char        *server;        // Name/address of RADIUS server.
  int          svc_port;      // RADIUS protocol destination port.
  char        *secret;        // Shared secret of RADIUS server.
  int          timeout;       // Session timeout in seconds.
  int          retries;
  VALUE_PAIR  *send_pairs;    // More a/v pairs to send.
  VALUE_PAIR  *receive_pairs; // Where to place received a/v pairs.
};

look at all those fields. send_pairs is what you're saying, receive_pairs is where the server's response lands, and retries is literally just "how many times are we gonna try this before we accept it's not happening." 😭 iconic behavior tbh.


πŸ’€ RETURN VALUE πŸ’€

here's the report card:

  • OK_RC (0) on success β€” slay, we ate. πŸ”₯
  • TIMEOUT_RC on timeout β€” the server left you on read. πŸ™ˆ
  • REJECT_RC on access reject β€” it said no, and it meant no.
  • negative on failure as return value β€” something went sideways, negative numbers are the universal "nah."
not me getting a negative return and having to cope πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, alphabetized like the little overachievers they are:

radcli.h(3), rc_aaa(3), rc_aaa_ctx(3), rc_aaa_ctx_free(3), rc_aaa_ctx_get_secret(3), rc_aaa_ctx_get_vector(3), rc_aaa_ctx_server(3), rc_acct(3), rc_acct_proxy(3), rc_add_config(3), rc_apply_config(3), rc_auth(3), rc_auth_proxy(3), rc_avpair_add(3), rc_avpair_assign(3), rc_avpair_copy(3), rc_avpair_free(3), rc_avpair_gen(3), rc_avpair_get(3), rc_avpair_get_attr(3), rc_avpair_get_in6(3), rc_avpair_get_raw(3), rc_avpair_get_uint32(3), rc_avpair_insert(3), rc_avpair_log(3), rc_avpair_new(3), rc_avpair_next(3), rc_avpair_parse(3), rc_avpair_remove(3), rc_avpair_tostr(3), rc_buildreq(3), rc_check(3), rc_check_tls(3), rc_conf_int(3), rc_conf_srv(3), rc_conf_str(3), rc_config_free(3), rc_config_init(3), rc_destroy(3), rc_dict_addattr(3), rc_dict_addval(3), rc_dict_addvend(3), rc_dict_findattr(3), rc_dict_findval(3), rc_dict_findvend(3), rc_dict_free(3), rc_dict_getattr(3), rc_dict_getval(3), rc_dict_getvend(3), rc_find_server_addr(3), rc_get_socket_type(3), rc_get_srcaddr(3), rc_getport(3), rc_mksid(3), rc_new(3), rc_openlog(3), rc_own_hostname(3), rc_read_config(3), rc_read_dictionary(3), rc_read_dictionary_from_buffer(3), rc_send_server(3), rc_setdebug(3), rc_test_config(3), rc_tls_fd(3)


okay that's the whole page bestie, go forth and send some servers 🫢✨

this lil masterpiece is brought to you by radcli, dated 2023-01-29 β€” she's been around a minute and she still ate. πŸ’…πŸŽ€

πŸ“¦ where this page comes from