         }
     }
 
+    /**
+     Input an IP packet.
+
+     - parameter data: the data containing the whole IP packet.
+     */
     public func receivedPacket(data: NSData) {
         dispatch_call {
             // Due to the limitation of swift, if we want a zero-copy implemention, we have to change the definition of `pbuf.payload` to `const`, which is not possible.

    let timer: dispatch_source_t
    let listenPCB: UnsafeMutablePointer<tcp_pcb>

    public var outputBlock: (([NSData], [NSNumber]) -> ())!

    public weak var delegate: TSIPStackDelegate?

    // Since all we need is a mock interface, we just use the loopback interface provided by lwip.
    // Do not need to add any interface.
    var interface: UnsafeMutablePointer<netif> {
        return netif_list
    }


/// The delegate that the developer should implement to handle what to do when a new TCP socket is connected.
public protocol TSIPStackDelegate: class {
    /**
     A new TCP socket is accepted. This means we received a new TCP packet containing SYN signal.

     - parameter sock: the socket object.
     */
    func didAcceptTCPSocket(sock: TSTCPSocket)
}

