1. 16 3月, 2013 11 次提交
  2. 18 2月, 2013 3 次提交
  3. 14 2月, 2013 2 次提交
  4. 13 2月, 2013 13 次提交
  5. 12 2月, 2013 11 次提交
    • G
      l2tp: Add support for placing incomming calls · 5b5ad372
      Guillaume Nault 提交于
      Implement incomming call placement for tunnels operating as LAC.
      A user can place incomming calls using the command line interface.
      For example, the following command will place a call on tunnel 1:
        accel-ppp# l2tp create session tid 1
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      5b5ad372
    • G
      l2tp: Implement on demand tunnel creation · 49ef69e6
      Guillaume Nault 提交于
      Add the "l2tp create tunnel" command to initiate new tunnels.
      
      This command accepts three parameters:
        * peer-addr (mandatory): IPv4 address of the remote tunnel end.
      
        * host-addr (optional): IPv4 address of the local tunnel end.
          By default the "l2tp bind" configuration option is used (if
          defined).
      
        * mode (optional): tunnel operating mode: lac (default) or lns.
      
      Example with the telnet interface:
        accel-ppp# l2tp create tunnel peer-addr 192.0.2.1 host-addr 192.0.2.2
      
      The above command tells accel-ppp to establish a new tunnel with the
      peer at 192.0.2.1. The local address will be 192.0.2.2 and the tunnel
      will operate as lac.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      49ef69e6
    • G
      l2tp: Connect to peer once first reply received · a517397a
      Guillaume Nault 提交于
      When peer's port isn't known (i.e. right after a tunnel establishment
      request has been sent), use the source port of the first peer's
      response as the destination port of any future L2TP message sent over
      that tunnel.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      a517397a
    • G
      l2tp: Send L2TP messages with sendto() · d44c0728
      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: NGuillaume Nault <g.nault@alphalink.fr>
      d44c0728
    • G
      l2tp: Replace the lns_addr tunnel field by host_addr · 947076a2
      Guillaume Nault 提交于
      Rename field lns_addr, as it identifies the host address, whether it be
      a LAC or a LNS.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      947076a2
    • G
      l2tp: Replace the lac_addr tunnel field by peer_addr · 10642369
      Guillaume Nault 提交于
      Rename field lac_addr, as it identifies the peer address, whether it be
      a LAC or a LNS.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      10642369
    • G
      l2tp: Add l2tp mode flag (LAC or LNS) · f478f82d
      Guillaume Nault 提交于
      Define the lns_mode flag for tunnels and sessions to keep track
      of their operating state. A session's mode is inherited from its
      parent tunnel.
      The session's mode is used to set the PPPOL2TP_SO_LNSMODE socket
      option to its PPP socket.
      For tunnels, the mode is used to define how new sessions may be
      created:
        -In LNS mode, new sessions may be created by accepting incomming
         calls (ICRQ) or by placing outgoing calls (OCRQ).
        -In LAC mode, tunnels will create sessions by accepting outgoing
         calls or by placing incomming calls.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      f478f82d
    • G
      l2tp: Add WAIT_SCCRP state · c7a77438
      Guillaume Nault 提交于
      Define STATE_WAIT_SCCRP which will be required for creating new tunnels
      on behalf of the host. This state will be entered right after sending
      an SCCRQ message.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      c7a77438
    • G
      l2tp: Update Ns/Nr handling · 99fc06cb
      Guillaume Nault 提交于
      Change the meaning of the Nr field in struct l2tp_conn_t: instead of
      setting it to the last received message sequence, set it with the
      value of the next expected message sequence number (i.e. one above
      the previous value). This simplifies processing and avoids the
      l2tp_send() function to increment the L2TP packet Nr field (it's now
      directly set to the correct value).
      Having Nr correctly set before calling l2tp_send() is necessary for
      implementing tunnel establishment requests (SCCRQ messages) since the
      Nr field of this message must be 0.
      
      This patch also replaces the formula used to check if a message Ns is
      lower than a tunnel Nr.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      99fc06cb
    • G
      l2tp: Set LNS address with the one really bound to · 9c9ff616
      Guillaume Nault 提交于
      When allocating tunnels, set the lns_addr field of tunnels using
      getsockname() instead of using the "host" parameter. This will allow
      the caller to pass an unspecified port in "host" (for binding to
      any source port) and to set the lns_addr field with the address really
      bound to.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      9c9ff616
    • G
      l2tp: Remove unused parameter in tunnel allocation · da4739b1
      Guillaume Nault 提交于
      Remove the "serv" parameter from l2tp_tunnel_alloc() prototype.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      da4739b1