diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2014-01-16 21:25:09 +0100 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-01-17 15:35:27 +0400 |
commit | d0c5faf047fa085795e6881b67bcb6af73b2a90d (patch) | |
tree | 8c7c1ad5d48571f8d4cd3a4358376514ce66384f /accel-pppd/ctrl/pppoe | |
parent | 3853053fc88c1b9a34b90174de25c5965a484e1b (diff) | |
download | accel-ppp-d0c5faf047fa085795e6881b67bcb6af73b2a90d.tar.gz accel-ppp-d0c5faf047fa085795e6881b67bcb6af73b2a90d.zip |
pppoe: add missing support for some TR-101 sub-tags
These are all 4 bytes integer values, except ACCESS_LOOP_ENCAP
which represents three independant values of one byte each.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl/pppoe')
-rw-r--r-- | accel-pppd/ctrl/pppoe/tr101.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pppoe/tr101.c b/accel-pppd/ctrl/pppoe/tr101.c index 1d77f2ea..ee3b78d3 100644 --- a/accel-pppd/ctrl/pppoe/tr101.c +++ b/accel-pppd/ctrl/pppoe/tr101.c @@ -17,6 +17,17 @@ #define OPT_ACTUAL_DATA_RATE_DOWN 0x82 #define OPT_MIN_DATA_RATE_UP 0x83 #define OPT_MIN_DATA_RATE_DOWN 0x84 +#define OPT_ATT_DATA_RATE_UP 0x85 +#define OPT_ATT_DATA_RATE_DOWN 0x86 +#define OPT_MAX_DATA_RATE_UP 0x87 +#define OPT_MAX_DATA_RATE_DOWN 0x88 +#define OPT_MIN_DATA_RATE_UP_LP 0x89 +#define OPT_MIN_DATA_RATE_DOWN_LP 0x8A +#define OPT_MAX_INTERL_DELAY_UP 0x8B +#define OPT_ACTUAL_INTERL_DELAY_UP 0x8C +#define OPT_MAX_INTER_DELAY_DOWN 0x8D +#define OPT_ACTUAL_INTER_DELAY_DOWN 0x8E +#define ACCESS_LOOP_ENCAP 0x90 static int tr101_send_request(struct pppoe_tag *tr101, struct rad_packet_t *pack, int type) { @@ -81,6 +92,73 @@ static int tr101_send_request(struct pppoe_tag *tr101, struct rad_packet_t *pack if (rad_packet_add_int(pack, "ADSL-Forum", "Minimum-Data-Rate-Downstream", ntohl(*(uint32_t *)ptr))) return -1; break; + case OPT_ATT_DATA_RATE_UP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Attainable-Data-Rate-Upstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_ATT_DATA_RATE_DOWN: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Attainable-Data-Rate-Downstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MAX_DATA_RATE_UP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Maximum-Data-Rate-Upstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MAX_DATA_RATE_DOWN: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Maximum-Data-Rate-Downstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MIN_DATA_RATE_UP_LP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Minimum-Data-Rate-Upstream-Low-Power", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MIN_DATA_RATE_DOWN_LP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Minimum-Data-Rate-Downstream-Low-Power", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MAX_INTERL_DELAY_UP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Maximum-Interleaving-Delay-Upstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_ACTUAL_INTERL_DELAY_UP: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Actual-Interleaving-Delay-Upstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_MAX_INTER_DELAY_DOWN: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Maximum-Interleaving-Delay-Downstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case OPT_ACTUAL_INTER_DELAY_DOWN: + if (len != 4) + goto inval; + if (rad_packet_add_int(pack, "ADSL-Forum", "Actual-Interleaving-Delay-Downstream", ntohl(*(uint32_t *)ptr))) + return -1; + break; + case ACCESS_LOOP_ENCAP: + if (len != 3) + goto inval; + memcpy(str, ptr, 3); + if (rad_packet_add_octets(pack, "ADSL-Forum", "Access-Loop-Encapsulation", (uint8_t *)str, 3)) + return -1; + break; } ptr += len; } |