Lines Matching defs:das
2 * RADIUS Dynamic Authorization Server (DAS) (RFC 5176)
33 static struct radius_msg * radius_das_disconnect(struct radius_das_data *das,
68 wpa_printf(MSG_INFO, "DAS: Unsupported attribute %u in "
80 wpa_printf(MSG_INFO, "DAS: Invalid NAS-IP-Address from %s:%d",
92 wpa_printf(MSG_INFO, "DAS: Invalid NAS-IPv6-Address from %s:%d",
114 wpa_printf(MSG_INFO, "DAS: Invalid Calling-Station-Id "
146 res = das->disconnect(das->ctx, &attrs);
149 wpa_printf(MSG_INFO, "DAS: NAS mismatch from %s:%d",
154 wpa_printf(MSG_INFO, "DAS: Session not found for request from "
160 "DAS: Multiple sessions match for request from %s:%d",
189 struct radius_das_data *das = eloop_ctx;
213 wpa_printf(MSG_ERROR, "DAS: recvfrom: %s", strerror(errno));
220 wpa_printf(MSG_DEBUG, "DAS: Received %d bytes from %s:%d",
222 if (das->client_addr.u.v4.s_addr != from.sin.sin_addr.s_addr) {
223 wpa_printf(MSG_DEBUG, "DAS: Drop message from unknown client");
229 wpa_printf(MSG_DEBUG, "DAS: Parsing incoming RADIUS packet "
237 if (radius_msg_verify_das_req(msg, das->shared_secret,
238 das->shared_secret_len,
239 das->require_message_authenticator)) {
241 "DAS: Invalid authenticator or Message-Authenticator in packet from %s:%d - drop",
252 das->time_window) {
253 wpa_printf(MSG_DEBUG, "DAS: Unacceptable "
260 } else if (das->require_event_timestamp) {
261 wpa_printf(MSG_DEBUG, "DAS: Missing Event-Timestamp in packet "
270 reply = radius_das_disconnect(das, msg, abuf, from_port);
288 wpa_printf(MSG_DEBUG, "DAS: Unexpected RADIUS code %u in "
294 wpa_printf(MSG_DEBUG, "DAS: Reply to %s:%d", abuf, from_port);
299 wpa_printf(MSG_DEBUG, "DAS: Failed to add "
303 if (radius_msg_finish_das_resp(reply, das->shared_secret,
304 das->shared_secret_len, hdr) <
306 wpa_printf(MSG_DEBUG, "DAS: Failed to add "
314 res = sendto(das->sock, wpabuf_head(rbuf),
318 wpa_printf(MSG_ERROR, "DAS: sendto(to %s:%d): %s",
336 wpa_printf(MSG_INFO, "RADIUS DAS: socket: %s", strerror(errno));
344 wpa_printf(MSG_INFO, "RADIUS DAS: bind: %s", strerror(errno));
356 struct radius_das_data *das;
362 das = os_zalloc(sizeof(*das));
363 if (das == NULL)
366 das->time_window = conf->time_window;
367 das->require_event_timestamp = conf->require_event_timestamp;
368 das->require_message_authenticator =
370 das->ctx = conf->ctx;
371 das->disconnect = conf->disconnect;
373 os_memcpy(&das->client_addr, conf->client_addr,
374 sizeof(das->client_addr));
376 das->shared_secret = os_malloc(conf->shared_secret_len);
377 if (das->shared_secret == NULL) {
378 radius_das_deinit(das);
381 os_memcpy(das->shared_secret, conf->shared_secret,
383 das->shared_secret_len = conf->shared_secret_len;
385 das->sock = radius_das_open_socket(conf->port);
386 if (das->sock < 0) {
388 "DAS");
389 radius_das_deinit(das);
393 if (eloop_register_read_sock(das->sock, radius_das_receive, das, NULL))
395 radius_das_deinit(das);
399 return das;
403 void radius_das_deinit(struct radius_das_data *das)
405 if (das == NULL)
408 if (das->sock >= 0) {
409 eloop_unregister_read_sock(das->sock);
410 close(das->sock);
413 os_free(das->shared_secret);
414 os_free(das);