Microchip® Advanced Software Framework

mini_ip.h File Reference

Include definitions for the mini ip.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>

Data Structures

struct  _IPheader
 IP Header structure. More...
 
struct  arp_header
 ARP header structure. More...
 
struct  eth_packet
 Ethernet packet structure. More...
 
struct  ethernet_header
 Ethernet header structure. More...
 
struct  icmp_echo_header
 ICMP echo header structure. More...
 

Macros

#define ARP_REPLY   0x0002
 ARP Reply packet. More...
 
#define ARP_REQUEST   0x0001
 ARP OP codes. More...
 
#define ETH_HEADER_SIZE   (sizeof(ethernet_header_t))
 Ethernet header size. More...
 
#define ETH_IP_HEADER_SIZE   (sizeof(ip_header_t))
 Ethernet IP header size. More...
 
#define ETH_PROT_APPLETALK   0x8019
 32923 (0x8019) Appletalk More...
 
#define ETH_PROT_ARP   0x0806
 2054 (0x0806) ARP More...
 
#define ETH_PROT_IP   0x0800
 Ethernet types. More...
 
#define ETH_PROT_IPV6   0x86DD
 34525 (0x86DD) IPv6 More...
 
#define ICMP_ADD_MASK_REP   0x12
 Address Mask Reply. More...
 
#define ICMP_ADD_MASK_REQ   0x11
 Address Mask Request. More...
 
#define ICMP_ALT_HOST_ADD   0x06
 Alternate Host Address. More...
 
#define ICMP_DAT_CONV_ERROR   0x1F
 Datagram Conversion Error. More...
 
#define ICMP_DEST_UNREACHABLE   0x03
 Destination Unreachable. More...
 
#define ICMP_DOM_NAME_REP   0x26
 Domain Name Reply. More...
 
#define ICMP_DOM_NAME_REQ   0x25
 Domain Name Request. More...
 
#define ICMP_ECHO_REPLY   0x00
 ICMP types. More...
 
#define ICMP_ECHO_REQUEST   0x08
 Echo Request. More...
 
#define ICMP_EXP_MOBIL   0x29
 ICMP for experimental mobility protocols such as Seamoby [RFC4065]. More...
 
#define ICMP_H_I_A   0x22
 Here-I-Am (originally meant for IPv6) More...
 
#define ICMP_INFO_REPLY   0x10
 Information Reply. More...
 
#define ICMP_INFO_REQ   0x0F
 Information Request. More...
 
#define ICMP_MOB_HOST_RED   0x20
 Mobile Host Redirect. More...
 
#define ICMP_MOB_REG_REP   0x24
 Mobile Registration Reply. More...
 
#define ICMP_MOB_REG_REQ   0x23
 Mobile Registration Request. More...
 
#define ICMP_PARAM_PB   0x0C
 Parameter Problem: Bad IP header. More...
 
#define ICMP_PHOTURIS   0x28
 Photuris, Security failures. More...
 
#define ICMP_REDIR_MESSAGE   0x05
 Redirect Message. More...
 
#define ICMP_ROUTER_ADV   0x09
 Router Advertisement. More...
 
#define ICMP_ROUTER_SOL   0x0A
 Router Solicitation. More...
 
#define ICMP_SKIP_ALGO_PROT   0x27
 SKIP Algorithm Discovery Protocol, Simple Key-Management for Internet Protocol. More...
 
#define ICMP_SOURCE_QUENCH   0x04
 Source Quench. More...
 
#define ICMP_TIME_EXC   0x0B
 Time Exceeded. More...
 
#define ICMP_TIMESTAMP   0x0D
 Timestamp. More...
 
#define ICMP_TIMESTAMP_REP   0x0E
 Timestamp Reply. More...
 
#define ICMP_TRACEROUTE   0x1E
 Traceroute. More...
 
#define ICMP_W_A_Y   0x21
 Where-Are-You (originally meant for IPv6) More...
 
#define IP_PROT_ICMP   1
 IP protocols code. More...
 
#define IP_PROT_IP   4
 
#define IP_PROT_TCP   6
 
#define IP_PROT_UDP   17
 
#define SWAP16(x)   (((x & 0xff) << 8) | (x >> 8))
 Swap 2 bytes of a word. More...
 

Typedefs

typedef struct arp_header arp_header_t
 ARP header structure. More...
 
typedef struct eth_packet eth_packet_t
 Ethernet packet structure. More...
 
typedef struct ethernet_header ethernet_header_t
 Ethernet header structure. More...
 
typedef struct icmp_echo_header icmp_echo_header_t
 ICMP echo header structure. More...
 
