Changeset c5bff3c in mainline for uspace/srv/net/inet/inet_std.h
- Timestamp:
- 2012-04-28T16:22:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8013637
- Parents:
- 81716eb (diff), 76983ff (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/inet_std.h
r81716eb rc5bff3c 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 libc29 /** @addtogroup inet 30 30 * @{ 31 31 */ 32 33 /** @file 34 * ARP module messages. 35 * @see arp_interface.h 32 /** 33 * @file IP header definitions 34 * 36 35 */ 37 36 38 #ifndef LIBC_ARP_MESSAGES_39 #define LIBC_ARP_MESSAGES_37 #ifndef INET_STD_H_ 38 #define INET_STD_H_ 40 39 41 #include < ipc/net.h>40 #include <sys/types.h> 42 41 43 /** ARP module messages.*/44 typedef enum{45 /** Clean cache message.46 * @see arp_clean_cache()47 */48 NET_ARP_CLEAN_CACHE = NET_ARP_FIRST,49 /** Clear address cache message.50 * @see arp_clear_address_msg()51 */52 NET_ARP_CLEAR_ADDRESS,53 /** Clear device cache message.54 * @see arp_clear_device_req()55 */56 NET_ARP_CLEAR_DEVICE,57 /** New device message.58 * @see arp_device_req()59 */60 NET_ARP_DEVICE,61 /** Address translation message.62 * @see arp_translate_req()63 */64 NET_ARP_TRANSLATE65 } arp_messages;42 /** Internet Datagram header (fixed part) */ 43 typedef struct { 44 /** Version, Internet Header Length */ 45 uint8_t ver_ihl; 46 /* Type of Service */ 47 uint8_t tos; 48 /** Total Length */ 49 uint16_t tot_len; 50 /** Identification */ 51 uint16_t id; 52 /** Flags, Fragment Offset */ 53 uint16_t flags_foff; 54 /** Time to Live */ 55 uint8_t ttl; 56 /** Protocol */ 57 uint8_t proto; 58 /** Header Checksum */ 59 uint16_t chksum; 60 /** Source Address */ 61 uint32_t src_addr; 62 /** Destination Address */ 63 uint32_t dest_addr; 64 } ip_header_t; 66 65 67 /** @name ARP specific message parameters definitions */ 68 /*@{*/ 66 /** Bits in ip_header_t.ver_ihl */ 67 enum ver_ihl_bits { 68 /** Version, highest bit */ 69 VI_VERSION_h = 7, 70 /** Version, lowest bit */ 71 VI_VERSION_l = 4, 72 /** Internet Header Length, highest bit */ 73 VI_IHL_h = 3, 74 /** Internet Header Length, lowest bit */ 75 VI_IHL_l = 0 76 }; 69 77 70 /** Return the protocol service message parameter. 71 * 72 * @param[in] call Message call structure. 73 * 74 */ 75 #define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call)) 78 /** Bits in ip_header_t.flags_foff */ 79 enum flags_foff_bits { 80 /** Reserved, must be zero */ 81 FF_FLAG_RSVD = 15, 82 /** Don't Fragment */ 83 FF_FLAG_DF = 14, 84 /** More Fragments */ 85 FF_FLAG_MF = 13, 86 /** Fragment Offset, highest bit */ 87 FF_FRAGOFF_h = 12, 88 /** Fragment Offset, lowest bit */ 89 FF_FRAGOFF_l = 0 90 }; 76 91 77 /*@}*/ 92 /** Fragment offset is expressed in units of 8 bytes */ 93 #define FRAG_OFFS_UNIT 8 78 94 79 95 #endif
Note:
See TracChangeset
for help on using the changeset viewer.