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.
ipv4.c File Reference
IPv4 (Internet Protocol Version 4) More...
Go to the source code of this file.
Functions | |
error_t | ipv4Init (NetInterface *interface) |
IPv4 related initialization. | |
error_t | ipv4SetHostAddr (NetInterface *interface, Ipv4Addr addr) |
Assign host address. | |
error_t | ipv4GetHostAddr (NetInterface *interface, Ipv4Addr *addr) |
Retrieve host address. | |
error_t | ipv4SetSubnetMask (NetInterface *interface, Ipv4Addr mask) |
Configure subnet mask. | |
error_t | ipv4GetSubnetMask (NetInterface *interface, Ipv4Addr *mask) |
Retrieve subnet mask. | |
error_t | ipv4SetDefaultGateway (NetInterface *interface, Ipv4Addr addr) |
Configure default gateway. | |
error_t | ipv4GetDefaultGateway (NetInterface *interface, Ipv4Addr *addr) |
Retrieve default gateway. | |
error_t | ipv4SetDnsServer (NetInterface *interface, uint_t index, Ipv4Addr addr) |
Configure DNS server. | |
error_t | ipv4GetDnsServer (NetInterface *interface, uint_t index, Ipv4Addr *addr) |
Retrieve DNS server. | |
error_t | ipv4GetBroadcastAddr (NetInterface *interface, Ipv4Addr *addr) |
Get IPv4 broadcast address. | |
void | ipv4LinkChangeEvent (NetInterface *interface) |
Callback function for link change event. | |
void | ipv4ProcessPacket (NetInterface *interface, Ipv4Header *packet, size_t length) |
Incoming IPv4 packet processing. | |
void | ipv4ProcessDatagram (NetInterface *interface, const NetBuffer *buffer) |
Incoming IPv4 datagram processing. | |
error_t | ipv4SendDatagram (NetInterface *interface, Ipv4PseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, uint8_t ttl) |
Send an IPv4 datagram. | |
error_t | ipv4SendPacket (NetInterface *interface, Ipv4PseudoHeader *pseudoHeader, uint16_t fragId, size_t fragOffset, NetBuffer *buffer, size_t offset, uint8_t ttl) |
Send an IPv4 packet. | |
error_t | ipv4CheckSourceAddr (NetInterface *interface, Ipv4Addr ipAddr) |
Source IPv4 address filtering. | |
error_t | ipv4CheckDestAddr (NetInterface *interface, Ipv4Addr ipAddr) |
Destination IPv4 address filtering. | |
error_t | ipv4SelectSourceAddr (NetInterface **interface, Ipv4Addr destAddr, Ipv4Addr *srcAddr) |
IPv4 source address selection. | |
bool_t | ipv4IsBroadcastAddr (NetInterface *interface, Ipv4Addr ipAddr) |
Check whether an IPv4 address is a broadcast address. | |
uint_t | ipv4GetAddrScope (Ipv4Addr ipAddr) |
Retrieve the scope of an IPv4 address. | |
error_t | ipv4JoinMulticastGroup (NetInterface *interface, Ipv4Addr groupAddr) |
Join the specified host group. | |
error_t | ipv4LeaveMulticastGroup (NetInterface *interface, Ipv4Addr groupAddr) |
Leave the specified host group. | |
error_t | ipv4MapMulticastAddrToMac (Ipv4Addr ipAddr, MacAddr *macAddr) |
Map an host group address to a MAC-layer multicast address. | |
error_t | ipv4StringToAddr (const char_t *str, Ipv4Addr *ipAddr) |
Convert a dot-decimal string to a binary IPv4 address. | |
char_t * | ipv4AddrToString (Ipv4Addr ipAddr, char_t *str) |
Convert a binary IPv4 address to dot-decimal notation. | |
void | ipv4DumpHeader (const Ipv4Header *ipHeader) |
Dump IPv4 header for debugging purpose. |
Detailed Description
IPv4 (Internet Protocol Version 4)
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.
Description
The Internet Protocol (IP) provides the functions necessary to deliver a datagram from a source to a destination over an interconnected system of networks. Refer to RFC 791 for complete details
- Version:
- 1.7.6
Definition in file ipv4.c.
Function Documentation
char_t* ipv4AddrToString | ( | Ipv4Addr | ipAddr, |
char_t * | str | ||
) |
void ipv4DumpHeader | ( | const Ipv4Header * | ipHeader ) |
uint_t ipv4GetAddrScope | ( | Ipv4Addr | ipAddr ) |
error_t ipv4Init | ( | NetInterface * | interface ) |
bool_t ipv4IsBroadcastAddr | ( | NetInterface * | interface, |
Ipv4Addr | ipAddr | ||
) |
void ipv4LinkChangeEvent | ( | NetInterface * | interface ) |
void ipv4ProcessDatagram | ( | NetInterface * | interface, |
const NetBuffer * | buffer | ||
) |
void ipv4ProcessPacket | ( | NetInterface * | interface, |
Ipv4Header * | packet, | ||
size_t | length | ||
) |
IPv4 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 IPv4 address [out] srcAddr Local IPv4 address to be used
- Returns:
- Error code
error_t ipv4SendDatagram | ( | NetInterface * | interface, |
Ipv4PseudoHeader * | pseudoHeader, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
uint8_t | ttl | ||
) |
Send an IPv4 datagram.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader IPv4 pseudo header [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ttl TTL value. Default Time-To-Live is used when this parameter is zero
- Returns:
- Error code
error_t ipv4SendPacket | ( | NetInterface * | interface, |
Ipv4PseudoHeader * | pseudoHeader, | ||
uint16_t | fragId, | ||
size_t | fragOffset, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
uint8_t | ttl | ||
) |
Send an IPv4 packet.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader IPv4 pseudo header [in] fragId Fragment identification field [in] fragOffset Fragment offset field [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ttl Time-To-Live value
- Returns:
- Error code
Generated on Tue Jul 12 2022 17:10:20 by