typedef struct _IPheader ip_header_t
 IP Header structure. More...
 
typedef struct arp_headerp_arp_header_t
 
typedef struct eth_packetp_eth_packet_t
 
typedef struct ethernet_headerp_ethernet_header_t
 
typedef struct icmp_echo_headerp_icmp_echo_header_t
 
typedef struct _IPheaderp_ip_header_t
 

#define ARP_REPLY   0x0002

ARP Reply packet.

Referenced by gmac_process_arp_packet().

#define ARP_REQUEST   0x0001

ARP OP codes.

ARP Request packet

Referenced by gmac_process_arp_packet().

#define ETH_HEADER_SIZE   (sizeof(ethernet_header_t))
#define ETH_IP_HEADER_SIZE   (sizeof(ip_header_t))

Ethernet IP header size.

Referenced by gmac_process_ip_packet().

#define ETH_PROT_APPLETALK   0x8019

32923 (0x8019) Appletalk

#define ETH_PROT_ARP   0x0806

2054 (0x0806) ARP

Referenced by gmac_process_eth_packet().

#define ETH_PROT_IP   0x0800

Ethernet types.

2048 (0x0800) IPv4

Referenced by gmac_process_eth_packet().

#define ETH_PROT_IPV6   0x86DD

34525 (0x86DD) IPv6

#define ICMP_ADD_MASK_REP   0x12

Address Mask Reply.

#define ICMP_ADD_MASK_REQ   0x11

Address Mask Request.

#define ICMP_ALT_HOST_ADD   0x06

Alternate Host Address.

#define ICMP_DAT_CONV_ERROR   0x1F

Datagram Conversion Error.

#define ICMP_DEST_UNREACHABLE   0x03

Destination Unreachable.

#define ICMP_DOM_NAME_REP   0x26

Domain Name Reply.

#define ICMP_DOM_NAME_REQ   0x25

Domain Name Request.

#define ICMP_ECHO_REPLY   0x00

ICMP types.

Echo reply (used to ping)

Referenced by gmac_process_ip_packet().

#define ICMP_ECHO_REQUEST   0x08

Echo Request.

Referenced by gmac_process_ip_packet().

#define ICMP_EXP_MOBIL   0x29

ICMP for experimental mobility protocols such as Seamoby [RFC4065].

#define ICMP_H_I_A   0x22

Here-I-Am (originally meant for IPv6)

#define ICMP_INFO_REPLY   0x10

Information Reply.

#define ICMP_INFO_REQ   0x0F

Information Request.

#define ICMP_MOB_HOST_RED   0x20

Mobile Host Redirect.

#define ICMP_MOB_REG_REP   0x24

Mobile Registration Reply.

#define ICMP_MOB_REG_REQ   0x23

Mobile Registration Request.

#define ICMP_PARAM_PB   0x0C

Parameter Problem: Bad IP header.

#define ICMP_PHOTURIS   0x28

Photuris, Security failures.

#define ICMP_REDIR_MESSAGE   0x05

Redirect Message.

#define ICMP_ROUTER_ADV   0x09

Router Advertisement.

#define ICMP_ROUTER_SOL   0x0A

Router Solicitation.

#define ICMP_SKIP_ALGO_PROT   0x27

SKIP Algorithm Discovery Protocol, Simple Key-Management for Internet Protocol.

#define ICMP_SOURCE_QUENCH   0x04

Source Quench.

#define ICMP_TIME_EXC   0x0B

Time Exceeded.

#define ICMP_TIMESTAMP   0x0D

Timestamp.

#define ICMP_TIMESTAMP_REP   0x0E

Timestamp Reply.

#define ICMP_TRACEROUTE   0x1E

Traceroute.

#define ICMP_W_A_Y   0x21

Where-Are-You (originally meant for IPv6)

#define IP_PROT_ICMP   1

IP protocols code.

Referenced by gmac_display_ip_packet(), and gmac_process_ip_packet().

#define IP_PROT_IP   4

Referenced by gmac_display_ip_packet().

#define IP_PROT_TCP   6

Referenced by gmac_display_ip_packet().

#define IP_PROT_UDP   17

Referenced by gmac_display_ip_packet().

#define SWAP16 (   x)    (((x & 0xff) << 8) | (x >> 8))

typedef struct arp_header arp_header_t

ARP header structure.

typedef struct eth_packet eth_packet_t

Ethernet packet structure.

Ethernet header structure.

ICMP echo header structure.

typedef struct _IPheader ip_header_t

IP Header structure.

typedef struct arp_header * p_arp_header_t
typedef struct eth_packet * p_eth_packet_t
typedef struct _IPheader * p_ip_header_t