Changeset aadf01e in mainline for uspace/srv/net/include
- Timestamp:
- 2010-03-07T15:13:28Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 936835e
- Parents:
- aa85487
- Location:
- uspace/srv/net/include
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/include/arp_interface.h
raa85487 raadf01e 67 67 * @returns Other error codes as defined for the nil_get_broadcast_addr() function. 68 68 */ 69 int arp_device_req( int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address);69 int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address); 70 70 71 71 /** Translates the given protocol address to the network interface address. … … 83 83 * @returns ENOENT if the mapping is not found. 84 84 */ 85 int arp_translate_req( int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data);85 int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data); 86 86 87 87 /** Clears the device cache. … … 91 91 * @returns ENOENT if the device is not found. 92 92 */ 93 int arp_clear_device_req( int arp_phone, device_id_t device_id);93 int arp_clear_device_req(int arp_phone, device_id_t device_id); 94 94 95 95 /** Clears the given protocol address from the cache. … … 101 101 * @returns ENOENT if the mapping is not found. 102 102 */ 103 int arp_clear_address_req( int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address);103 int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address); 104 104 105 105 /** Cleans the cache. … … 107 107 * @returns EOK on success. 108 108 */ 109 int arp_clean_cache_req( int arp_phone);109 int arp_clean_cache_req(int arp_phone); 110 110 111 111 /** Connects to the ARP module. … … 114 114 * @returns 0 if called by the bundle module. 115 115 */ 116 int arp_connect_module( services_t service);116 int arp_connect_module(services_t service); 117 117 118 118 /** Returns the ARP task identifier. … … 120 120 * @returns 0 if called by the remote module. 121 121 */ 122 task_id_t arp_task_get_id( void);122 task_id_t arp_task_get_id(void); 123 123 124 124 /*@}*/ -
uspace/srv/net/include/byteorder.h
raa85487 raadf01e 42 42 43 43 44 /** Converts the given short number ( 16 bit ) from the host byte order to the network byte order ( big endian).44 /** Converts the given short number (16 bit) from the host byte order to the network byte order (big endian). 45 45 * @param[in] number The number in the host byte order to be converted. 46 46 * @returns The number in the network byte order. 47 47 */ 48 #define htons( number ) host2uint16_t_be( number)48 #define htons(number) host2uint16_t_be(number) 49 49 50 /** Converts the given long number ( 32 bit ) from the host byte order to the network byte order ( big endian).50 /** Converts the given long number (32 bit) from the host byte order to the network byte order (big endian). 51 51 * @param[in] number The number in the host byte order to be converted. 52 52 * @returns The number in the network byte order. 53 53 */ 54 #define htonl( number ) host2uint32_t_be( number)54 #define htonl(number) host2uint32_t_be(number) 55 55 56 /** Converts the given short number ( 16 bit ) from the network byte order ( big endian) to the host byte order.56 /** Converts the given short number (16 bit) from the network byte order (big endian) to the host byte order. 57 57 * @param[in] number The number in the network byte order to be converted. 58 58 * @returns The number in the host byte order. 59 59 */ 60 #define ntohs( number ) uint16_t_be2host( number)60 #define ntohs(number) uint16_t_be2host(number) 61 61 62 /** Converts the given long number ( 32 bit ) from the network byte order ( big endian) to the host byte order.62 /** Converts the given long number (32 bit) from the network byte order (big endian) to the host byte order. 63 63 * @param[in] number The number in the network byte order to be converted. 64 64 * @returns The number in the host byte order. 65 65 */ 66 #define ntohl( number ) uint32_t_be2host( number)66 #define ntohl(number) uint32_t_be2host(number) 67 67 68 68 #endif -
uspace/srv/net/include/checksum.h
raa85487 raadf01e 54 54 */ 55 55 #ifdef ARCH_IS_BIG_ENDIAN 56 #define compute_crc32( seed, data, length ) compute_crc32_be( seed, ( uint8_t * ) data, length)56 #define compute_crc32(seed, data, length) compute_crc32_be(seed, (uint8_t *) data, length) 57 57 #else 58 #define compute_crc32( seed, data, length ) compute_crc32_le( seed, ( uint8_t * ) data, length)58 #define compute_crc32(seed, data, length) compute_crc32_le(seed, (uint8_t *) data, length) 59 59 #endif 60 60 … … 65 65 * @returns The computed CRC32 of the length bits of the data. 66 66 */ 67 uint32_t compute_crc32_le( uint32_t seed, uint8_t * data, size_t length);67 uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length); 68 68 69 69 /** Computes CRC32 value in the big-endian environment. … … 73 73 * @returns The computed CRC32 of the length bits of the data. 74 74 */ 75 uint32_t compute_crc32_be( uint32_t seed, uint8_t * data, size_t length);75 uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length); 76 76 77 77 /** Computes sum of the 2 byte fields. … … 82 82 * @returns The computed checksum of the length bytes of the data. 83 83 */ 84 uint32_t compute_checksum( uint32_t seed, uint8_t * data, size_t length);84 uint32_t compute_checksum(uint32_t seed, uint8_t * data, size_t length); 85 85 86 86 /** Compacts the computed checksum to the 16 bit number adding the carries. … … 88 88 * @returns Compacted computed checksum to the 16 bits. 89 89 */ 90 uint16_t compact_checksum( uint32_t sum);90 uint16_t compact_checksum(uint32_t sum); 91 91 92 92 /** Returns or flips the checksum if zero. … … 95 95 * @returns 0xFFFF if the computed checksum is zero. 96 96 */ 97 uint16_t flip_checksum( uint16_t checksum);97 uint16_t flip_checksum(uint16_t checksum); 98 98 99 99 /** Computes the ip header checksum. … … 106 106 * @returns 0xFFFF if the computed checksum is zero. 107 107 */ 108 uint16_t ip_checksum( uint8_t * data, size_t length);108 uint16_t ip_checksum(uint8_t * data, size_t length); 109 109 110 110 #endif -
uspace/srv/net/include/device.h
raa85487 raadf01e 50 50 /** Invalid device identifier. 51 51 */ 52 #define DEVICE_INVALID_ID ( -1)52 #define DEVICE_INVALID_ID (-1) 53 53 54 54 /** Device identifier type. … … 92 92 /** Total packets received. 93 93 */ 94 unsigned long 94 unsigned long receive_packets; 95 95 /** Total packets transmitted. 96 96 */ 97 unsigned long 97 unsigned long send_packets; 98 98 /** Total bytes received. 99 99 */ 100 unsigned long 100 unsigned long receive_bytes; 101 101 /** Total bytes transmitted. 102 102 */ 103 unsigned long 103 unsigned long send_bytes; 104 104 /** Bad packets received counter. 105 105 */ 106 unsigned long 106 unsigned long receive_errors; 107 107 /** Packet transmition problems counter. 108 108 */ 109 unsigned long 109 unsigned long send_errors; 110 110 /** No space in buffers counter. 111 111 */ 112 unsigned long 112 unsigned long receive_dropped; 113 113 /** No space available counter. 114 114 */ 115 unsigned long 115 unsigned long send_dropped; 116 116 /** Total multicast packets received. 117 117 */ 118 unsigned long 118 unsigned long multicast; 119 119 /** The number of collisions due to congestion on the medium. 120 120 */ 121 unsigned long 121 unsigned long collisions; 122 122 123 123 /* detailed receive_errors: */ 124 124 /** Received packet length error counter. 125 125 */ 126 unsigned long 126 unsigned long receive_length_errors; 127 127 /** Receiver buffer overflow counter. 128 128 */ 129 unsigned long 129 unsigned long receive_over_errors; 130 130 /** Received packet with crc error counter. 131 131 */ 132 unsigned long 132 unsigned long receive_crc_errors; 133 133 /** Received frame alignment error counter. 134 134 */ 135 unsigned long 135 unsigned long receive_frame_errors; 136 136 /** Receiver fifo overrun counter. 137 137 */ 138 unsigned long 138 unsigned long receive_fifo_errors; 139 139 /** Receiver missed packet counter. 140 140 */ 141 unsigned long 141 unsigned long receive_missed_errors; 142 142 143 143 /* detailed send_errors */ 144 144 /** Transmitter aborted counter. 145 145 */ 146 unsigned long 146 unsigned long send_aborted_errors; 147 147 /** Transmitter carrier errors counter. 148 148 */ 149 unsigned long 149 unsigned long send_carrier_errors; 150 150 /** Transmitter fifo overrun counter. 151 151 */ 152 unsigned long 152 unsigned long send_fifo_errors; 153 153 /** Transmitter carrier errors counter. 154 154 */ 155 unsigned long 155 unsigned long send_heartbeat_errors; 156 156 /** Transmitter window errors counter. 157 157 */ 158 unsigned long 158 unsigned long send_window_errors; 159 159 160 160 /* for cslip etc */ 161 161 /** Total compressed packets received. 162 162 */ 163 unsigned long 163 unsigned long receive_compressed; 164 164 /** Total compressed packet transmitted. 165 165 */ 166 unsigned long 166 unsigned long send_compressed; 167 167 }; 168 168 -
uspace/srv/net/include/ethernet_lsap.h
raa85487 raadf01e 72 72 */ 73 73 #define ETH_LSAP_SNA2 0x0C 74 /** PROWAY (IEC955) Network Management & 74 /** PROWAY (IEC955) Network Management &Initialization LSAP identifier. 75 75 */ 76 76 #define ETH_LSAP_PROWAY_NMI 0x0E -
uspace/srv/net/include/ethernet_protocols.h
raa85487 raadf01e 373 373 #define ETH_P_Stanford_V_Kernel_prod 0x805C 374 374 375 /** Evans & 375 /** Evans &Sutherland ethernet protocol type. 376 376 */ 377 377 #define ETH_P_Evans_Sutherland 0x805D … … 873 873 #define ETH_P_Taurus_Controls_MAX 0x82AB 874 874 875 /** Walker Richer & 875 /** Walker Richer &Quinn ethernet protocol type. 876 876 */ 877 877 #define ETH_P_Walker_Richer_Quinn_MIN 0x82AC 878 878 879 /** Walker Richer & 879 /** Walker Richer &Quinn ethernet protocol type. 880 880 */ 881 881 #define ETH_P_Walker_Richer_Quinn_MAX 0x8693 … … 921 921 #define ETH_P_ATOMIC 0x86DF 922 922 923 /** Landis & 923 /** Landis &Gyr Powers ethernet protocol type. 924 924 */ 925 925 #define ETH_P_Landis_Gyr_Powers_MIN 0x86E0 926 926 927 /** Landis & 927 /** Landis &Gyr Powers ethernet protocol type. 928 928 */ 929 929 #define ETH_P_Landis_Gyr_Powers_MAX 0x86EF -
uspace/srv/net/include/icmp_api.h
raa85487 raadf01e 79 79 * @returns EPARTY if there was an internal error. 80 80 */ 81 int icmp_echo_msg( int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen);81 int icmp_echo_msg(int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen); 82 82 83 83 /*@}*/ -
uspace/srv/net/include/icmp_client.h
raa85487 raadf01e 50 50 * @returns Zero (0) if the packet contains no data. 51 51 */ 52 int icmp_client_process_packet( packet_t packet, icmp_type_t * type, icmp_code_t * code, icmp_param_t * pointer, icmp_param_t * mtu);52 int icmp_client_process_packet(packet_t packet, icmp_type_t * type, icmp_code_t * code, icmp_param_t * pointer, icmp_param_t * mtu); 53 53 54 54 /** Returns the ICMP header length. … … 56 56 * @returns The ICMP header length in bytes. 57 57 */ 58 size_t icmp_client_header_length( packet_t packet);58 size_t icmp_client_header_length(packet_t packet); 59 59 60 60 #endif -
uspace/srv/net/include/icmp_common.h
raa85487 raadf01e 44 44 /** Default timeout for incoming connections in microseconds. 45 45 */ 46 #define ICMP_CONNECT_TIMEOUT ( 1 * 1000 * 1000)46 #define ICMP_CONNECT_TIMEOUT (1 * 1000 * 1000) 47 47 48 48 /** Connects to the ICMP module. … … 53 53 * @returns ETIMEOUT if the connection timeouted. 54 54 */ 55 int icmp_connect_module( services_t service, suseconds_t timeout);55 int icmp_connect_module(services_t service, suseconds_t timeout); 56 56 57 57 #endif -
uspace/srv/net/include/icmp_interface.h
raa85487 raadf01e 71 71 * @returns ENOMEM if there is not enough memory left. 72 72 */ 73 int icmp_destination_unreachable_msg( int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet);73 int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet); 74 74 75 75 /** Sends the Source Quench error notification packet. … … 82 82 * @returns ENOMEM if there is not enough memory left. 83 83 */ 84 int icmp_source_quench_msg( int icmp_phone, packet_t packet);84 int icmp_source_quench_msg(int icmp_phone, packet_t packet); 85 85 86 86 /** Sends the Time Exceeded error notification packet. … … 94 94 * @returns ENOMEM if there is not enough memory left. 95 95 */ 96 int icmp_time_exceeded_msg( int icmp_phone, icmp_code_t code, packet_t packet);96 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet); 97 97 98 98 /** Sends the Parameter Problem error notification packet. … … 107 107 * @returns ENOMEM if there is not enough memory left. 108 108 */ 109 int icmp_parameter_problem_msg( int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet);109 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet); 110 110 111 111 /*@}*/ -
uspace/srv/net/include/il_interface.h
raa85487 raadf01e 64 64 * @returns EOK on success. 65 65 */ 66 static inline int il_device_state_msg( int il_phone, device_id_t device_id, device_state_t state, services_t target){67 return generic_device_state_msg( il_phone, NET_IL_DEVICE_STATE, device_id, state, target);66 static inline int il_device_state_msg(int il_phone, device_id_t device_id, device_state_t state, services_t target){ 67 return generic_device_state_msg(il_phone, NET_IL_DEVICE_STATE, device_id, state, target); 68 68 } 69 69 … … 75 75 * @returns EOK on success. 76 76 */ 77 inline static int il_received_msg( int il_phone, device_id_t device_id, packet_t packet, services_t target){78 return generic_received_msg( il_phone, NET_IL_RECEIVED, device_id, packet_get_id( packet ), target, 0);77 inline static int il_received_msg(int il_phone, device_id_t device_id, packet_t packet, services_t target){ 78 return generic_received_msg(il_phone, NET_IL_RECEIVED, device_id, packet_get_id(packet), target, 0); 79 79 } 80 80 … … 86 86 * @returns EOK on success. 87 87 */ 88 inline static int il_mtu_changed_msg( int il_phone, device_id_t device_id, size_t mtu, services_t target){89 return generic_device_state_msg( il_phone, NET_IL_MTU_CHANGED, device_id, ( int ) mtu, target);88 inline static int il_mtu_changed_msg(int il_phone, device_id_t device_id, size_t mtu, services_t target){ 89 return generic_device_state_msg(il_phone, NET_IL_MTU_CHANGED, device_id, (int) mtu, target); 90 90 } 91 91 -
uspace/srv/net/include/in.h
raa85487 raadf01e 45 45 /** INET string address maximum length. 46 46 */ 47 #define INET_ADDRSTRLEN ( 4 * 3 + 3 + 1)47 #define INET_ADDRSTRLEN (4 * 3 + 3 + 1) 48 48 49 49 /** Type definition of the INET address. … … 62 62 /** 4 byte IP address. 63 63 */ 64 uint32_t 64 uint32_t s_addr; 65 65 }; 66 66 … … 72 72 * Should be AF_INET. 73 73 */ 74 uint16_t 74 uint16_t sin_family; 75 75 /** Port number. 76 76 */ 77 uint16_t 77 uint16_t sin_port; 78 78 /** Internet address. 79 79 */ 80 struct in_addr 80 struct in_addr sin_addr; 81 81 /** Padding to meet the sockaddr size. 82 82 */ 83 uint8_t sin_zero[ 8];83 uint8_t sin_zero[8]; 84 84 }; 85 85 -
uspace/srv/net/include/in6.h
raa85487 raadf01e 45 45 /** INET6 string address maximum length. 46 46 */ 47 #define INET6_ADDRSTRLEN ( 8 * 4 + 7 + 1)47 #define INET6_ADDRSTRLEN (8 * 4 + 7 + 1) 48 48 49 49 /** Type definition of the INET6 address. … … 62 62 /** 16 byte IPv6 address. 63 63 */ 64 unsigned char s6_addr[ 16];64 unsigned char s6_addr[16]; 65 65 }; 66 66 … … 72 72 * Should be AF_INET6. 73 73 */ 74 uint16_t 74 uint16_t sin6_family; 75 75 /** Port number. 76 76 */ 77 uint16_t 77 uint16_t sin6_port; 78 78 /** IPv6 flow information. 79 79 */ 80 uint32_t 80 uint32_t sin6_flowinfo; 81 81 /** IPv6 address. 82 82 */ 83 struct in6_addr 83 struct in6_addr sin6_addr; 84 84 /** Scope identifier. 85 85 */ 86 uint32_t 86 uint32_t sin6_scope_id; 87 87 }; 88 88 -
uspace/srv/net/include/inet.h
raa85487 raadf01e 62 62 * @returns ENOTSUP if the address family is not supported. 63 63 */ 64 int inet_ntop( uint16_t family, const uint8_t * data, char * address, size_t length);64 int inet_ntop(uint16_t family, const uint8_t * data, char * address, size_t length); 65 65 66 66 /** Parses the character string into the address. … … 74 74 * @returns ENOTSUP if the address family is not supported. 75 75 */ 76 int inet_pton( uint16_t family, const char * address, uint8_t * data);76 int inet_pton(uint16_t family, const char * address, uint8_t * data); 77 77 78 78 /** Socket address. … … 82 82 * @see socket.h 83 83 */ 84 uint16_t 84 uint16_t sa_family; 85 85 /** 14 byte protocol address. 86 86 */ 87 uint8_t sa_data[ 14];87 uint8_t sa_data[14]; 88 88 }; 89 89 -
uspace/srv/net/include/ip_client.h
raa85487 raadf01e 57 57 * @returns ENOMEM if there is not enough memory left in the packet. 58 58 */ 59 int ip_client_prepare_packet( packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, size_t ipopt_length);59 int ip_client_prepare_packet(packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, size_t ipopt_length); 60 60 61 61 /** Processes the received IP packet. … … 71 71 * @returns ENOMEM if the packet is too short to contain the IP header. 72 72 */ 73 int ip_client_process_packet( packet_t packet, ip_protocol_t * protocol, ip_ttl_t * ttl, ip_tos_t * tos, int * dont_fragment, size_t * ipopt_length);73 int ip_client_process_packet(packet_t packet, ip_protocol_t * protocol, ip_ttl_t * ttl, ip_tos_t * tos, int * dont_fragment, size_t * ipopt_length); 74 74 75 75 /** Returns the IP header length. … … 78 78 * @returns Zero (0) if there is no IP header. 79 79 */ 80 size_t ip_client_header_length( packet_t packet);80 size_t ip_client_header_length(packet_t packet); 81 81 82 82 /** Updates the IPv4 pseudo header data length field. … … 88 88 * @returns EINVAL if the headerlen parameter is not IPv4 pseudo header length. 89 89 */ 90 int ip_client_set_pseudo_header_data_length( ip_pseudo_header_ref header, size_t headerlen, size_t data_length);90 int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length); 91 91 92 92 /** Constructs the IPv4 pseudo header. … … 108 108 * @returns ENOMEM if there is not enough memory left. 109 109 */ 110 int ip_client_get_pseudo_header( ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, ip_pseudo_header_ref * header, size_t * headerlen);110 int ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, ip_pseudo_header_ref * header, size_t * headerlen); 111 111 112 112 // TODO ipopt manipulation -
uspace/srv/net/include/ip_codes.h
raa85487 raadf01e 94 94 /** Normal delay. 95 95 */ 96 #define IPTOS_NORMALDELAY ( 0x0 << IPTOS_DELAY_SHIFT)96 #define IPTOS_NORMALDELAY (0x0 << IPTOS_DELAY_SHIFT) 97 97 98 98 /** Low delay. 99 99 */ 100 #define IPTOS_LOWDELAY ( 0x1 << IPTOS_DELAY_SHIFT)100 #define IPTOS_LOWDELAY (0x1 << IPTOS_DELAY_SHIFT) 101 101 102 102 /** Normal throughput. 103 103 */ 104 #define IPTOS_NORMALTHROUGHPUT ( 0x0 << IPTOS_THROUGHPUT_SHIFT)104 #define IPTOS_NORMALTHROUGHPUT (0x0 << IPTOS_THROUGHPUT_SHIFT) 105 105 106 106 /** Throughput. 107 107 */ 108 #define IPTOS_THROUGHPUT ( 0x1 << IPTOS_THROUGHPUT_SHIFT)108 #define IPTOS_THROUGHPUT (0x1 << IPTOS_THROUGHPUT_SHIFT) 109 109 110 110 /** Normal reliability. 111 111 */ 112 #define IPTOS_NORMALRELIABILITY ( 0x0 << IPTOS_RELIABILITY_SHIFT)112 #define IPTOS_NORMALRELIABILITY (0x0 << IPTOS_RELIABILITY_SHIFT) 113 113 114 114 /** Reliability. 115 115 */ 116 #define IPTOS_RELIABILITY ( 0x1 << IPTOS_RELIABILITY_SHIFT)116 #define IPTOS_RELIABILITY (0x1 << IPTOS_RELIABILITY_SHIFT) 117 117 118 118 /** Normal cost. 119 119 */ 120 #define IPTOS_NORMALCOST ( 0x0 << IPTOS_COST_SHIFT)120 #define IPTOS_NORMALCOST (0x0 << IPTOS_COST_SHIFT) 121 121 122 122 /** Minimum cost. 123 123 */ 124 #define IPTOS_MICNCOST ( 0x1 << IPTOS_COST_SHIFT)124 #define IPTOS_MICNCOST (0x1 << IPTOS_COST_SHIFT) 125 125 126 126 /*@}*/ … … 137 137 /** Routine precedence. 138 138 */ 139 #define IPTOS_PREC_ROUTINE ( 0x0 << IPTOS_PRECEDENCE_SHIFT)139 #define IPTOS_PREC_ROUTINE (0x0 << IPTOS_PRECEDENCE_SHIFT) 140 140 141 141 /** Priority precedence. 142 142 */ 143 #define IPTOS_PREC_PRIORITY ( 0x1 << IPTOS_PRECEDENCE_SHIFT)143 #define IPTOS_PREC_PRIORITY (0x1 << IPTOS_PRECEDENCE_SHIFT) 144 144 145 145 /** Immediate precedence. 146 146 */ 147 #define IPTOS_PREC_IMMEDIATE ( 0x2 << IPTOS_PRECEDENCE_SHIFT)147 #define IPTOS_PREC_IMMEDIATE (0x2 << IPTOS_PRECEDENCE_SHIFT) 148 148 149 149 /** Flash precedence. 150 150 */ 151 #define IPTOS_PREC_FLASH ( 0x3 << IPTOS_PRECEDENCE_SHIFT)151 #define IPTOS_PREC_FLASH (0x3 << IPTOS_PRECEDENCE_SHIFT) 152 152 153 153 /** Flash override precedence. 154 154 */ 155 #define IPTOS_PREC_FLASHOVERRIDE ( 0x4 << IPTOS_PRECEDENCE_SHIFT)155 #define IPTOS_PREC_FLASHOVERRIDE (0x4 << IPTOS_PRECEDENCE_SHIFT) 156 156 157 157 /** Critical precedence. 158 158 */ 159 #define IPTOS_PREC_CRITIC_ECP ( 0x5 << IPTOS_PRECEDENCE_SHIFT)159 #define IPTOS_PREC_CRITIC_ECP (0x5 << IPTOS_PRECEDENCE_SHIFT) 160 160 161 161 /** Inter-network control precedence. 162 162 */ 163 #define IPTOS_PREC_INTERNETCONTROL ( 0x6 << IPTOS_PRECEDENCE_SHIFT)163 #define IPTOS_PREC_INTERNETCONTROL (0x6 << IPTOS_PRECEDENCE_SHIFT) 164 164 165 165 /** Network control precedence. 166 166 */ 167 #define IPTOS_PREC_NETCONTROL ( 0x7 << IPTOS_PRECEDENCE_SHIFT)167 #define IPTOS_PREC_NETCONTROL (0x7 << IPTOS_PRECEDENCE_SHIFT) 168 168 169 169 /*@}*/ … … 195 195 /** Copy flag. 196 196 */ 197 #define IPOPT_COPY ( 1 << IPOPT_COPY_SHIFT)197 #define IPOPT_COPY (1 << IPOPT_COPY_SHIFT) 198 198 199 199 /** Returns IP option type. … … 202 202 * @param[in] number The IP option number. 203 203 */ 204 #define IPOPT_TYPE( copy, class, number ) ((( copy ) & IPOPT_COPY ) | (( class ) & IPOPT_CLASS_MASK ) | (( number << IPOPT_NUMBER_SHIFT ) & IPOPT_NUMBER_MASK))204 #define IPOPT_TYPE(copy, class, number) (((copy) &IPOPT_COPY) | ((class) &IPOPT_CLASS_MASK) | ((number << IPOPT_NUMBER_SHIFT) &IPOPT_NUMBER_MASK)) 205 205 206 206 /** Returns a value indicating whether the IP option should be copied. 207 207 * @param[in] o The IP option. 208 208 */ 209 #define IPOPT_COPIED( o ) (( o ) & IPOPT_COPY)209 #define IPOPT_COPIED(o) ((o) &IPOPT_COPY) 210 210 211 211 /** Returns an IP option class. 212 212 * @param[in] o The IP option. 213 213 */ 214 #define IPOPT_CLASS( o ) (( o ) & IPOPT_CLASS_MASK)214 #define IPOPT_CLASS(o) ((o) &IPOPT_CLASS_MASK) 215 215 216 216 /** Returns an IP option number. 217 217 * @param[in] o The IP option. 218 218 */ 219 #define IPOPT_NUMBER( o ) (( o ) & IPOPT_NUMBER_MASK)219 #define IPOPT_NUMBER(o) ((o) &IPOPT_NUMBER_MASK) 220 220 221 221 /*@}*/ … … 227 227 /** Control class. 228 228 */ 229 #define IPOPT_CONTROL ( 0 << IPOPT_CLASS_SHIFT)229 #define IPOPT_CONTROL (0 << IPOPT_CLASS_SHIFT) 230 230 231 231 /** Reserved class 1. 232 232 */ 233 #define IPOPT_RESERVED1 ( 1 << IPOPT_CLASS_SHIFT)233 #define IPOPT_RESERVED1 (1 << IPOPT_CLASS_SHIFT) 234 234 235 235 /** Measurement class. 236 236 */ 237 #define IPOPT_MEASUREMENT ( 2 << IPOPT_CLASS_SHIFT)237 #define IPOPT_MEASUREMENT (2 << IPOPT_CLASS_SHIFT) 238 238 239 239 /** Reserved class 2. 240 240 */ 241 #define IPOPT_RESERVED2 ( 3 << IPOPT_CLASS_SHIFT)241 #define IPOPT_RESERVED2 (3 << IPOPT_CLASS_SHIFT) 242 242 243 243 /*@}*/ … … 250 250 */ 251 251 //#define IPOPT_END_OF_LIST 0x0 252 #define IPOPT_END IPOPT_TYPE( 0, IPOPT_CONTROL, 0)252 #define IPOPT_END IPOPT_TYPE(0, IPOPT_CONTROL, 0) 253 253 254 254 /** No operation. 255 255 */ 256 256 //#define IPOPT_NO_OPERATION 0x1 257 #define IPOPT_NOOP IPOPT_TYPE( 0, IPOPT_CONTROL, 1)257 #define IPOPT_NOOP IPOPT_TYPE(0, IPOPT_CONTROL, 1) 258 258 259 259 /** Security. 260 260 */ 261 261 //#define IPOPT_SECURITY 0x82 262 #define IPOPT_SEC IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 2)262 #define IPOPT_SEC IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 2) 263 263 264 264 /** Loose source. 265 265 */ 266 266 //#define IPOPT_LOOSE_SOURCE 0x83 267 #define IPOPT_LSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 3)267 #define IPOPT_LSRR IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 3) 268 268 269 269 /** Strict route. 270 270 */ 271 271 //#define IPOPT_STRICT_SOURCE 0x89 272 #define IPOPT_SSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 9)272 #define IPOPT_SSRR IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 9) 273 273 274 274 /** Record route. 275 275 */ 276 276 //#define IPOPT_RECORD_ROUTE 0x07 277 #define IPOPT_RR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 7)277 #define IPOPT_RR IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 7) 278 278 279 279 /** Stream identifier. 280 280 */ 281 281 //#define IPOPT_STREAM_IDENTIFIER 0x88 282 #define IPOPT_SID IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 8)282 #define IPOPT_SID IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 8) 283 283 284 284 /** Stream identifier length. … … 289 289 */ 290 290 //#define IPOPT_INTERNET_TIMESTAMP 0x44 291 #define IPOPT_TIMESTAMP IPOPT_TYPE( IPOPT_COPY, IPOPT_MEASUREMENT, 4)291 #define IPOPT_TIMESTAMP IPOPT_TYPE(IPOPT_COPY, IPOPT_MEASUREMENT, 4) 292 292 293 293 /** Commercial IP security option. 294 294 */ 295 #define IPOPT_CIPSO IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 5)295 #define IPOPT_CIPSO IPOPT_TYPE(IPOPT_COPY, IPOPT_CONTROL, 5) 296 296 297 297 /** No operation variant. -
uspace/srv/net/include/ip_interface.h
raa85487 raadf01e 70 70 * @returns EOK on success. 71 71 */ 72 typedef int ( * tl_received_msg_t )( device_id_t device_id, packet_t packet, services_t receiver, services_t error);72 typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t packet, services_t receiver, services_t error); 73 73 74 74 /** Creates bidirectional connection with the ip module service and registers the message receiver. … … 82 82 * @returns Other error codes as defined for the bind_service() function. 83 83 */ 84 int ip_bind_service( services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg);84 int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg); 85 85 86 86 /** Registers the new device. … … 98 98 * @returns Other error codes as defined for the arp_device_req() function. 99 99 */ 100 int ip_device_req( int ip_phone, device_id_t device_id, services_t netif);100 int ip_device_req(int ip_phone, device_id_t device_id, services_t netif); 101 101 102 102 /** Sends the packet queue. … … 110 110 * @returns Other error codes as defined for the generic_send_msg() function. 111 111 */ 112 int ip_send_msg( int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error);112 int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error); 113 113 114 114 /** Connects to the IP module. … … 117 117 * @returns 0 if called by the bundle module. 118 118 */ 119 int ip_connect_module( services_t service);119 int ip_connect_module(services_t service); 120 120 121 121 /** Adds a route to the device routing table. … … 127 127 * @param[in] gateway The target network gateway. Not used if zero. 128 128 */ 129 int ip_add_route_req( int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway);129 int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway); 130 130 131 131 /** Sets the default gateway. … … 135 135 * @param[in] gateway The default gateway. 136 136 */ 137 int ip_set_gateway_req( int ip_phone, device_id_t device_id, in_addr_t gateway);137 int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway); 138 138 139 139 /** Returns the device packet dimension for sending. … … 145 145 * @returns Other error codes as defined for the generic_packet_size_req() function. 146 146 */ 147 int ip_packet_size_req( int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension);147 int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension); 148 148 149 149 /** Notifies the IP module about the received error notification packet. … … 155 155 * @returns EOK on success. 156 156 */ 157 int ip_received_error_msg( int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error);157 int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error); 158 158 159 159 /** Returns the device identifier and the IP pseudo header based on the destination address. … … 166 166 * @param[out] headerlen The IP pseudo header length. 167 167 */ 168 int ip_get_route_req( int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen);168 int ip_get_route_req(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen); 169 169 170 170 /*@}*/ -
uspace/srv/net/include/ip_protocols.h
raa85487 raadf01e 610 610 /** Maximum internet protocol number. 611 611 */ 612 #define IPPROTO_MAX ( IPPROTO_RAW + 1)612 #define IPPROTO_MAX (IPPROTO_RAW + 1) 613 613 614 614 /*@}*/ -
uspace/srv/net/include/net_interface.h
raa85487 raadf01e 66 66 * @returns Other error codes as defined for the generic_translate_req() function. 67 67 */ 68 int net_get_device_conf_req( int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data);68 int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data); 69 69 70 70 /** Returns the global configuration. … … 80 80 * @returns Other error codes as defined for the generic_translate_req() function. 81 81 */ 82 int net_get_conf_req( int net_phone, measured_string_ref * configuration, size_t count, char ** data);82 int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data); 83 83 84 84 /** Frees the received settings. … … 88 88 * @see net_get_conf_req() 89 89 */ 90 void net_free_settings( measured_string_ref settings, char * data);90 void net_free_settings(measured_string_ref settings, char * data); 91 91 92 92 /** Connects to the networking module. … … 95 95 * @returns 0 if called by the bundle module. 96 96 */ 97 int net_connect_module( services_t service);97 int net_connect_module(services_t service); 98 98 99 99 /*@}*/ -
uspace/srv/net/include/netdb.h
raa85487 raadf01e 46 46 /** Official host name. 47 47 */ 48 char * 48 char * h_name; 49 49 /** Alias list. 50 50 */ … … 52 52 /** Host address type. 53 53 */ 54 int 54 int h_addrtype; 55 55 /** Address length. 56 56 */ 57 int 57 int h_length; 58 58 /** List of addresses from name server. 59 59 */ … … 61 61 /** Address, for backward compatiblity. 62 62 */ 63 #define h_addr h_addr_list[ 0]63 #define h_addr h_addr_list[0] 64 64 }; 65 65 … … 96 96 * @returns Host entry information. 97 97 */ 98 //struct hostent * gethostbyaddr( const void * address, int len, int type);98 //struct hostent * gethostbyaddr(const void * address, int len, int type); 99 99 100 100 /** Returns host entry by the host name. … … 102 102 * @returns Host entry information. 103 103 */ 104 //struct hostent * gethostbyname( const char * name);104 //struct hostent * gethostbyname(const char * name); 105 105 106 106 #endif -
uspace/srv/net/include/netif_interface.h
raa85487 raadf01e 65 65 * @returns Other error codes as defined for the netif_get_addr_message() function. 66 66 */ 67 int netif_get_addr_req( int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data);67 int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data); 68 68 69 69 /** Probes the existence of the device. … … 75 75 * @returns Other errro codes as defined for the netif_probe_message(). 76 76 */ 77 int netif_probe_req( int netif_phone, device_id_t device_id, int irq, int io);77 int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io); 78 78 79 79 /** Sends the packet queue. … … 85 85 * @returns Other error codes as defined for the generic_send_msg() function. 86 86 */ 87 int netif_send_msg( int netif_phone, device_id_t device_id, packet_t packet, services_t sender);87 int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender); 88 88 89 89 /** Starts the device. … … 94 94 * @returns Other error codes as defined for the netif_start_message() function. 95 95 */ 96 int netif_start_req( int netif_phone, device_id_t device_id);96 int netif_start_req(int netif_phone, device_id_t device_id); 97 97 98 98 /** Stops the device. … … 103 103 * @returns Other error codes as defined for the netif_stop_message() function. 104 104 */ 105 int netif_stop_req( int netif_phone, device_id_t device_id);105 int netif_stop_req(int netif_phone, device_id_t device_id); 106 106 107 107 /** Returns the device usage statistics. … … 111 111 * @returns EOK on success. 112 112 */ 113 int netif_stats_req( int netif_phone, device_id_t device_id, device_stats_ref stats);113 int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats); 114 114 115 115 /** Creates bidirectional connection with the network interface module and registers the message receiver. … … 122 122 * @returns Other error codes as defined for the bind_service() function. 123 123 */ 124 int netif_bind_service( services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver);124 int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver); 125 125 126 126 /*@}*/ -
uspace/srv/net/include/nil_interface.h
raa85487 raadf01e 71 71 * @returns Other error codes as defined for the generic_get_addr_req() function. 72 72 */ 73 #define nil_get_addr_req( nil_phone, device_id, address, data) \74 generic_get_addr_req( nil_phone, NET_NIL_ADDR, device_id, address, data)73 #define nil_get_addr_req(nil_phone, device_id, address, data) \ 74 generic_get_addr_req(nil_phone, NET_NIL_ADDR, device_id, address, data) 75 75 76 76 /** Returns the device broadcast hardware address. … … 84 84 * @returns Other error codes as defined for the generic_get_addr_req() function. 85 85 */ 86 #define nil_get_broadcast_addr_req( nil_phone, device_id, address, data) \87 generic_get_addr_req( nil_phone, NET_NIL_BROADCAST_ADDR, device_id, address, data)86 #define nil_get_broadcast_addr_req(nil_phone, device_id, address, data) \ 87 generic_get_addr_req(nil_phone, NET_NIL_BROADCAST_ADDR, device_id, address, data) 88 88 89 89 /** Sends the packet queue. … … 95 95 * @returns Other error codes as defined for the generic_send_msg() function. 96 96 */ 97 #define nil_send_msg( nil_phone, device_id, packet, sender) \98 generic_send_msg( nil_phone, NET_NIL_SEND, device_id, packet_get_id( packet ), sender, 0)97 #define nil_send_msg(nil_phone, device_id, packet, sender) \ 98 generic_send_msg(nil_phone, NET_NIL_SEND, device_id, packet_get_id(packet), sender, 0) 99 99 100 100 /** Returns the device packet dimension for sending. … … 106 106 * @returns Other error codes as defined for the generic_packet_size_req() function. 107 107 */ 108 #define nil_packet_size_req( nil_phone, device_id, packet_dimension) \109 generic_packet_size_req( nil_phone, NET_NIL_PACKET_SPACE, device_id, packet_dimension)108 #define nil_packet_size_req(nil_phone, device_id, packet_dimension) \ 109 generic_packet_size_req(nil_phone, NET_NIL_PACKET_SPACE, device_id, packet_dimension) 110 110 111 111 /** Registers new device or updates the MTU of an existing one. … … 119 119 * @returns Other error codes as defined for the generic_device_req() function. 120 120 */ 121 #define nil_device_req( nil_phone, device_id, mtu, netif_service) \122 generic_device_req( nil_phone, NET_NIL_DEVICE, device_id, mtu, netif_service)121 #define nil_device_req(nil_phone, device_id, mtu, netif_service) \ 122 generic_device_req(nil_phone, NET_NIL_DEVICE, device_id, mtu, netif_service) 123 123 124 124 /** Notifies the network interface layer about the device state change. … … 129 129 * @returns Other error codes as defined for each specific module device state function. 130 130 */ 131 int nil_device_state_msg( int nil_phone, device_id_t device_id, int state);131 int nil_device_state_msg(int nil_phone, device_id_t device_id, int state); 132 132 133 133 /** Passes the packet queue to the network interface layer. … … 140 140 * @returns Other error codes as defined for each specific module received function. 141 141 */ 142 int nil_received_msg( int nil_phone, device_id_t device_id, packet_t packet, services_t target);142 int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target); 143 143 144 144 /** Creates bidirectional connection with the network interface layer module and registers the message receiver. … … 151 151 * @returns Other error codes as defined for the bind_service() function. 152 152 */ 153 #define nil_bind_service( service, device_id, me, receiver) \154 bind_service( service, device_id, me, 0, receiver);153 #define nil_bind_service(service, device_id, me, receiver) \ 154 bind_service(service, device_id, me, 0, receiver); 155 155 /*@}*/ 156 156 -
uspace/srv/net/include/protocol_map.h
raa85487 raadf01e 50 50 * @returns 0 if mapping is not found. 51 51 */ 52 static inline eth_type_t protocol_map( services_t nil, services_t il){53 switch( nil){52 static inline eth_type_t protocol_map(services_t nil, services_t il){ 53 switch(nil){ 54 54 case SERVICE_ETHERNET: 55 55 case SERVICE_DP8390: 56 switch( il){56 switch(il){ 57 57 case SERVICE_IP: 58 58 return ETH_P_IP; … … 73 73 * @returns 0 if mapping is not found. 74 74 */ 75 static inline services_t protocol_unmap( services_t nil, int protocol){76 switch( nil){75 static inline services_t protocol_unmap(services_t nil, int protocol){ 76 switch(nil){ 77 77 case SERVICE_ETHERNET: 78 78 case SERVICE_DP8390: 79 switch( protocol){79 switch(protocol){ 80 80 case ETH_P_IP: 81 81 return SERVICE_IP; … … 95 95 * @returns ETH_LSAP_NULL if mapping is not found. 96 96 */ 97 static inline eth_type_t lsap_map( eth_lsap_t lsap){98 switch( lsap){97 static inline eth_type_t lsap_map(eth_lsap_t lsap){ 98 switch(lsap){ 99 99 case ETH_LSAP_IP: 100 100 return ETH_P_IP; … … 111 111 * @returns 0 if mapping is not found. 112 112 */ 113 static inline eth_lsap_t lsap_unmap( eth_type_t ethertype){114 switch( ethertype){113 static inline eth_lsap_t lsap_unmap(eth_type_t ethertype){ 114 switch(ethertype){ 115 115 case ETH_P_IP: 116 116 return ETH_LSAP_IP; … … 127 127 * @returns 0 if mapping is not found. 128 128 */ 129 static inline hw_type_t hardware_map( services_t nil){130 switch( nil){129 static inline hw_type_t hardware_map(services_t nil){ 130 switch(nil){ 131 131 case SERVICE_ETHERNET: 132 132 case SERVICE_DP8390: -
uspace/srv/net/include/socket.h
raa85487 raadf01e 65 65 * @returns Other error codes as defined for the bind_service_timeout() function. 66 66 */ 67 int socket( int domain, int type, int protocol);67 int socket(int domain, int type, int protocol); 68 68 69 69 /** Binds the socket to a port address. … … 77 77 * @returns Other error codes as defined for the NET_SOCKET_BIND message. 78 78 */ 79 int bind( int socket_id, const struct sockaddr * my_addr, socklen_t addrlen);79 int bind(int socket_id, const struct sockaddr * my_addr, socklen_t addrlen); 80 80 81 81 /** Sets the number of connections waiting to be accepted. … … 87 87 * @returns Other error codes as defined for the NET_SOCKET_LISTEN message. 88 88 */ 89 int listen( int socket_id, int backlog);89 int listen(int socket_id, int backlog); 90 90 91 91 /** Accepts waiting socket. … … 100 100 * @returns Other error codes as defined for the NET_SOCKET_ACCEPT message. 101 101 */ 102 int accept( int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen);102 int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen); 103 103 104 104 /** Connects socket to the remote server. … … 112 112 * @returns Other error codes as defined for the NET_SOCKET_CONNECT message. 113 113 */ 114 int connect( int socket_id, const struct sockaddr * serv_addr, socklen_t addrlen);114 int connect(int socket_id, const struct sockaddr * serv_addr, socklen_t addrlen); 115 115 116 116 /** Closes the socket. … … 121 121 * @returns Other error codes as defined for the NET_SOCKET_CLOSE message. 122 122 */ 123 int closesocket( int socket_id);123 int closesocket(int socket_id); 124 124 125 125 /** Sends data via the socket. … … 134 134 * @returns Other error codes as defined for the NET_SOCKET_SEND message. 135 135 */ 136 int send( int socket_id, void * data, size_t datalength, int flags);136 int send(int socket_id, void * data, size_t datalength, int flags); 137 137 138 138 /** Sends data via the socket to the remote address. … … 150 150 * @returns Other error codes as defined for the NET_SOCKET_SENDTO message. 151 151 */ 152 int sendto( int socket_id, const void * data, size_t datalength, int flags, const struct sockaddr * toaddr, socklen_t addrlen);152 int sendto(int socket_id, const void * data, size_t datalength, int flags, const struct sockaddr * toaddr, socklen_t addrlen); 153 153 154 154 /** Receives data via the socket. … … 163 163 * @returns Other error codes as defined for the NET_SOCKET_RECV message. 164 164 */ 165 int recv( int socket_id, void * data, size_t datalength, int flags);165 int recv(int socket_id, void * data, size_t datalength, int flags); 166 166 167 167 /** Receives data via the socket. … … 178 178 * @returns Other error codes as defined for the NET_SOCKET_RECVFROM message. 179 179 */ 180 int recvfrom( int socket_id, void * data, size_t datalength, int flags, struct sockaddr * fromaddr, socklen_t * addrlen);180 int recvfrom(int socket_id, void * data, size_t datalength, int flags, struct sockaddr * fromaddr, socklen_t * addrlen); 181 181 182 182 /** Gets socket option. … … 192 192 * @returns Other error codes as defined for the NET_SOCKET_GETSOCKOPT message. 193 193 */ 194 int getsockopt( int socket_id, int level, int optname, void * value, size_t * optlen);194 int getsockopt(int socket_id, int level, int optname, void * value, size_t * optlen); 195 195 196 196 /** Sets socket option. … … 206 206 * @returns Other error codes as defined for the NET_SOCKET_SETSOCKOPT message. 207 207 */ 208 int setsockopt( int socket_id, int level, int optname, const void * value, size_t optlen);208 int setsockopt(int socket_id, int level, int optname, const void * value, size_t optlen); 209 209 210 210 /*@}*/ -
uspace/srv/net/include/socket_codes.h
raa85487 raadf01e 442 442 /** Stream (connection oriented) socket. 443 443 */ 444 SOCK_STREAM 444 SOCK_STREAM = 1, 445 445 /** Datagram (connectionless oriented) socket. 446 446 */ 447 SOCK_DGRAM 447 SOCK_DGRAM = 2, 448 448 /** Raw socket. 449 449 */ 450 SOCK_RAW 450 SOCK_RAW = 3 451 451 } sock_type_t; 452 452 -
uspace/srv/net/include/tl_interface.h
raa85487 raadf01e 64 64 * @returns EOK on success. 65 65 */ 66 inline static int tl_received_msg( int tl_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){67 return generic_received_msg( tl_phone, NET_TL_RECEIVED, device_id, packet_get_id( packet ), target, error);66 inline static int tl_received_msg(int tl_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){ 67 return generic_received_msg(tl_phone, NET_TL_RECEIVED, device_id, packet_get_id(packet), target, error); 68 68 } 69 69
Note:
See TracChangeset
for help on using the changeset viewer.