Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ip.c File Reference
IPv4 and IPv6 common routines. More...
Go to the source code of this file.
Functions | |
error_t | ipSendDatagram (NetInterface *interface, IpPseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, uint8_t ttl) |
Send an IP datagram. | |
error_t | ipSelectSourceAddr (NetInterface **interface, const IpAddr *destAddr, IpAddr *srcAddr) |
IP source address selection. | |
uint16_t | ipCalcChecksum (const void *data, size_t length) |
IP checksum calculation. | |
uint16_t | ipCalcChecksumEx (const NetBuffer *buffer, size_t offset, size_t length) |
Calculate IP checksum over a multi-part buffer. | |
uint16_t | ipCalcUpperLayerChecksum (const void *pseudoHeader, size_t pseudoHeaderLength, const void *data, size_t dataLength) |
Calculate IP upper-layer checksum. | |
uint16_t | ipCalcUpperLayerChecksumEx (const void *pseudoHeader, size_t pseudoHeaderLength, const NetBuffer *buffer, size_t offset, size_t length) |
Calculate IP upper-layer checksum over a multi-part buffer. | |
NetBuffer * | ipAllocBuffer (size_t length, size_t *offset) |
Allocate a buffer to hold an IP packet. | |
error_t | ipJoinMulticastGroup (NetInterface *interface, const IpAddr *groupAddr) |
Join the specified host group. | |
error_t | ipLeaveMulticastGroup (NetInterface *interface, const IpAddr *groupAddr) |
Leave the specified host group. | |
bool_t | ipIsUnspecifiedAddr (const IpAddr *ipAddr) |
Compare an IP address against the unspecified address. | |
error_t | ipStringToAddr (const char_t *str, IpAddr *ipAddr) |
Convert a string representation of an IP address to a binary IP address. | |
char_t * | ipAddrToString (const IpAddr *ipAddr, char_t *str) |
Convert a binary IP address to a string representation. |
Detailed Description
IPv4 and IPv6 common routines.
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file ip.c.
Function Documentation
char_t* ipAddrToString | ( | const IpAddr * | ipAddr, |
char_t * | str | ||
) |
NetBuffer* ipAllocBuffer | ( | size_t | length, |
size_t * | offset | ||
) |
uint16_t ipCalcChecksum | ( | const void * | data, |
size_t | length | ||
) |
uint16_t ipCalcChecksumEx | ( | const NetBuffer * | buffer, |
size_t | offset, | ||
size_t | length | ||
) |
uint16_t ipCalcUpperLayerChecksum | ( | const void * | pseudoHeader, |
size_t | pseudoHeaderLength, | ||
const void * | data, | ||
size_t | dataLength | ||
) |
uint16_t ipCalcUpperLayerChecksumEx | ( | const void * | pseudoHeader, |
size_t | pseudoHeaderLength, | ||
const NetBuffer * | buffer, | ||
size_t | offset, | ||
size_t | length | ||
) |
Calculate IP upper-layer checksum over a multi-part buffer.
- Parameters:
-
[in] pseudoHeader Pointer to the pseudo header [in] pseudoHeaderLength Pseudo header length [in] buffer Multi-part buffer containing the upper-layer data [in] offset Offset from the first data byte to process [in] length Number of data bytes to process
- Returns:
- Checksum value
bool_t ipIsUnspecifiedAddr | ( | const IpAddr * | ipAddr ) |
IP source address selection.
This function selects the source address and the relevant network interface to be used in order to join the specified destination address
- Parameters:
-
[in,out] interface A pointer to a valid network interface may be provided as a hint. The function returns a pointer identifying the interface to be used [in] destAddr Destination IP address [out] srcAddr Local IP address to be used
- Returns:
- Error code
error_t ipSendDatagram | ( | NetInterface * | interface, |
IpPseudoHeader * | pseudoHeader, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
uint8_t | ttl | ||
) |
Send an IP datagram.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader IP pseudo header [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first payload byte [in] ttl TTL value. Default Time-To-Live is used when this parameter is zero
- Returns:
- Error code
Generated on Tue Jul 12 2022 17:10:20 by
