|
Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include <string.h>#include "radius_pdu.h"#include "radius_pdu.def"#include "radius_attributes.def"Go to the source code of this file.
Macros | |
| #define | MIN_RADIUS_PDU_LEN 20 |
| #define | MAX_RADIUS_PDU_LEN 4095 |
| #define | INTEGER(name, octets) |
| #define | OCTETS(name, field_giving_octets) p->name = NULL; |
| #define | PDU(name, id, fields) |
| #define | ATTR(attr, type, string, min, max) |
| #define | UNASSIGNED(attr) |
| #define | ATTRIBUTES(fields) pdu->attr = dict_create(20, (void (*)(void *))octstr_destroy); |
| #define | INTEGER(name, octets) p->name = 0; |
| #define | OCTETS(name, field_giving_octets) octstr_destroy(p->name); |
| #define | PDU(name, id, fields) case id: { struct name *p = &pdu->u.name; fields } break; |
| #define | ATTR(attr, type, string, min, max) |
| #define | UNASSIGNED(attr) |
| #define | ATTRIBUTES(fields) dict_destroy(pdu->attr); |
| #define | ATTR(atype, type, string, pmin, pmax) |
| #define | UNASSIGNED(attr) |
| #define | ATTRIBUTES(fields) |
| #define | INTEGER(name, octets) append_encoded_integer(os, p->name, octets); |
| #define | OCTETS(name, field_giving_octets) octstr_append(os, p->name); |
| #define | PDU(name, id, fields) |
| #define | ATTR(atype, type, string, pmin, pmax) |
| #define | UNASSIGNED(attr) |
| #define | ATTRIBUTES(fields) |
| #define | INTEGER(name, octets) |
| #define | OCTETS(name, field_giving_octets) p->name = parse_get_octets(context, field_giving_octets); |
| #define | PDU(name, id, fields) |
| #define | UNASSIGNED(attr) |
| #define | ATTR(atype, type, string, pmin, pmax) |
| #define | ATTRIBUTES(fields) |
| #define | INTEGER(name, octets) debug("radius", 0, " %s: %lu = 0x%08lx", #name, p->name, p->name); |
| #define | OCTETS(name, field_giving_octets) octstr_dump_short(p->name, 2, #name); |
| #define | PDU(name, id, fields) |
Functions | |
| static unsigned long | decode_integer (Octstr *os, long pos, int octets) |
| static void | append_encoded_integer (Octstr *os, unsigned long u, long octets) |
| RADIUS_PDU * | radius_pdu_create (int type, RADIUS_PDU *req) |
| void | radius_pdu_destroy (RADIUS_PDU *pdu) |
| static Octstr * | radius_attr_pack (RADIUS_PDU *pdu) |
| Octstr * | radius_pdu_pack (RADIUS_PDU *pdu) |
| static Octstr * | radius_type_convert (int type, Octstr *value) |
| static void | radius_attr_unpack (ParseContext **context, RADIUS_PDU **pdu) |
| RADIUS_PDU * | radius_pdu_unpack (Octstr *data_without_len) |
| int | radius_authenticate_pdu (RADIUS_PDU *pdu, Octstr **data, Octstr *secret) |
| static void | radius_attr_dump (RADIUS_PDU *pdu) |
| void | radius_pdu_dump (RADIUS_PDU *pdu) |
| Octstr * | radius_get_attribute (RADIUS_PDU *pdu, Octstr *attribute) |
| #define ATTR | ( | atype, | |
| type, | |||
| string, | |||
| pmin, | |||
| pmax | |||
| ) |
| #define ATTR | ( | atype, | |
| type, | |||
| string, | |||
| pmin, | |||
| pmax | |||
| ) |
| #define ATTR | ( | atype, | |
| type, | |||
| string, | |||
| pmin, | |||
| pmax | |||
| ) |
| #define ATTRIBUTES | ( | fields | ) | pdu->attr = dict_create(20, (void (*)(void *))octstr_destroy); |
| #define ATTRIBUTES | ( | fields | ) | dict_destroy(pdu->attr); |
| #define ATTRIBUTES | ( | fields | ) |
| #define ATTRIBUTES | ( | fields | ) |
| #define ATTRIBUTES | ( | fields | ) |
| #define INTEGER | ( | name, | |
| octets | |||
| ) |
| #define INTEGER | ( | name, | |
| octets | |||
| ) | append_encoded_integer(os, p->name, octets); |
| #define INTEGER | ( | name, | |
| octets | |||
| ) |
| #define MAX_RADIUS_PDU_LEN 4095 |
Definition at line 73 of file radius_pdu.c.
| #define MIN_RADIUS_PDU_LEN 20 |
Definition at line 72 of file radius_pdu.c.
| #define OCTETS | ( | name, | |
| field_giving_octets | |||
| ) | octstr_destroy(p->name); |
| #define OCTETS | ( | name, | |
| field_giving_octets | |||
| ) | octstr_append(os, p->name); |
| #define OCTETS | ( | name, | |
| field_giving_octets | |||
| ) | p->name = parse_get_octets(context, field_giving_octets); |
| #define OCTETS | ( | name, | |
| field_giving_octets | |||
| ) | octstr_dump_short(p->name, 2, #name); |
| #define PDU | ( | name, | |
| id, | |||
| fields | |||
| ) |
| #define PDU | ( | name, | |
| id, | |||
| fields | |||
| ) |
| #define PDU | ( | name, | |
| id, | |||
| fields | |||
| ) |
| #define PDU | ( | name, | |
| id, | |||
| fields | |||
| ) |
| #define UNASSIGNED | ( | attr | ) |
| #define UNASSIGNED | ( | attr | ) |
| #define UNASSIGNED | ( | attr | ) |
| #define UNASSIGNED | ( | attr | ) |
| #define UNASSIGNED | ( | attr | ) |
|
static |
Definition at line 91 of file radius_pdu.c.
References octstr_append_char().
Referenced by radius_pdu_pack().
|
static |
Definition at line 76 of file radius_pdu.c.
References gw_assert(), octstr_get_char(), and octstr_len().
Referenced by radius_pdu_unpack(), and radius_type_convert().
|
static |
Definition at line 459 of file radius_pdu.c.
|
static |
Definition at line 210 of file radius_pdu.c.
References gw_assert(), and octstr_create.
|
static |
Definition at line 314 of file radius_pdu.c.
| int radius_authenticate_pdu | ( | RADIUS_PDU * | pdu, |
| Octstr ** | data, | ||
| Octstr * | secret | ||
| ) |
Definition at line 416 of file radius_pdu.c.
References md5(), octstr_append(), octstr_append_data(), octstr_compare(), octstr_copy, octstr_delete(), octstr_destroy(), octstr_duplicate, octstr_insert(), octstr_len(), RADIUS_PDU::type, and RADIUS_PDU::u.
Referenced by main(), proxy_thread(), and server().
| Octstr* radius_get_attribute | ( | RADIUS_PDU * | pdu, |
| Octstr * | attribute | ||
| ) |
Definition at line 498 of file radius_pdu.c.
References RADIUS_PDU::attr, dict_get(), and gw_assert().
| RADIUS_PDU* radius_pdu_create | ( | int | type, |
| RADIUS_PDU * | req | ||
| ) |
Definition at line 123 of file radius_pdu.c.
References error(), RADIUS_PDU::type, and type.
Referenced by main(), proxy_thread(), radius_pdu_unpack(), and server().
| void radius_pdu_destroy | ( | RADIUS_PDU * | pdu | ) |
Definition at line 156 of file radius_pdu.c.
References error(), and RADIUS_PDU::type.
Referenced by main(), proxy_thread(), and server().
| void radius_pdu_dump | ( | RADIUS_PDU * | pdu | ) |
| Octstr* radius_pdu_pack | ( | RADIUS_PDU * | pdu | ) |
Definition at line 237 of file radius_pdu.c.
References append_encoded_integer(), error(), gw_assert(), octstr_create, octstr_delete(), octstr_destroy(), octstr_insert(), octstr_len(), and RADIUS_PDU::type.
Referenced by main(), proxy_thread(), and server().
| RADIUS_PDU* radius_pdu_unpack | ( | Octstr * | data_without_len | ) |
Definition at line 360 of file radius_pdu.c.
References debug(), decode_integer(), error(), octstr_destroy(), octstr_dump_short(), octstr_len(), parse_context_create(), parse_context_destroy(), parse_get_char(), parse_get_octets(), parse_skip(), radius_pdu_create(), and type.
Referenced by main(), proxy_thread(), and server().
Definition at line 283 of file radius_pdu.c.
References decode_integer(), octstr_append(), octstr_append_cstr(), octstr_create, octstr_destroy(), octstr_format(), octstr_get_char(), octstr_get_cstr, panic, t_int, t_ipaddr, t_string, and type.