Retro Rocket Kernel BASIC-Powered Operating System

Data Structures | Enumerations | Functions | Variables
icmp.h File Reference
`#include "kernel.h"`

## Data Structures
struct | icmp_packet
struct | icmp_redirect_packet
struct | icmp_information
struct | icmp_parameter_problem_packet
struct | icmp_echo_packet
struct | icmp_timestamp_packet

## Enumerations
enum | icmp_type_t { ICMP_ECHO_REPLY = 0 , ICMP_DESTINATION_UNREACHABLE = 3 , ICMP_SOURCE_QUENCH = 4 , ICMP_REDIRECT = 5 , ICMP_ECHO = 8 , ICMP_TIME_EXCEEDED = 11 , ICMP_PARAMETER_PROBLEM = 12 , ICMP_TIMESTAMP = 13 , ICMP_TIMESTAMP_REPLY = 14 , ICMP_INFORMATION_REQUEST = 15 , ICMP_INFORMATION_REPLY = 16 }
enum | icmp_unreachable_code_t { ICMP_NET_UNREACHABLE = 0 , ICMP_HOST_UNREACHABLE = 1 , ICMP_PROTOCOL_UNREACHABLE = 2 , ICMP_PORT_UNREACHABLE = 3 , ICMP_FRAGMENTATION_NEEDED = 4 , ICMP_SOURCE_ROUTE_FAILED = 5 }
enum | icmp_time_exceeded_code_t { ICMP_TTL_EXCEEDED = 0 , ICMP_FRAGMENT_REASSEMBLY_TIME_EXCEEDED = 1 }
enum | icmp_redirect_code_t { ICMP_REDIRECT_NETWORK = 0 , ICMP_REDIRECT_HOST = 1 , ICMP_REDIRECT_TOS_NETWORK = 2 , ICMP_REDIRECT_TOS_HOST = 3 }

## Functions
struct icmp_packet | __attribute__ ((packed)) icmp_packet_t
void | icmp_handle_packet ([[maybe_unused]] ip_packet_t *encap_packet, icmp_packet_t *packet, size_t len)
| Handle ICMP packet from the IP driver. More...
void | icmp_send_echo (uint32_t destination, uint16_t id, uint16_t seq)

## Variables
uint8_t | type
uint8_t | code
uint16_t | checksum
uint32_t | unused
ip_packet_t | original_datagram
uint32_t | gateway
uint16_t | id
uint16_t | seq
uint8_t | problem_ptr
uint16_t | unused1
uint16_t | unused2
uint32_t | originate_timestamp
uint32_t | receive_timestamp
uint32_t | transmit_timestamp

## Detailed Description

Author
  Craig Edwards (craig.nosp@m.edwa.nosp@m.rds@b.nosp@m.rain.nosp@m.box.c.nosp@m.c)

Copyright
  Copyright (c) 2012-2023

## Enumeration Type Documentation

## ◆ icmp_redirect_code_t

enum icmp_redirect_code_t

Enumerator
ICMP_REDIRECT_NETWORK |
ICMP_REDIRECT_HOST |
ICMP_REDIRECT_TOS_NETWORK |
ICMP_REDIRECT_TOS_HOST |

## ◆ icmp_time_exceeded_code_t

enum icmp_time_exceeded_code_t

Enumerator
ICMP_TTL_EXCEEDED |
ICMP_FRAGMENT_REASSEMBLY_TIME_EXCEEDED |

## ◆ icmp_type_t

enum icmp_type_t

Enumerator
ICMP_ECHO_REPLY |
ICMP_DESTINATION_UNREACHABLE |
ICMP_SOURCE_QUENCH |
ICMP_REDIRECT |
ICMP_ECHO |
ICMP_TIME_EXCEEDED |
ICMP_PARAMETER_PROBLEM |
ICMP_TIMESTAMP |
ICMP_TIMESTAMP_REPLY |
ICMP_INFORMATION_REQUEST |
ICMP_INFORMATION_REPLY |

## ◆ icmp_unreachable_code_t

enum icmp_unreachable_code_t

Enumerator
ICMP_NET_UNREACHABLE |
ICMP_HOST_UNREACHABLE |
ICMP_PROTOCOL_UNREACHABLE |
ICMP_PORT_UNREACHABLE |
ICMP_FRAGMENTATION_NEEDED |
ICMP_SOURCE_ROUTE_FAILED |

## Function Documentation

## ◆ __attribute__()

struct icmp_packet __attribute__ | ( | (packed) |  | ) |

## ◆ icmp_handle_packet()

void icmp_handle_packet | ( | [[maybe_unused] ] ip_packet_t * | encap_packet,
|  | icmp_packet_t * | packet,
|  | size_t | len
| ) |  |

Handle ICMP packet from the IP driver.

Parameters

  ip | Encapsulating IP packet
  packet | raw ICMP packet
  length | ICMP packet length

## ◆ icmp_send_echo()

void icmp_send_echo | ( | uint32_t | destination,
|  | uint16_t | id,
|  | uint16_t | seq
| ) |  |

## Variable Documentation

## ◆ checksum

uint16_t checksum

## ◆ code

uint8_t code

## ◆ gateway

uint32_t gateway

## ◆ id

uint16_t id

## ◆ original_datagram

ip_packet_t original_datagram

## ◆ originate_timestamp

uint32_t originate_timestamp

## ◆ problem_ptr

uint8_t problem_ptr

## ◆ receive_timestamp

uint32_t receive_timestamp

## ◆ seq

uint16_t seq

## ◆ transmit_timestamp

uint32_t transmit_timestamp

## ◆ type

uint8_t type

## ◆ unused

uint32_t unused

## ◆ unused1

uint16_t unused1

## ◆ unused2

uint16_t unused2