Lines Matching refs:das
34 static struct radius_msg * radius_das_disconnect(struct radius_das_data *das, in radius_das_disconnect() argument
147 res = das->disconnect(das->ctx, &attrs); in radius_das_disconnect()
192 static struct radius_msg * radius_das_coa(struct radius_das_data *das, in radius_das_coa() argument
227 if (!das->coa) { in radius_das_coa()
336 res = das->coa(das->ctx, &attrs); in radius_das_coa()
383 struct radius_das_data *das = eloop_ctx; in radius_das_receive() local
416 if (das->client_addr.u.v4.s_addr && in radius_das_receive()
417 das->client_addr.u.v4.s_addr != from.sin.sin_addr.s_addr) { in radius_das_receive()
432 if (radius_msg_verify_das_req(msg, das->shared_secret, in radius_das_receive()
433 das->shared_secret_len, in radius_das_receive()
434 das->require_message_authenticator)) { in radius_das_receive()
447 das->time_window) { in radius_das_receive()
455 } else if (das->require_event_timestamp) { in radius_das_receive()
465 reply = radius_das_disconnect(das, msg, abuf, from_port); in radius_das_receive()
468 reply = radius_das_coa(das, msg, abuf, from_port); in radius_das_receive()
486 if (radius_msg_finish_das_resp(reply, das->shared_secret, in radius_das_receive()
487 das->shared_secret_len, hdr) < in radius_das_receive()
497 res = sendto(das->sock, wpabuf_head(rbuf), in radius_das_receive()
539 struct radius_das_data *das; in radius_das_init() local
545 das = os_zalloc(sizeof(*das)); in radius_das_init()
546 if (das == NULL) in radius_das_init()
549 das->time_window = conf->time_window; in radius_das_init()
550 das->require_event_timestamp = conf->require_event_timestamp; in radius_das_init()
551 das->require_message_authenticator = in radius_das_init()
553 das->ctx = conf->ctx; in radius_das_init()
554 das->disconnect = conf->disconnect; in radius_das_init()
555 das->coa = conf->coa; in radius_das_init()
557 os_memcpy(&das->client_addr, conf->client_addr, in radius_das_init()
558 sizeof(das->client_addr)); in radius_das_init()
560 das->shared_secret = os_memdup(conf->shared_secret, in radius_das_init()
562 if (das->shared_secret == NULL) { in radius_das_init()
563 radius_das_deinit(das); in radius_das_init()
566 das->shared_secret_len = conf->shared_secret_len; in radius_das_init()
568 das->sock = radius_das_open_socket(conf->port); in radius_das_init()
569 if (das->sock < 0) { in radius_das_init()
572 radius_das_deinit(das); in radius_das_init()
576 if (eloop_register_read_sock(das->sock, radius_das_receive, das, NULL)) in radius_das_init()
578 radius_das_deinit(das); in radius_das_init()
582 return das; in radius_das_init()
586 void radius_das_deinit(struct radius_das_data *das) in radius_das_deinit() argument
588 if (das == NULL) in radius_das_deinit()
591 if (das->sock >= 0) { in radius_das_deinit()
592 eloop_unregister_read_sock(das->sock); in radius_das_deinit()
593 close(das->sock); in radius_das_deinit()
596 os_free(das->shared_secret); in radius_das_deinit()
597 os_free(das); in radius_das_deinit()