Commit Graph

293 Commits

Author SHA1 Message Date
Alexander Couzens b6f79da5d4 l2tpd_fsm: sent out a TCRQ after control connection is established 2016-11-05 18:46:34 +01:00
Alexander Couzens 69ceeaed98 l2tpd_fsm: allow to receive L2CC_E_RX_STOP_CCN in L2CC_S_WAIT_CTL_CONN
L2CC_E_RX_STOP_CCN can received at any state
2016-11-05 18:46:34 +01:00
Alexander Couzens 218d6bfb2b l2tpd_fsm: add control connection states L2CC_S_WAIT_FOR_TCRP, L2CC_S_ESTABLISHED_CONFIGURED
L2CC_S_WAIT_FOR_TCRP = after sending a TCRQ
L2CC_S_ESTABLISHED_CONFIGURED = when the connection is fully initialized
2016-11-05 18:46:34 +01:00
Alexander Couzens f53b8c2d89 l2tpd: free msgb after handling everything 2016-11-05 18:46:34 +01:00
Alexander Couzens b4492aadc0 l2tpd_fsm: send stop ccn on local close requests events 2016-11-05 18:46:34 +01:00
Alexander Couzens 3ddd41af49 l2tpd_packet: implement l2tp_tx_stop_ccn 2016-11-05 18:46:34 +01:00
Alexander Couzens 96325559cc l2tpd: log allocation of new CC with local + remote id 2016-11-05 18:46:34 +01:00
Alexander Couzens ea517a5c3f l2tpd_fsm: answer to a to STOP CCN with an ACK
still a TODO to tear down the fsm and struct
2016-11-05 18:46:34 +01:00
Alexander Couzens 742cefd877 l2tpd: set l2i->next_l_ccid to 1
0 is reserved for discovery. so 0 should never assigned to a control connection
2016-11-05 18:46:34 +01:00
Alexander Couzens 9a62671a1d l2tpd_fsm: answer to a SCCCN with a ACK 2016-11-05 18:46:34 +01:00
Alexander Couzens ef32f6a29c l2tpd_packet: fix removal of forgotten local_cid in l2tpd_cc_alloc() 2016-11-05 18:46:34 +01:00
Alexander Couzens 528d3e0f56 l2tpd_packet: l2tp_tx_ack change to a control connection message
TX Ack is used by control connection, not by session management
2016-11-05 18:46:34 +01:00
Alexander Couzens 5945990ad0 l2tpd_packet: add l2tp_connection *l2c into receive functions and lookup the cid 2016-11-05 18:46:34 +01:00
Alexander Couzens e44b1ae254 l2tpd_data: add ccid to fsm id
allows to identifiy the fsm instances
2016-11-05 18:46:34 +01:00
Alexander Couzens f9624482f9 l2tpd_packet: correct digest, the first byte must be zero in the message
the first byte is the type of digest (hmac-md5)
2016-11-05 18:46:34 +01:00
Alexander Couzens 5ab24f72c6 l2tpd_packet: set router_id to the same value of trace 2016-11-05 18:46:34 +01:00
Alexander Couzens 666401c275 l2tp_instance: setsockopt to the same tos value of bsc 2016-11-05 18:46:34 +01:00
Alexander Couzens 39e6497b24 l2tp_protocol: correct value of AVP_IETF_AS_CTRL_CON_ID 2016-11-05 18:46:34 +01:00
Alexander Couzens 4602ec2dc1 l2tpd_packet: first packet already count, set the l2c->next_rx_seq_nr = 1 2016-11-05 18:46:34 +01:00
Alexander Couzens d6e6a08876 l2tpd_packet: add vendor_name = Ericsson to SCCRP 2016-11-05 18:46:34 +01:00
Alexander Couzens a81b4b2899 l2tpd_packet: also do htons/htonl in avpp_val_u16/32 2016-11-05 18:46:34 +01:00
Alexander Couzens 58903d4534 l2tpd_packet: use msgb_data / msgb_length when transmitting 2016-11-05 18:46:34 +01:00
Alexander Couzens 5181d6c53e l2tpd_packet: complete l2tp control header
missing session id and incorrect lenght / version field
2016-11-05 18:46:34 +01:00
Alexander Couzens ebfe1b820e l2tpd_packet/digest_avp_update: fix search AVP digest 2016-11-05 18:46:34 +01:00
Alexander Couzens bb0a398443 l2tpd_packet/digest_avp_update: use msgb_data / msgb_lenght 2016-11-05 18:46:34 +01:00
Alexander Couzens bea8a56ee5 l2tpd: l2tp_msgb_alloc(): sets now l2h -> msg->data 2016-11-05 18:46:34 +01:00
Alexander Couzens 9e4a331c63 l2tpd_fsm: use priv instead of data
data contains the msgbuffer
2016-11-05 18:46:34 +01:00
Alexander Couzens 5676bc5c0d l2tpd_fsm: sent out SCCRP 2016-11-05 18:46:34 +01:00
Alexander Couzens e12de53b9b l2tpd_packet: return 0 on success in l2tp_msgb_tx() 2016-11-05 18:46:34 +01:00
Alexander Couzens 09742c5594 l2tpd_packet: set msg->dst = l2c
when using a session this is an expensive call
2016-11-05 18:46:34 +01:00
Alexander Couzens ec1234f258 l2tpd_packet: use l2c/l2s instead of ls lc as everywhere else in the tree 2016-11-05 18:46:34 +01:00
Alexander Couzens 1542e1ecfa l2tpd_packet: make tx function public
will be used by the fsm
2016-11-05 18:46:34 +01:00
Alexander Couzens e46a88b1c7 l2tpd.c: move packet handling out of l2tpd.c into l2tpd_packet.c 2016-11-05 18:46:34 +01:00
Alexander Couzens 14b0647687 l2tpd: fixup dont lookup l2tp_rcvmsg over ip
forgotten function signature
2016-11-05 18:46:34 +01:00
Alexander Couzens b41b85da8f l2tpd: dont lookup l2tp_rcvmsg over ip 2016-11-05 18:46:34 +01:00
Alexander Couzens 4193842565 l2tpd: save sockaddr over msg->dst into l2c->remote.ss 2016-11-05 18:46:34 +01:00
Alexander Couzens f1f53f8299 l2tpd/rx_scc_rq: use msgb_data to get the correct data 2016-11-05 18:46:34 +01:00
Alexander Couzens c4829beac5 l2tpd_data: add l2c as private data to fsm 2016-11-05 18:46:34 +01:00
Alexander Couzens 8eaf1a5a33 l2tpd: add transmit / sendto function 2016-11-05 18:46:34 +01:00
Alexander Couzens 149a333a10 l2tpd/l2tp_ip_read_cb: use msgb_data for recvfrom and set msgb pointer to l2h=l2tp, l1h=ip 2016-11-05 18:46:34 +01:00
Alexander Couzens 8d08b49b7d l2tpd/rx_scc_rq: fix pseudowire cap check by using htons() 2016-11-05 18:46:34 +01:00
Alexander Couzens c3d682fccf l2tpd/msgb_avp_parse: fix pointer arithmethic and length checks 2016-11-05 18:46:34 +01:00
Alexander Couzens 63c3186918 l2tpd: use l2tp_rcvmsg_control() must use msgb_data instead of msgb_l2tph 2016-11-05 18:46:34 +01:00
Alexander Couzens 28edd890b2 l2tpd: increase tailroom to 1500 2016-11-05 18:46:34 +01:00
Alexander Couzens b649d88d1b l2tpd: correct value of S_BIT (sequence bit) 2016-11-05 18:46:34 +01:00
Alexander Couzens 83f08bc39a l2tpd_data: rename variable `l2tpd_instance inst -> l2tp` to conform to the rest of the source 2016-11-05 18:46:34 +01:00
Alexander Couzens 2f6a0ee5d4 l2tpd: register fsms 2016-11-05 18:46:34 +01:00
Alexander Couzens 56521e1410 l2tpd: add logging to stderr 2016-11-05 18:46:34 +01:00
Alexander Couzens eba878e472 l2tpd/Makefile: add EXTRA_CFLAGS 2016-11-05 18:46:34 +01:00
Alexander Couzens bfe924c91f l2tpd: init talloc and use it for l2tpd_instance l2i 2016-11-05 18:46:34 +01:00