Changeset 849ed54 in mainline for uspace/lib/net/include


Ignore:
Timestamp:
2010-03-30T18:39:04Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7553689
Parents:
7d6fe4db
Message:

Networking work:
Split the networking stack into end-user library (libsocket) and two helper libraries (libnet and libnetif).
Don't use over-the-hand compiling and linking, but rather separation of conserns.
There might be still some issues and the non-modular networking architecture is currently broken, but this will be fixed soon.

Location:
uspace/lib/net/include
Files:
5 added
29 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/include/adt/module_map.h

    r7d6fe4db r849ed54  
    4242#include <ipc/services.h>
    4343
    44 #include "../modules.h"
     44#include <net_modules.h>
    4545
    46 #include "generic_char_map.h"
     46#include <adt/generic_char_map.h>
    4747
    4848/** Type definition of the module structure.
  • uspace/lib/net/include/arp_interface.h

    r7d6fe4db r849ed54  
    4141#define __NET_ARP_INTERFACE_H__
    4242
    43 #include "../structures/measured_strings.h"
    44 
    45 #include "device.h"
     43#include <adt/measured_strings.h>
     44#include <net_device.h>
    4645
    4746/** @name ARP module interface
     
    6766 *  @returns Other error codes as defined for the nil_get_broadcast_addr() function.
    6867 */
    69 int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address);
     68extern int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address);
    7069
    7170/** Translates the given protocol address to the network interface address.
     
    8382 *  @returns ENOENT if the mapping is not found.
    8483 */
    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);
     84extern 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);
    8685
    8786/** Clears the device cache.
     
    9190 *  @returns ENOENT if the device is not found.
    9291 */
    93 int arp_clear_device_req(int arp_phone, device_id_t device_id);
     92extern int arp_clear_device_req(int arp_phone, device_id_t device_id);
    9493
    9594/** Clears the given protocol address from the cache.
     
    101100 *  @returns ENOENT if the mapping is not found.
    102101 */
    103 int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address);
     102extern int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address);
    104103
    105104/** Cleans the cache.
     
    107106 *  @returns EOK on success.
    108107 */
    109 int arp_clean_cache_req(int arp_phone);
     108extern int arp_clean_cache_req(int arp_phone);
    110109
    111110/** Connects to the ARP module.
     
    114113 *  @returns 0 if called by the bundle module.
    115114 */
    116 int arp_connect_module(services_t service);
     115extern int arp_connect_module(services_t service);
    117116
    118117/** Returns the ARP task identifier.
     
    120119 *  @returns 0 if called by the remote module.
    121120 */
    122 task_id_t arp_task_get_id(void);
     121extern task_id_t arp_task_get_id(void);
    123122
    124123/*@}*/
  • uspace/lib/net/include/arp_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../../messages.h"
     43#include <net_messages.h>
    4444
    4545/** ARP module messages.
  • uspace/lib/net/include/icmp_client.h

    r7d6fe4db r849ed54  
    3838#define __NET_ICMP_CLIENT_H__
    3939
    40 #include "icmp_codes.h"
    41 #include "../structures/packet/packet.h"
     40#include <icmp_codes.h>
     41#include <packet/packet.h>
    4242
    4343/** Processes the received packet prefixed with an ICMP header.
     
    5050 *  @returns Zero (0) if the packet contains no data.
    5151 */
    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);
     52extern int icmp_client_process_packet(packet_t packet, icmp_type_t * type, icmp_code_t * code, icmp_param_t * pointer, icmp_param_t * mtu);
    5353
    5454/** Returns the ICMP header length.
     
    5656 *  @returns The ICMP header length in bytes.
    5757 */
    58 size_t icmp_client_header_length(packet_t packet);
     58extern size_t icmp_client_header_length(packet_t packet);
    5959
    6060#endif
  • uspace/lib/net/include/icmp_header.h

    r7d6fe4db r849ed54  
    4141#include <sys/types.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/icmp_codes.h"
     43#include <in.h>
     44#include <icmp_codes.h>
    4545
    4646/** ICMP header size in bytes.
  • uspace/lib/net/include/icmp_interface.h

    r7d6fe4db r849ed54  
    4343#include <sys/types.h>
    4444
    45 #include "device.h"
    46 
    47 #include "../structures/measured_strings.h"
    48 #include "../structures/packet/packet.h"
    49 
    50 #include "inet.h"
    51 #include "ip_codes.h"
    52 #include "socket_codes.h"
    53 
    54 #include "icmp_codes.h"
    55 #include "icmp_common.h"
     45#include <net_device.h>
     46#include <adt/measured_strings.h>
     47#include <packet/packet.h>
     48#include <inet.h>
     49#include <ip_codes.h>
     50#include <socket_codes.h>
     51#include <icmp_codes.h>
     52#include <icmp_common.h>
    5653
    5754/** @name ICMP module interface
     
    7168 *  @returns ENOMEM if there is not enough memory left.
    7269 */
    73 int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet);
     70extern int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet);
    7471
    7572/** Sends the Source Quench error notification packet.
     
    8279 *  @returns ENOMEM if there is not enough memory left.
    8380 */
    84 int icmp_source_quench_msg(int icmp_phone, packet_t packet);
     81extern int icmp_source_quench_msg(int icmp_phone, packet_t packet);
    8582
    8683/** Sends the Time Exceeded error notification packet.
     
    9491 *  @returns ENOMEM if there is not enough memory left.
    9592 */
    96 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet);
     93extern int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet);
    9794
    9895/** Sends the Parameter Problem error notification packet.
     
    107104 *  @returns ENOMEM if there is not enough memory left.
    108105 */
    109 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet);
     106extern int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, icmp_param_t pointer, packet_t packet);
    110107
    111108/*@}*/
  • uspace/lib/net/include/il_interface.h

    r7d6fe4db r849ed54  
    4343#include <ipc/services.h>
    4444
    45 #include "../messages.h"
    46 
    47 #include "../include/device.h"
    48 
    49 #include "../structures/packet/packet.h"
    50 #include "../structures/packet/packet_client.h"
    51 
    52 #include "../il/il_messages.h"
     45#include <net_messages.h>
     46#include <net_device.h>
     47#include <packet/packet.h>
     48#include <packet/packet_client.h>
     49#include <il_messages.h>
    5350
    5451/** @name Internetwork layer module interface
  • uspace/lib/net/include/ip_client.h

    r7d6fe4db r849ed54  
    4040#include <sys/types.h>
    4141
    42 #include "../structures/packet/packet.h"
    43 
    44 #include "ip_codes.h"
    45 #include "ip_interface.h"
    46 #include "socket_codes.h"
     42#include <packet/packet.h>
     43#include <ip_codes.h>
     44#include <ip_interface.h>
     45#include <socket_codes.h>
    4746
    4847/** Prepares the packet to be transfered via IP.
     
    5756 *  @returns ENOMEM if there is not enough memory left in the packet.
    5857 */
    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);
     58extern 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);
    6059
    6160/** Processes the received IP packet.
     
    7170 *  @returns ENOMEM if the packet is too short to contain the IP header.
    7271 */
    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);
     72extern 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);
    7473
    7574/** Returns the IP header length.
     
    7877 *  @returns Zero (0) if there is no IP header.
    7978 */
    80 size_t ip_client_header_length(packet_t packet);
     79extern size_t ip_client_header_length(packet_t packet);
    8180
    8281/** Updates the IPv4 pseudo header data length field.
     
    8887 *  @returns EINVAL if the headerlen parameter is not IPv4 pseudo header length.
    8988 */
    90 int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length);
     89extern int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length);
    9190
    9291/** Constructs the IPv4 pseudo header.
     
    108107 *  @returns ENOMEM if there is not enough memory left.
    109108 */
    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);
     109extern 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);
    111110
    112111// TODO ipopt manipulation
  • uspace/lib/net/include/ip_interface.h

    r7d6fe4db r849ed54  
    4242
    4343#include <async.h>
    44 
    4544#include <ipc/services.h>
    4645
    47 #include "../include/device.h"
     46#include <net_device.h>
     47#include <packet/packet.h>
    4848
    49 #include "../structures/packet/packet.h"
    50 
    51 #include "in.h"
    52 #include "ip_codes.h"
    53 #include "socket_codes.h"
     49#include <in.h>
     50#include <ip_codes.h>
     51#include <socket_codes.h>
    5452
    5553/** @name IP module interface
     
    8280 *  @returns Other error codes as defined for the bind_service() function.
    8381 */
    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);
     82extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg);
    8583
    8684/** Registers the new device.
     
    9896 *  @returns Other error codes as defined for the arp_device_req() function.
    9997 */
    100 int ip_device_req(int ip_phone, device_id_t device_id, services_t netif);
     98extern int ip_device_req(int ip_phone, device_id_t device_id, services_t netif);
    10199
    102100/** Sends the packet queue.
     
    110108 *  @returns Other error codes as defined for the generic_send_msg() function.
    111109 */
    112 int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error);
     110extern int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error);
    113111
    114112/** Connects to the IP module.
     
    117115 *  @returns 0 if called by the bundle module.
    118116 */
    119 int ip_connect_module(services_t service);
     117extern int ip_connect_module(services_t service);
    120118
    121119/** Adds a route to the device routing table.
     
    127125 *  @param[in] gateway The target network gateway. Not used if zero.
    128126 */
    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);
     127extern 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);
    130128
    131129/** Sets the default gateway.
     
    135133 *  @param[in] gateway The default gateway.
    136134 */
    137 int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway);
     135extern int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway);
    138136
    139137/** Returns the device packet dimension for sending.
     
    145143 *  @returns Other error codes as defined for the generic_packet_size_req() function.
    146144 */
    147 int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension);
     145extern int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension);
    148146
    149147/** Notifies the IP module about the received error notification packet.
     
    155153 *  @returns EOK on success.
    156154 */
    157 int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error);
     155extern int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error);
    158156
    159157/** Returns the device identifier and the IP pseudo header based on the destination address.
     
    166164 *  @param[out] headerlen The IP pseudo header length.
    167165 */
    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);
     166extern 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);
    169167
    170168/*@}*/
  • uspace/lib/net/include/ip_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/ip_codes.h"
     43#include <in.h>
     44#include <ip_codes.h>
    4545
    4646/** IP module messages.
  • uspace/lib/net/include/net_checksum.h

    r7d6fe4db r849ed54  
    6565 *  @returns The computed CRC32 of the length bits of the data.
    6666 */
    67 uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length);
     67extern uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length);
    6868
    6969/**     Computes CRC32 value in the big-endian environment.
     
    7373 *  @returns The computed CRC32 of the length bits of the data.
    7474 */
    75 uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length);
     75extern uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length);
    7676
    7777/** Computes sum of the 2 byte fields.
     
    8282 *  @returns The computed checksum of the length bytes of the data.
    8383 */
    84 uint32_t compute_checksum(uint32_t seed, uint8_t * data, size_t length);
     84extern uint32_t compute_checksum(uint32_t seed, uint8_t * data, size_t length);
    8585
    8686/** Compacts the computed checksum to the 16 bit number adding the carries.
     
    8888 *  @returns Compacted computed checksum to the 16 bits.
    8989 */
    90 uint16_t compact_checksum(uint32_t sum);
     90extern uint16_t compact_checksum(uint32_t sum);
    9191
    9292/** Returns or flips the checksum if zero.
     
    9595 *  @returns 0xFFFF if the computed checksum is zero.
    9696 */
    97 uint16_t flip_checksum(uint16_t checksum);
     97extern uint16_t flip_checksum(uint16_t checksum);
    9898
    9999/** Computes the ip header checksum.
     
    106106 *  @returns 0xFFFF if the computed checksum is zero.
    107107 */
    108 uint16_t ip_checksum(uint8_t * data, size_t length);
     108extern uint16_t ip_checksum(uint8_t * data, size_t length);
    109109
    110110#endif
  • uspace/lib/net/include/net_interface.h

    r7d6fe4db r849ed54  
    4343#include <ipc/services.h>
    4444
    45 #include "../include/device.h"
    46 
    47 #include "../structures/measured_strings.h"
     45#include <net_device.h>
     46#include <adt/measured_strings.h>
    4847
    4948/** @name Networking module interface
     
    6665 *  @returns Other error codes as defined for the generic_translate_req() function.
    6766 */
    68 int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data);
     67extern int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data);
    6968
    7069/** Returns the global configuration.
     
    8079 *  @returns Other error codes as defined for the generic_translate_req() function.
    8180 */
    82 int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data);
     81extern int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data);
    8382
    8483/** Frees the received settings.
     
    8887 *  @see net_get_conf_req()
    8988 */
    90 void net_free_settings(measured_string_ref settings, char * data);
     89extern void net_free_settings(measured_string_ref settings, char * data);
    9190
    9291/** Connects to the networking module.
     
    9594 *  @returns 0 if called by the bundle module.
    9695 */
    97 int net_connect_module(services_t service);
     96extern int net_connect_module(services_t service);
    9897
    9998/*@}*/
  • uspace/lib/net/include/net_net_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../messages.h"
     43#include <net_messages.h>
    4444
    4545/** Networking subsystem central module messages.
  • uspace/lib/net/include/netif.h

    r7d6fe4db r849ed54  
    4545#include <ipc/ipc.h>
    4646
    47 #include "../err.h"
    48 
    49 #include "../include/device.h"
    50 
    51 #include "../structures/packet/packet.h"
     47#include <net_err.h>
     48#include <net_device.h>
     49#include <packet/packet.h>
    5250
    5351/** Network interface module skeleton global data.
     
    102100};
    103101
     102extern netif_globals_t netif_globals;
     103
    104104/**     Finds the device specific data.
    105105 *  @param[in] device_id The device identifier.
     
    109109 *  @returns EPERM if the device is not initialized.
    110110 */
    111 int find_device(device_id_t device_id, device_ref * device);
     111extern int find_device(device_id_t device_id, device_ref * device);
    112112
    113113/** Clears the usage statistics.
    114114 *  @param[in] stats The usage statistics.
    115115 */
    116 void null_device_stats(device_stats_ref stats);
     116extern void null_device_stats(device_stats_ref stats);
    117117
    118118// prepared for future optimalizations
     
    120120 *  @param[in] packet_id The packet identifier.
    121121 */
    122 void netif_pq_release(packet_id_t packet_id);
     122extern void netif_pq_release(packet_id_t packet_id);
    123123
    124124/** Allocates new packet to handle the given content size.
     
    127127 *  @returns NULL if there is an error.
    128128 */
    129 packet_t netif_packet_get_1(size_t content);
     129extern packet_t netif_packet_get_1(size_t content);
    130130
    131131/** Processes the netif module messages.
     
    140140 *  @see IS_NET_NETIF_MESSAGE()
    141141 */
    142 int netif_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     142extern int netif_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    143143
    144144/** Initializes the netif module.
    145145 *  The function has to be defined in each module.
    146  *  @param[in] client_connection The client connection functio to be registered.
     146 *  @param[in] net_client_connection The client connection functio to be registered.
    147147 *  @returns EOK on success.
    148148 *  @returns Other error codes as defined for each specific module message function.
    149149 */
    150 int netif_init_module(async_client_conn_t client_connection);
     150extern int netif_init_module(async_client_conn_t client_connection);
    151151
    152152/** Starts and maintains the netif module until terminated.
    153153 *  @returns EOK after the module is terminated.
    154154 */
    155 int netif_run_module(void);
     155extern int netif_run_module(void);
    156156
    157157#endif
  • uspace/lib/net/include/netif_interface.h

    r7d6fe4db r849ed54  
    4343#include <ipc/services.h>
    4444
    45 #include "../messages.h"
    46 
    47 #include "../structures/measured_strings.h"
    48 #include "../structures/packet/packet.h"
    49 
    50 #include "device.h"
     45#include <net_messages.h>
     46#include <adt/measured_strings.h>
     47#include <packet/packet.h>
     48#include <net_device.h>
    5149
    5250/** @name Network interface module interface
     
    6563 *  @returns Other error codes as defined for the netif_get_addr_message() function.
    6664 */
    67 int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data);
     65extern int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data);
    6866
    6967/** Probes the existence of the device.
     
    7573 *  @returns Other errro codes as defined for the netif_probe_message().
    7674 */
    77 int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io);
     75extern int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io);
    7876
    7977/** Sends the packet queue.
     
    8583 *  @returns Other error codes as defined for the generic_send_msg() function.
    8684 */
    87 int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender);
     85extern int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender);
    8886
    8987/** Starts the device.
     
    9492 *  @returns Other error codes as defined for the netif_start_message() function.
    9593 */
    96 int netif_start_req(int netif_phone, device_id_t device_id);
     94extern int netif_start_req(int netif_phone, device_id_t device_id);
    9795
    9896/** Stops the device.
     
    103101 *  @returns Other error codes as defined for the netif_stop_message() function.
    104102 */
    105 int netif_stop_req(int netif_phone, device_id_t device_id);
     103extern int netif_stop_req(int netif_phone, device_id_t device_id);
    106104
    107105/** Returns the device usage statistics.
     
    111109 *  @returns EOK on success.
    112110 */
    113 int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats);
     111extern int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats);
    114112
    115113/** Creates bidirectional connection with the network interface module and registers the message receiver.
     
    122120 *  @returns Other error codes as defined for the bind_service() function.
    123121 */
    124 int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver);
     122extern int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver);
    125123
    126124/*@}*/
  • uspace/lib/net/include/netif_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../messages.h"
     43#include <net_messages.h>
    4444
    4545/** Network interface common module messages.
  • uspace/lib/net/include/netif_module.h

    r7d6fe4db r849ed54  
    4343#include <ipc/services.h>
    4444
    45 #include "../structures/measured_strings.h"
    46 #include "../structures/packet/packet.h"
    47 
    48 #include "../include/device.h"
     45#include <adt/measured_strings.h>
     46#include <packet/packet.h>
     47#include <net_device.h>
    4948
    5049/** Initializes the specific module.
    5150 */
    52 int netif_initialize(void);
     51extern int netif_initialize(void);
    5352
    5453/** Probes the existence of the device.
     
    6059 *  @returns Other error codes as defined for the specific module message implementation.
    6160 */
    62 int netif_probe_message(device_id_t device_id, int irq, uintptr_t io);
     61extern int netif_probe_message(device_id_t device_id, int irq, uintptr_t io);
    6362
    6463/** Sends the packet queue.
     
    7170 *  @returns Other error codes as defined for the specific module message implementation.
    7271 */
    73 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender);
     72extern int netif_send_message(device_id_t device_id, packet_t packet, services_t sender);
    7473
    7574/** Starts the device.
     
    7978 *  @returns Other error codes as defined for the specific module message implementation.
    8079 */
    81 int netif_start_message(device_ref device);
     80extern int netif_start_message(device_ref device);
    8281
    8382/** Stops the device.
     
    8786 *  @returns Other error codes as defined for the specific module message implementation.
    8887 */
    89 int netif_stop_message(device_ref device);
     88extern int netif_stop_message(device_ref device);
    9089
    9190/** Returns the device local hardware address.
     
    9897 *  @returns Other error codes as defined for the specific module message implementation.
    9998 */
    100 int netif_get_addr_message(device_id_t device_id, measured_string_ref address);
     99extern int netif_get_addr_message(device_id_t device_id, measured_string_ref address);
    101100
    102101/** Processes the netif driver specific message.
     
    110109 *  @returns Other error codes as defined for the specific module message implementation.
    111110 */
    112 int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     111extern int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    113112
    114113/** Returns the device usage statistics.
     
    119118 *  @returns Other error codes as defined for the specific module message implementation.
    120119 */
    121 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats);
     120extern int netif_get_device_stats(device_id_t device_id, device_stats_ref stats);
    122121
    123122#endif
  • uspace/lib/net/include/nil_interface.h

    r7d6fe4db r849ed54  
    4747#include <ipc/ipc.h>
    4848
    49 #include "../messages.h"
    50 
    51 #include "../structures/measured_strings.h"
    52 #include "../structures/packet/packet.h"
    53 
    54 #include "../nil/nil_messages.h"
    55 
    56 #include "device.h"
     49#include <net_messages.h>
     50#include <adt/measured_strings.h>
     51#include <packet/packet.h>
     52#include <nil_messages.h>
     53#include <net_device.h>
    5754
    5855/** @name Network interface layer module interface
     
    129126 *  @returns Other error codes as defined for each specific module device state function.
    130127 */
    131 int nil_device_state_msg(int nil_phone, device_id_t device_id, int state);
     128extern int nil_device_state_msg(int nil_phone, device_id_t device_id, int state);
    132129
    133130/** Passes the packet queue to the network interface layer.
     
    140137 *  @returns Other error codes as defined for each specific module received function.
    141138 */
    142 int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target);
     139extern int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target);
    143140
    144141/** Creates bidirectional connection with the network interface layer module and registers the message receiver.
  • uspace/lib/net/include/nil_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../messages.h"
     43#include <net_messages.h>
    4444
    4545/**  Network interface layer module messages.
  • uspace/lib/net/include/nil_module.h

    r7d6fe4db r849ed54  
    3636 */
    3737
    38 #ifndef __NET_ETH_MODULE_H__
    39 #define __NET_ETH_MODULE_H__
     38#ifndef __NET_NIL_MODULE_H__
     39#define __NET_NIL_MODULE_H__
    4040
    4141#include <ipc/ipc.h>
     
    4747 *  @returns Other error codes as defined for each specific module initialize function.
    4848 */
    49 int nil_initialize(int net_phone);
     49extern int nil_initialize(int net_phone);
    5050
    5151/** Message processing function.
     
    6060 *  @see IS_NET_NIL_MESSAGE()
    6161 */
    62 int nil_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     62extern int nil_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6363
    6464#endif
  • uspace/lib/net/include/protocol_map.h

    r7d6fe4db r849ed54  
    4040#include <ipc/services.h>
    4141
    42 #include "ethernet_lsap.h"
    43 #include "ethernet_protocols.h"
    44 #include "hardware.h"
     42#include <ethernet_lsap.h>
     43#include <ethernet_protocols.h>
     44#include <net_hardware.h>
    4545
    4646/** Maps the internetwork layer service to the network interface layer type.
  • uspace/lib/net/include/tl_common.h

    r7d6fe4db r849ed54  
    3838#define __NET_TL_COMMON_H__
    3939
    40 #include "../structures/packet/packet.h"
    41 
    42 #include "../include/device.h"
    43 #include "../include/inet.h"
    44 #include "../include/socket_codes.h"
     40#include <packet/packet.h>
     41#include <net_device.h>
     42#include <inet.h>
     43#include <socket_codes.h>
    4544
    4645/** Device packet dimensions.
     
    5958 *  @returns EAFNOSUPPORT if the address family is not supported.
    6059 */
    61 int tl_get_address_port(const struct sockaddr * addr, int addrlen, uint16_t * port);
     60extern int tl_get_address_port(const struct sockaddr * addr, int addrlen, uint16_t * port);
    6261
    6362/** Gets IP packet dimensions.
     
    7473 *  @returns Other codes as defined for the ip_packet_size_req() function.
    7574 */
    76 int tl_get_ip_packet_dimension(int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref * packet_dimension);
     75extern int tl_get_ip_packet_dimension(int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref * packet_dimension);
    7776
    7877/** Updates IP device packet dimensions cache.
     
    8382 *  @returns ENOENT if the packet dimension is not cached.
    8483 */
    85 int tl_update_ip_packet_dimension(packet_dimensions_ref packet_dimensions, device_id_t device_id, size_t content);
     84extern int tl_update_ip_packet_dimension(packet_dimensions_ref packet_dimensions, device_id_t device_id, size_t content);
    8685
    8786/** Sets the address port.
     
    9493 *  @returns EAFNOSUPPORT if the address family is not supported.
    9594 */
    96 int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port);
     95extern int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port);
    9796
    9897/** Prepares the packet for ICMP error notification.
     
    106105 *  @returns ENOENT if no packet may be sent.
    107106 */
    108 int tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t packet, services_t error);
     107extern int tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t packet, services_t error);
    109108
    110109/** Receives data from the socket into a packet.
     
    120119 *  @returns Other error codes as defined for the async_data_read_finalize() function.
    121120 */
    122 int tl_socket_read_packet_data(int packet_phone, packet_ref packet, size_t prefix, const packet_dimension_ref dimension, const struct sockaddr * addr, socklen_t addrlen);
     121extern int tl_socket_read_packet_data(int packet_phone, packet_ref packet, size_t prefix, const packet_dimension_ref dimension, const struct sockaddr * addr, socklen_t addrlen);
    123122
    124123#endif
  • uspace/lib/net/include/tl_interface.h

    r7d6fe4db r849ed54  
    3939
    4040#include <async.h>
    41 
    4241#include <ipc/services.h>
    4342
    44 #include "../messages.h"
    45 
    46 #include "../include/device.h"
    47 
    48 #include "../structures/packet/packet.h"
    49 #include "../structures/packet/packet_client.h"
    50 
    51 #include "../tl/tl_messages.h"
     43#include <net_messages.h>
     44#include <net_device.h>
     45#include <packet/packet.h>
     46#include <packet/packet_client.h>
     47#include <tl_messages.h>
    5248
    5349/** @name Transport layer module interface
  • uspace/lib/net/include/tl_messages.h

    r7d6fe4db r849ed54  
    4141#include <ipc/ipc.h>
    4242
    43 #include "../messages.h"
     43#include <net_messages.h>
    4444
    4545/** Transport layer modules messages.
Note: See TracChangeset for help on using the changeset viewer.