summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/l2tp/packet.c
AgeCommit message (Collapse)Author
2014-11-22remove trailing whitespacesDmitry Kozlov
2013-10-02l2tp: introduce data packet sequencing and reorder timeout supportVladislav Grishenko
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
2013-04-17l2tp: Handle 64 bits attributesGuillaume Nault
Define l2tp_packet_add_int64() to create attributes of 64 bits long integers. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-04-17l2tp: Full hidden AVPs supportGuillaume Nault
Add option "hide-avps" in the "l2tp" section for hiding attributes sent to peer. This same option is also made available on accel-ppp's command line interface: accel-ppp# tunnel create tunnel peer-addr 192.0.2.1 hide-avps 1 Attribute hiding is performed upon attribute creation (in the l2tp_packet_add_*() functions family) rather than upon packet sending. This avoid running the cipher for every retransmission; the counterpart is that l2tp_packet_print() can't dump original attributes of hidden AVPs. Currently, only one random vector is used for all hidden AVPs in a packet. This is easily extensible though, as the 'last_RV' field in struct l2tp_packet_t may be overridden to use new vectors for next AVPs. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-04-17l2tp: Handle incoming hidden AVPsGuillaume Nault
Decode hidden AVPs on reception. This is transparent for functions in l2tp.c (except for the presence of the Random Vector AVP). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-04-17l2tp: Fix endianness of 64 bits AVPs (reception)Guillaume Nault
Received attributes of type ATTR_TYPE_INT64 are transferred to upper layer in network byte order while any other integer type uses host byte order. This patch converts int64 values to host byte order so that they can be used like other integer types. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-04-17l2tp: Fix double string AVP copyGuillaume Nault
When adding a string AVP to an L2TP packet, the attribute value is allocated and set using strdup(). There's no need to memcpy() it again afterwards. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-13l2tp: Add const qualifier to packet allocation functionGuillaume Nault
Define the address parameter of l2tp_packet_alloc() as constant. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-13l2tp: Add const qualifier for l2tp_packet_print()Guillaume Nault
Declare parameters and variables of l2tp_packet_print() as constant. Also update l2tp_dict_find_value() prototype to accept options passed by l2tp_packet_print(). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12l2tp: Send L2TP messages with sendto()Guillaume Nault
Send L2TP messages to the host set in the addr field of l2tp_packet_t, instead of relying on the file descriptor's connection state. This will allow the file descriptor to be disconnected (allowing it to wait for a message from an arbitrary source port) while still being able to retransmit previous L2TP messages. This possibility is necessary for initiating tunnel establishment: the initial SCCRQ is sent to the peer on port 1701, but the peer may reply with an arbitrary source port. The socket thus needs to be disconnected to be able to receive the peer's SCCRP. But in the mean time, the initial SCCRQ may need to be retransmitted (if no answer is received from the peer after a given amount of time). Hence the need for sending L2TP messages over unconnected sockets. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-01-24backport 1.7Kozlov Dmitry
* l2tp: Fix allocation checking when adding octets AVP * cli, tcp: Fix non-NULL terminated string reception * Fix va_end() missing calls * chap-secrets: implemented encryption * auth_pap: make messages like other auth modules * cli: check xmit_buf is not null at enter to write function * pppoe: implemented regular expression support * chap-secrets: implemented encryption * ippool: fixed initialization order * optional shaper compiling * ppp: dns/wins code cleanup
2012-09-09l2tp: print tid and sid as unsignedKozlov Dmitry
2012-09-05Fix format string errorsGuillaume Nault
Fix several errors and compiler warnings in format string arguments. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2012-08-23L2TP: Tear down tunnel when peer stops listeningGuillaume Nault
Stop sending messages on tunnels for which no peer is listening. Discard retransmissions too. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2012-05-22Some AVP we are not handling yet, and it is better to provide optionKozlov Dmitry
to ignore them, instead of refusing connection. Signed-off-by: Denys Fedoryshchenko <denys@visp.net.lb>
2011-05-30rewrited initialization procedure (fix gcc-4.6 builds)Kozlov Dmitry
2011-01-05rename accel-pptp to accel-pppDmitry Kozlov