1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
13 /*>>>>>>>>>>>>>>>>>>>>>>> DEFINITIONS & DECLARATIONS <<<<<<<<<<<<<<<<<<<<*/
16 #include <sys/socket.h>
19 /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LOCAL VARIABLES <<<<<<<<<<<<<<<<<<<<<<<<<*/
21 /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>> IMPLEMENTATION <<<<<<<<<<<<<<<<<<<<<<<<<<*/
25 * TCP: Handles TCP-packets according to Receive-handle diagram.
27 * @param tcp_packet TCP-packet to be handled
28 * @param packetsize Length of the packet
29 * @return ZERO - packet handled successfully;
30 * NON ZERO - packet was not handled (e.g. bad format)
33 handle_tcp(uint8_t * tcp_packet, int32_t packetsize)
40 * NET: This function handles situation when "Destination unreachable"
41 * ICMP-error occurs during sending TCP-packet.
43 * @param err_code Error Code (e.g. "Host unreachable")
44 * @param packet original TCP-packet
45 * @param packetsize length of the packet
49 handle_tcp_dun(uint8_t * tcp_packet, uint32_t packetsize, uint8_t err_code) {