Deprecated fork of old network stack source from github. Please use official library instead: https://mbed.org/users/mbed_official/code/EthernetInterface/

Committer:
AdamGreen
Date:
Sat Oct 26 08:51:36 2013 +0000
Revision:
1:eadc868c2acf
Parent:
0:3b00827bb0b7
Fix TCP checksum bug and stranded large TCP segments.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AdamGreen 0:3b00827bb0b7 1 /* Copyright (C) 2012 mbed.org, MIT License
AdamGreen 0:3b00827bb0b7 2 *
AdamGreen 0:3b00827bb0b7 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
AdamGreen 0:3b00827bb0b7 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
AdamGreen 0:3b00827bb0b7 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
AdamGreen 0:3b00827bb0b7 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
AdamGreen 0:3b00827bb0b7 7 * furnished to do so, subject to the following conditions:
AdamGreen 0:3b00827bb0b7 8 *
AdamGreen 0:3b00827bb0b7 9 * The above copyright notice and this permission notice shall be included in all copies or
AdamGreen 0:3b00827bb0b7 10 * substantial portions of the Software.
AdamGreen 0:3b00827bb0b7 11 *
AdamGreen 0:3b00827bb0b7 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
AdamGreen 0:3b00827bb0b7 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
AdamGreen 0:3b00827bb0b7 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
AdamGreen 0:3b00827bb0b7 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
AdamGreen 0:3b00827bb0b7 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AdamGreen 0:3b00827bb0b7 17 */
AdamGreen 0:3b00827bb0b7 18 #ifndef ENDPOINT_H
AdamGreen 0:3b00827bb0b7 19 #define ENDPOINT_H
AdamGreen 0:3b00827bb0b7 20
AdamGreen 0:3b00827bb0b7 21 class UDPSocket;
AdamGreen 0:3b00827bb0b7 22
AdamGreen 0:3b00827bb0b7 23 /**
AdamGreen 0:3b00827bb0b7 24 IP Endpoint (address, port)
AdamGreen 0:3b00827bb0b7 25 */
AdamGreen 0:3b00827bb0b7 26 class Endpoint {
AdamGreen 0:3b00827bb0b7 27 friend class UDPSocket;
AdamGreen 0:3b00827bb0b7 28
AdamGreen 0:3b00827bb0b7 29 public:
AdamGreen 0:3b00827bb0b7 30 /** IP Endpoint (address, port)
AdamGreen 0:3b00827bb0b7 31 */
AdamGreen 0:3b00827bb0b7 32 Endpoint(void);
AdamGreen 0:3b00827bb0b7 33
AdamGreen 0:3b00827bb0b7 34 ~Endpoint(void);
AdamGreen 0:3b00827bb0b7 35
AdamGreen 0:3b00827bb0b7 36 /** Reset the address of this endpoint
AdamGreen 0:3b00827bb0b7 37 */
AdamGreen 0:3b00827bb0b7 38 void reset_address(void);
AdamGreen 0:3b00827bb0b7 39
AdamGreen 0:3b00827bb0b7 40 /** Set the address of this endpoint
AdamGreen 0:3b00827bb0b7 41 \param host The endpoint address (it can either be an IP Address or a hostname that will be resolved with DNS).
AdamGreen 0:3b00827bb0b7 42 \param port The endpoint port
AdamGreen 0:3b00827bb0b7 43 \return 0 on success, -1 on failure (when an hostname cannot be resolved by DNS).
AdamGreen 0:3b00827bb0b7 44 */
AdamGreen 0:3b00827bb0b7 45 int set_address(const char* host, const int port);
AdamGreen 0:3b00827bb0b7 46
AdamGreen 0:3b00827bb0b7 47 /** Get the IP address of this endpoint
AdamGreen 0:3b00827bb0b7 48 \return The IP address of this endpoint.
AdamGreen 0:3b00827bb0b7 49 */
AdamGreen 0:3b00827bb0b7 50 char* get_address(void);
AdamGreen 0:3b00827bb0b7 51
AdamGreen 0:3b00827bb0b7 52 /** Get the port of this endpoint
AdamGreen 0:3b00827bb0b7 53 \return The port of this endpoint
AdamGreen 0:3b00827bb0b7 54 */
AdamGreen 0:3b00827bb0b7 55 int get_port(void);
AdamGreen 0:3b00827bb0b7 56
AdamGreen 0:3b00827bb0b7 57 protected:
AdamGreen 0:3b00827bb0b7 58 char _ipAddress[17];
AdamGreen 0:3b00827bb0b7 59 struct sockaddr_in _remoteHost;
AdamGreen 0:3b00827bb0b7 60
AdamGreen 0:3b00827bb0b7 61 };
AdamGreen 0:3b00827bb0b7 62
AdamGreen 0:3b00827bb0b7 63 #endif