mikroSDK Reference Manual
ipv4_misc.h
Go to the documentation of this file.
1
31#ifndef _IPV4_MISC_H
32#define _IPV4_MISC_H
33
34//Dependencies
35#include "core/net.h"
36#include "ipv4/ipv4.h"
37
38//C++ guard
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43//IPv4 related functions
44error_t ipv4AddRouterAlertOption(NetBuffer *buffer, size_t *offset);
45
46error_t ipv4CheckSourceAddr(NetInterface *interface, Ipv4Addr ipAddr);
47error_t ipv4CheckDestAddr(NetInterface *interface, Ipv4Addr ipAddr);
48
49error_t ipv4SelectSourceAddr(NetInterface **interface,
50 Ipv4Addr destAddr, Ipv4Addr *srcAddr);
51
52error_t ipv4SelectDefaultGateway(NetInterface *interface, Ipv4Addr srcAddr,
53 Ipv4Addr *defaultGatewayAddr);
54
55bool_t ipv4IsOnLink(NetInterface *interface, Ipv4Addr ipAddr);
56bool_t ipv4IsBroadcastAddr(NetInterface *interface, Ipv4Addr ipAddr);
57bool_t ipv4IsTentativeAddr(NetInterface *interface, Ipv4Addr ipAddr);
58bool_t ipv4IsLocalHostAddr(Ipv4Addr ipAddr);
59
60bool_t ipv4CompPrefix(Ipv4Addr ipAddr1, Ipv4Addr ipAddr2, size_t length);
61
62uint_t ipv4GetAddrScope(Ipv4Addr ipAddr);
63uint_t ipv4GetPrefixLength(Ipv4Addr mask);
64
65error_t ipv4GetBroadcastAddr(NetInterface *interface, Ipv4Addr *addr);
66error_t ipv4MapMulticastAddrToMac(Ipv4Addr ipAddr, MacAddr *macAddr);
67
68bool_t ipv4TrapIgmpPacket(Ipv4Header *header);
69
70void ipv4UpdateInStats(NetInterface *interface, Ipv4Addr destIpAddr,
71 size_t length);
72
73void ipv4UpdateOutStats(NetInterface *interface, Ipv4Addr destIpAddr,
74 size_t length);
75
76void ipv4UpdateErrorStats(NetInterface *interface, error_t error);
77
78//C++ guard
79#ifdef __cplusplus
80}
81#endif
82
83#endif
error_t
Error codes.
Definition error.h:43
IPv4 (Internet Protocol Version 4)
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
TCP/IP stack core.
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89