Changeset c69d327 in mainline
- Timestamp:
- 2010-10-08T21:32:49Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 368fb2c
- Parents:
- 0a866eeb
- Location:
- uspace
- Files:
-
- 2 added
- 2 deleted
- 42 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/Makefile
r0a866eeb rc69d327 101 101 generic/net/inet.c \ 102 102 generic/net/modules.c \ 103 generic/net/packet.c \ 103 104 generic/net/socket_client.c \ 104 105 generic/net/socket_parse.c \ -
uspace/lib/c/include/net/packet_header.h
r0a866eeb rc69d327 27 27 */ 28 28 29 /** @addtogroup packet29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 34 * Packet header. 35 35 */ 36 36 37 #ifndef __NET_PACKET_HEADER_H__38 #define __NET_PACKET_HEADER_H__37 #ifndef LIBC_PACKET_HEADER_H_ 38 #define LIBC_PACKET_HEADER_H_ 39 39 40 #include < packet/packet.h>40 #include <net/packet.h> 41 41 42 42 /** Returns the actual packet data length. 43 * @param[in] headerThe packet header.43 * @param[in] header The packet header. 44 44 */ 45 #define PACKET_DATA_LENGTH(header) ((header)->data_end - (header)->data_start) 45 #define PACKET_DATA_LENGTH(header) \ 46 ((header)->data_end - (header)->data_start) 46 47 47 48 /** Returns the maximum packet address length. 48 * @param[in] headerThe packet header.49 * @param[in] header The packet header. 49 50 */ 50 #define PACKET_MAX_ADDRESS_LENGTH(header) ((header)->dest_addr - (header)->src_addr) 51 #define PACKET_MAX_ADDRESS_LENGTH(header) \ 52 ((header)->dest_addr - (header)->src_addr) 51 53 52 54 /** Returns the minimum packet suffix. 53 * @param[in] header 55 * @param[in] header The packet header. 54 56 */ 55 #define PACKET_MIN_SUFFIX(header) ((header)->length - (header)->data_start - (header)->max_content) 57 #define PACKET_MIN_SUFFIX(header) \ 58 ((header)->length - (header)->data_start - (header)->max_content) 56 59 57 /** Packet integrity check magic value. 58 */ 60 /** Packet integrity check magic value. */ 59 61 #define PACKET_MAGIC_VALUE 0x11227788 60 62 61 /** Packet header. 62 */ 63 struct packet{ 64 /** Packet identifier. 65 */ 63 /** Packet header. */ 64 struct packet { 65 /** Packet identifier. */ 66 66 packet_id_t packet_id; 67 /** Packet queue sorting value. 68 * The packet queue is sorted the ascending order. 67 68 /** 69 * Packet queue sorting value. 70 * The packet queue is sorted the ascending order. 69 71 */ 70 72 size_t order; 71 /** Packet metric. 72 */73 74 /** Packet metric. */ 73 75 size_t metric; 74 /** Previous packet in the queue. 75 */ 76 /** Previous packet in the queue. */ 76 77 packet_id_t previous; 77 /** Next packet in the queue. 78 */ 78 /** Next packet in the queue. */ 79 79 packet_id_t next; 80 /** Total length of the packet. 81 * Contains the header, the addresses and the data of the packet. 82 * Corresponds to the mapped sharable memory block. 80 81 /** 82 * Total length of the packet. 83 * Contains the header, the addresses and the data of the packet. 84 * Corresponds to the mapped sharable memory block. 83 85 */ 84 86 size_t length; 85 /** Stored source and destination addresses length. 86 */87 88 /** Stored source and destination addresses length. */ 87 89 size_t addr_len; 88 /** Souce address offset in bytes from the beginning of the packet header. 90 91 /** 92 * Souce address offset in bytes from the beginning of the packet 93 * header. 89 94 */ 90 95 size_t src_addr; 91 /** Destination address offset in bytes from the beginning of the packet header. 96 97 /** 98 * Destination address offset in bytes from the beginning of the packet 99 * header. 92 100 */ 93 101 size_t dest_addr; 94 /** Reserved data prefix length in bytes. 95 */102 103 /** Reserved data prefix length in bytes. */ 96 104 size_t max_prefix; 97 /** Reserved content length in bytes. 98 */ 105 /** Reserved content length in bytes. */ 99 106 size_t max_content; 100 /** Actual data start offset in bytes from the beginning of the packet header. 107 108 /** 109 * Actual data start offset in bytes from the beginning of the packet 110 * header. 101 111 */ 102 112 size_t data_start; 103 /** Actual data end offset in bytes from the beginning of the packet header. 113 114 /** 115 * Actual data end offset in bytes from the beginning of the packet 116 * header. 104 117 */ 105 118 size_t data_end; 106 /** Integrity check magic value. 107 */119 120 /** Integrity check magic value. */ 108 121 int magic_value; 109 122 }; 110 123 111 124 /** Returns whether the packet is valid. 112 * @param[in] packet The packet to be checked. 113 * @returns true if the packet is not NULL and the magic value is correct. 114 * @returns false otherwise. 125 * @param[in] packet The packet to be checked. 126 * @returns True if the packet is not NULL and the magic value is 127 * correct. 128 * @returns False otherwise. 115 129 */ 116 static inline int packet_is_valid(const packet_t packet){ 130 static inline int packet_is_valid(const packet_t packet) 131 { 117 132 return packet && (packet->magic_value == PACKET_MAGIC_VALUE); 118 133 } -
uspace/lib/net/generic/packet_client.c
r0a866eeb rc69d327 44 44 45 45 #include <net_messages.h> 46 #include < packet/packet.h>47 #include < packet/packet_header.h>46 #include <net/packet.h> 47 #include <net/packet_header.h> 48 48 49 49 int packet_copy_data(packet_t packet, const void * data, size_t length) -
uspace/lib/net/generic/packet_remote.c
r0a866eeb rc69d327 47 47 #include <packet_remote.h> 48 48 49 #include < packet/packet.h>50 #include < packet/packet_header.h>49 #include <net/packet.h> 50 #include <net/packet_header.h> 51 51 52 52 /** Obtain the packet from the packet server as the shared memory block. -
uspace/lib/net/generic/socket_core.c
r0a866eeb rc69d327 46 46 #include <adt/dynamic_fifo.h> 47 47 #include <adt/int_map.h> 48 #include < packet/packet.h>48 #include <net/packet.h> 49 49 #include <packet_client.h> 50 50 #include <packet_remote.h> -
uspace/lib/net/il/ip_client.c
r0a866eeb rc69d327 43 43 #include <ip_header.h> 44 44 45 #include < packet/packet.h>45 #include <net/packet.h> 46 46 47 47 size_t ip_client_header_length(packet_t packet){ -
uspace/lib/net/include/icmp_client.h
r0a866eeb rc69d327 39 39 40 40 #include <icmp_codes.h> 41 #include < packet/packet.h>41 #include <net/packet.h> 42 42 43 43 /** Processes the received packet prefixed with an ICMP header. -
uspace/lib/net/include/icmp_interface.h
r0a866eeb rc69d327 39 39 #include <net_device.h> 40 40 #include <adt/measured_strings.h> 41 #include < packet/packet.h>41 #include <net/packet.h> 42 42 #include <net/inet.h> 43 43 #include <ip_codes.h> -
uspace/lib/net/include/il_interface.h
r0a866eeb rc69d327 45 45 #include <net_messages.h> 46 46 #include <net_device.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <packet_client.h> 49 49 #include <il_messages.h> -
uspace/lib/net/include/ip_client.h
r0a866eeb rc69d327 41 41 #include <sys/types.h> 42 42 43 #include < packet/packet.h>43 #include <net/packet.h> 44 44 #include <ip_codes.h> 45 45 #include <ip_interface.h> -
uspace/lib/net/include/ip_interface.h
r0a866eeb rc69d327 39 39 40 40 #include <net_device.h> 41 #include < packet/packet.h>41 #include <net/packet.h> 42 42 43 43 #include <net/in.h> -
uspace/lib/net/include/netif_local.h
r0a866eeb rc69d327 48 48 #include <adt/measured_strings.h> 49 49 #include <net_device.h> 50 #include < packet/packet.h>50 #include <net/packet.h> 51 51 52 52 /** Network interface device specific data. -
uspace/lib/net/include/nil_interface.h
r0a866eeb rc69d327 41 41 #include <net_messages.h> 42 42 #include <adt/measured_strings.h> 43 #include < packet/packet.h>43 #include <net/packet.h> 44 44 #include <nil_messages.h> 45 45 #include <net_device.h> -
uspace/lib/net/include/packet_client.h
r0a866eeb rc69d327 45 45 #define __NET_PACKET_CLIENT_H__ 46 46 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 49 49 /** @name Packet client interface -
uspace/lib/net/include/packet_remote.h
r0a866eeb rc69d327 34 34 #define __NET_PACKET_REMOTE_H__ 35 35 36 #include < packet/packet.h>36 #include <net/packet.h> 37 37 38 38 extern int packet_translate_remote(int, packet_ref, packet_id_t); -
uspace/lib/net/include/tl_common.h
r0a866eeb rc69d327 39 39 40 40 #include <net/socket_codes.h> 41 42 #include <packet/packet.h> 41 #include <net/packet.h> 43 42 #include <net_device.h> 44 43 #include <net/inet.h> -
uspace/lib/net/include/tl_interface.h
r0a866eeb rc69d327 43 43 #include <net_messages.h> 44 44 #include <net_device.h> 45 #include < packet/packet.h>45 #include <net/packet.h> 46 46 #include <packet_client.h> 47 47 #include <tl_messages.h> -
uspace/lib/net/netif/netif_local.c
r0a866eeb rc69d327 46 46 #include <net_messages.h> 47 47 #include <net/modules.h> 48 #include < packet/packet.h>48 #include <net/packet.h> 49 49 #include <packet_client.h> 50 50 #include <packet/packet_server.h> -
uspace/lib/net/netif/netif_nil_bundle.c
r0a866eeb rc69d327 40 40 #include <ipc/net.h> 41 41 42 #include < packet/packet.h>42 #include <net/packet.h> 43 43 #include <netif_nil_bundle.h> 44 44 #include <netif_local.h> -
uspace/lib/net/netif/netif_remote.c
r0a866eeb rc69d327 39 39 #include <net/modules.h> 40 40 #include <adt/measured_strings.h> 41 #include < packet/packet.h>41 #include <net/packet.h> 42 42 #include <packet_client.h> 43 43 #include <net_device.h> -
uspace/lib/net/nil/nil_remote.c
r0a866eeb rc69d327 39 39 #include <net_device.h> 40 40 #include <nil_interface.h> 41 #include < packet/packet.h>41 #include <net/packet.h> 42 42 #include <packet_client.h> 43 43 #include <nil_messages.h> -
uspace/lib/net/tl/icmp_client.c
r0a866eeb rc69d327 45 45 #include <icmp_codes.h> 46 46 #include <icmp_client.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <packet_client.h> 49 49 #include <icmp_header.h> -
uspace/lib/net/tl/tl_common.c
r0a866eeb rc69d327 45 45 #include <err.h> 46 46 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <packet_client.h> 49 49 #include <packet_remote.h> -
uspace/lib/socket/Makefile
r0a866eeb rc69d327 35 35 generic/icmp_common.c \ 36 36 generic/icmp_api.c \ 37 packet/packet.c \ 38 packet/packet_server.c 37 packet/packet_server.c 39 38 40 39 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/socket/include/icmp_api.h
r0a866eeb rc69d327 44 44 #include <net_device.h> 45 45 #include <adt/measured_strings.h> 46 #include < packet/packet.h>46 #include <net/packet.h> 47 47 #include <ip_codes.h> 48 48 #include <icmp_codes.h> -
uspace/lib/socket/include/net_messages.h
r0a866eeb rc69d327 44 44 #include <net_device.h> 45 45 #include <adt/measured_strings.h> 46 #include < packet/packet.h>46 #include <net/packet.h> 47 47 48 48 /** @name Networking specific message arguments definitions -
uspace/lib/socket/include/packet/packet_local.h
r0a866eeb rc69d327 37 37 #define __NET_PACKET_LOCAL_H__ 38 38 39 #include < packet/packet.h>39 #include <net/packet.h> 40 40 41 41 /** @name Packet local interface -
uspace/lib/socket/include/socket_core.h
r0a866eeb rc69d327 45 45 #include <adt/dynamic_fifo.h> 46 46 #include <adt/int_map.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 49 49 /** Initial size of the received packet queue. -
uspace/lib/socket/packet/packet_server.c
r0a866eeb rc69d327 46 46 #include <ipc/ipc.h> 47 47 #include <ipc/packet.h> 48 #include <net/packet.h> 49 #include <net/packet_header.h> 50 #include <packet/packet_server.h> 48 51 49 52 #include <net_messages.h> 50 #include <packet/packet.h>51 53 #include <packet/packet_local.h> 52 #include <packet/packet_header.h>53 #include <packet/packet_server.h>54 54 55 55 #define FREE_QUEUES_COUNT 7 -
uspace/srv/hw/netif/dp8390/dp8390.c
r0a866eeb rc69d327 38 38 39 39 #include <netif_local.h> 40 #include < packet/packet.h>40 #include <net/packet.h> 41 41 #include <packet_client.h> 42 42 -
uspace/srv/hw/netif/dp8390/dp8390.h
r0a866eeb rc69d327 36 36 #define __NET_NETIF_DP8390_H__ 37 37 38 #include < packet/packet.h>38 #include <net/packet.h> 39 39 40 40 #include "dp8390_port.h" -
uspace/srv/net/il/arp/arp.c
r0a866eeb rc69d327 55 55 #include <protocol_map.h> 56 56 #include <adt/measured_strings.h> 57 #include < packet/packet.h>57 #include <net/packet.h> 58 58 #include <packet_client.h> 59 59 #include <packet_remote.h> -
uspace/srv/net/il/arp/arp_module.c
r0a866eeb rc69d327 47 47 #include <net/modules.h> 48 48 #include <net_interface.h> 49 #include < packet/packet.h>49 #include <net/packet.h> 50 50 #include <il_local.h> 51 51 -
uspace/srv/net/il/ip/ip_module.c
r0a866eeb rc69d327 46 46 #include <net/modules.h> 47 47 #include <net_interface.h> 48 #include < packet/packet.h>48 #include <net/packet.h> 49 49 #include <il_local.h> 50 50 -
uspace/srv/net/net/net.c
r0a866eeb rc69d327 54 54 #include <adt/measured_strings.h> 55 55 #include <adt/module_map.h> 56 #include < packet/packet.h>56 #include <net/packet.h> 57 57 #include <il_messages.h> 58 58 #include <netif_remote.h> -
uspace/srv/net/net/net.h
r0a866eeb rc69d327 46 46 #include <adt/measured_strings.h> 47 47 #include <adt/module_map.h> 48 #include < packet/packet.h>48 #include <net/packet.h> 49 49 50 50 /** @name Modules definitions -
uspace/srv/net/nil/eth/eth_module.c
r0a866eeb rc69d327 45 45 #include <net/modules.h> 46 46 #include <net_interface.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <nil_local.h> 49 49 -
uspace/srv/net/nil/nildummy/nildummy.c
r0a866eeb rc69d327 52 52 #include <il_interface.h> 53 53 #include <adt/measured_strings.h> 54 #include < packet/packet.h>54 #include <net/packet.h> 55 55 #include <packet_remote.h> 56 56 #include <nil_local.h> -
uspace/srv/net/nil/nildummy/nildummy_module.c
r0a866eeb rc69d327 45 45 #include <net/modules.h> 46 46 #include <net_interface.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <nil_local.h> 49 49 -
uspace/srv/net/tl/icmp/icmp_module.c
r0a866eeb rc69d327 45 45 46 46 #include <net/modules.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <net_interface.h> 49 49 #include <tl_local.h> -
uspace/srv/net/tl/tcp/tcp.h
r0a866eeb rc69d327 40 40 #include <fibril_synch.h> 41 41 42 #include < packet/packet.h>42 #include <net/packet.h> 43 43 #include <net_device.h> 44 44 #include <socket_core.h> -
uspace/srv/net/tl/tcp/tcp_module.c
r0a866eeb rc69d327 47 47 #include <net/modules.h> 48 48 49 #include < packet/packet.h>49 #include <net/packet.h> 50 50 #include <net_interface.h> 51 51 #include <ip_interface.h> -
uspace/srv/net/tl/udp/udp_module.c
r0a866eeb rc69d327 45 45 46 46 #include <net/modules.h> 47 #include < packet/packet.h>47 #include <net/packet.h> 48 48 #include <net_interface.h> 49 49 #include <tl_local.h>
Note:
See TracChangeset
for help on using the changeset viewer.