Changeset a7a7f8c in mainline for uspace/srv/net/inet/icmp_std.h
- Timestamp:
- 2012-04-20T07:32:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 097f421
- Parents:
- 90f067d9 (diff), 606c369 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inet/icmp_std.h
r90f067d9 ra7a7f8c 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup udp29 /** @addtogroup inet 30 30 * @{ 31 31 */ 32 33 /** @file 34 * UDP header definition. 35 * Based on the RFC 768. 32 /** 33 * @file ICMP standard definitions 34 * 36 35 */ 37 36 38 #ifndef NET_UDP_HEADER_H_39 #define NET_UDP_HEADER_H_37 #ifndef ICMP_STD_H_ 38 #define ICMP_STD_H_ 40 39 41 40 #include <sys/types.h> 42 41 43 /** UDP header size in bytes. */ 44 #define UDP_HEADER_SIZE sizeof(udp_header_t) 42 #define IP_PROTO_ICMP 1 45 43 46 /** Type definition of the user datagram header. 47 * @see udp_header 48 */ 49 typedef struct udp_header udp_header_t; 44 /** Type of service used for ICMP */ 45 #define ICMP_TOS 0 50 46 51 /** User datagram header. */ 52 struct udp_header { 53 uint16_t source_port; 54 uint16_t destination_port; 55 uint16_t total_length; 47 /** ICMP message type */ 48 enum icmp_type { 49 ICMP_ECHO_REPLY = 0, 50 ICMP_ECHO_REQUEST = 8 51 }; 52 53 /** ICMP Echo Request or Reply message header */ 54 typedef struct { 55 /** ICMP message type */ 56 uint8_t type; 57 /** Code (0) */ 58 uint8_t code; 59 /** Internet checksum of the ICMP message */ 56 60 uint16_t checksum; 57 } __attribute__ ((packed)); 61 /** Indentifier */ 62 uint16_t ident; 63 /** Sequence number */ 64 uint16_t seq_no; 65 } icmp_echo_t; 58 66 59 67 #endif
Note:
See TracChangeset
for help on using the changeset viewer.