Changeset 849ed54 in mainline for uspace/lib/net


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
Files:
6 added
43 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/adt/module_map.c

    r7d6fe4db r849ed54  
    4141#include <ipc/services.h>
    4242
    43 #include "../err.h"
    44 #include "../modules.h"
     43#include <net_err.h>
     44#include <net_modules.h>
    4545
    46 #include "generic_char_map.h"
    47 #include "module_map.h"
     46#include <adt/generic_char_map.h>
     47#include <adt/module_map.h>
    4848
    4949GENERIC_CHAR_MAP_IMPLEMENT(modules, module_t)
  • uspace/lib/net/generic/net_checksum.c

    r7d6fe4db r849ed54  
    3737#include <sys/types.h>
    3838
    39 #include "include/checksum.h"
     39#include <net_checksum.h>
    4040
    4141/** Big-endian encoding CRC divider.
  • uspace/lib/net/generic/net_remote.c

    r7d6fe4db r849ed54  
    4040#include <malloc.h>
    4141
    42 #include "../messages.h"
    43 #include "../modules.h"
    44 
    45 #include "../include/device.h"
    46 #include "../include/net_interface.h"
    47 
    48 #include "../structures/measured_strings.h"
    49 
    50 #include "net_messages.h"
     42#include <net_messages.h>
     43#include <net_modules.h>
     44#include <net_device.h>
     45#include <net_interface.h>
     46#include <adt/measured_strings.h>
     47#include <net_net_messages.h>
    5148
    5249int net_connect_module(services_t service){
  • uspace/lib/net/generic/packet_remote.c

    r7d6fe4db r849ed54  
    3838#include <async.h>
    3939#include <errno.h>
    40 
    4140#include <ipc/ipc.h>
    4241#include <sys/mman.h>
    4342
    44 #include "../../err.h"
    45 #include "../../messages.h"
    46 
    47 #include "packet.h"
    48 #include "packet_client.h"
    49 #include "packet_header.h"
    50 #include "packet_messages.h"
     43#include <net_err.h>
     44#include <net_messages.h>
     45#include <packet/packet.h>
     46#include <packet/packet_client.h>
     47#include <packet/packet_header.h>
     48#include <packet/packet_messages.h>
    5149
    5250/** Obtains the packet from the packet server as the shared memory block.
  • uspace/lib/net/il/arp_remote.c

    r7d6fe4db r849ed54  
    3838#include <async.h>
    3939#include <errno.h>
    40 
    4140#include <ipc/ipc.h>
    4241#include <ipc/services.h>
    4342
    44 #include "../../messages.h"
    45 #include "../../modules.h"
    46 
    47 #include "../../include/device.h"
    48 #include "../../include/arp_interface.h"
    49 
    50 #include "../../structures/measured_strings.h"
    51 
    52 #include "arp_messages.h"
     43#include <net_messages.h>
     44#include <net_modules.h>
     45#include <net_device.h>
     46#include <arp_interface.h>
     47#include <adt/measured_strings.h>
     48#include <arp_messages.h>
    5349
    5450int arp_connect_module(services_t service){
  • uspace/lib/net/il/ip_client.c

    r7d6fe4db r849ed54  
    3737
    3838#include <errno.h>
    39 
    4039#include <sys/types.h>
    4140
    42 #include "../../include/ip_client.h"
    43 #include "../../include/socket_errno.h"
    44 
    45 #include "../../structures/packet/packet.h"
    46 #include "../../structures/packet/packet_client.h"
    47 
    48 #include "ip_header.h"
     41#include <ip_client.h>
     42#include <socket_errno.h>
     43#include <packet/packet.h>
     44#include <packet/packet_client.h>
     45#include <ip_header.h>
    4946
    5047size_t ip_client_header_length(packet_t packet){
  • uspace/lib/net/il/ip_remote.c

    r7d6fe4db r849ed54  
    3939#include <ipc/services.h>
    4040
    41 #include "../../messages.h"
    42 #include "../../modules.h"
    43 
    44 #include "../../include/device.h"
    45 #include "../../include/inet.h"
    46 #include "../../include/ip_interface.h"
    47 
    48 #include "../../structures/packet/packet_client.h"
    49 
    50 #include "../il_messages.h"
    51 
    52 #include "ip_messages.h"
     41#include <net_messages.h>
     42#include <net_modules.h>
     43#include <net_device.h>
     44#include <inet.h>
     45#include <ip_interface.h>
     46#include <packet/packet_client.h>
     47#include <il_messages.h>
     48#include <ip_messages.h>
    5349
    5450int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway){
  • 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.
  • uspace/lib/net/netif/netif.c

    r7d6fe4db r849ed54  
    4444#include <ipc/services.h>
    4545
    46 #include "../err.h"
    47 #include "../messages.h"
    48 #include "../modules.h"
    49 
    50 #include "../structures/packet/packet.h"
    51 #include "../structures/packet/packet_client.h"
    52 #include "../structures/measured_strings.h"
    53 
    54 #include "../include/device.h"
    55 #include "../include/netif_interface.h"
    56 #include "../include/nil_interface.h"
    57 
    58 #include "netif.h"
    59 #include "netif_messages.h"
    60 #include "netif_module.h"
    61 
    62 /** Network interface module global data.
    63  */
    64 extern netif_globals_t netif_globals;
     46#include <net_err.h>
     47#include <net_messages.h>
     48#include <net_modules.h>
     49#include <packet/packet.h>
     50#include <packet/packet_client.h>
     51#include <adt/measured_strings.h>
     52#include <net_device.h>
     53#include <netif_interface.h>
     54#include <nil_interface.h>
     55#include <netif.h>
     56#include <netif_messages.h>
     57#include <netif_module.h>
    6558
    6659DEVICE_MAP_IMPLEMENT(device_map, device_t)
    6760
    68 /** @name Message processing functions
    69  */
    70 /*@{*/
     61/** Network interface global data.
     62 */
     63netif_globals_t netif_globals;
     64
     65int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io){
     66        int result;
     67
     68        fibril_rwlock_write_lock(&netif_globals.lock);
     69        result = netif_probe_message(device_id, irq, io);
     70        fibril_rwlock_write_unlock(&netif_globals.lock);
     71        return result;
     72}
     73
     74int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender){
     75        int result;
     76
     77        fibril_rwlock_write_lock(&netif_globals.lock);
     78        result = netif_send_message(device_id, packet, sender);
     79        fibril_rwlock_write_unlock(&netif_globals.lock);
     80        return result;
     81}
     82
     83int netif_start_req(int netif_phone, device_id_t device_id){
     84        ERROR_DECLARE;
     85
     86        device_ref device;
     87        int result;
     88        int phone;
     89
     90        fibril_rwlock_write_lock(&netif_globals.lock);
     91        if(ERROR_OCCURRED(find_device(device_id, &device))){
     92                fibril_rwlock_write_unlock(&netif_globals.lock);
     93                return ERROR_CODE;
     94        }
     95        result = netif_start_message(device);
     96        if(result > NETIF_NULL){
     97                phone = device->nil_phone;
     98                fibril_rwlock_write_unlock(&netif_globals.lock);
     99                nil_device_state_msg(phone, device_id, result);
     100                return EOK;
     101        }else{
     102                fibril_rwlock_write_unlock(&netif_globals.lock);
     103        }
     104        return result;
     105}
     106
     107int netif_stop_req(int netif_phone, device_id_t device_id){
     108        ERROR_DECLARE;
     109
     110        device_ref device;
     111        int result;
     112        int phone;
     113
     114        fibril_rwlock_write_lock(&netif_globals.lock);
     115        if(ERROR_OCCURRED(find_device(device_id, &device))){
     116                fibril_rwlock_write_unlock(&netif_globals.lock);
     117                return ERROR_CODE;
     118        }
     119        result = netif_stop_message(device);
     120        if(result > NETIF_NULL){
     121                phone = device->nil_phone;
     122                fibril_rwlock_write_unlock(&netif_globals.lock);
     123                nil_device_state_msg(phone, device_id, result);
     124                return EOK;
     125        }else{
     126                fibril_rwlock_write_unlock(&netif_globals.lock);
     127        }
     128        return result;
     129}
     130
     131int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats){
     132        int res;
     133
     134        fibril_rwlock_read_lock(&netif_globals.lock);
     135        res = netif_get_device_stats(device_id, stats);
     136        fibril_rwlock_read_unlock(&netif_globals.lock);
     137        return res;
     138}
     139
     140int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data){
     141        ERROR_DECLARE;
     142
     143        measured_string_t translation;
     144
     145        if(!(address && data)){
     146                return EBADMEM;
     147        }
     148        fibril_rwlock_read_lock(&netif_globals.lock);
     149        if(! ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))){
     150                *address = measured_string_copy(&translation);
     151                ERROR_CODE = (*address) ? EOK : ENOMEM;
     152        }
     153        fibril_rwlock_read_unlock(&netif_globals.lock);
     154        *data = (** address).value;
     155        return ERROR_CODE;
     156}
     157
     158int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver){
     159        return EOK;
     160}
     161
     162int find_device(device_id_t device_id, device_ref * device){
     163        if(! device){
     164                return EBADMEM;
     165        }
     166        *device = device_map_find(&netif_globals.device_map, device_id);
     167        if(! * device){
     168                return ENOENT;
     169        }
     170        if((** device).state == NETIF_NULL) return EPERM;
     171        return EOK;
     172}
     173
     174void null_device_stats(device_stats_ref stats){
     175        bzero(stats, sizeof(device_stats_t));
     176}
    71177
    72178/** Registers the device notification receiver, the network interface layer module.
     
    77183 *  @returns ELIMIT if there is another module registered.
    78184 */
    79 int register_message(device_id_t device_id, int phone);
    80 
    81 /*@}*/
    82 
    83 int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io){
    84         int result;
    85 
    86         fibril_rwlock_write_lock(&netif_globals.lock);
    87         result = netif_probe_message(device_id, irq, io);
    88         fibril_rwlock_write_unlock(&netif_globals.lock);
    89         return result;
    90 }
    91 
    92 int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender){
    93         int result;
    94 
    95         fibril_rwlock_write_lock(&netif_globals.lock);
    96         result = netif_send_message(device_id, packet, sender);
    97         fibril_rwlock_write_unlock(&netif_globals.lock);
    98         return result;
    99 }
    100 
    101 int netif_start_req(int netif_phone, device_id_t device_id){
    102         ERROR_DECLARE;
    103 
    104         device_ref device;
    105         int result;
    106         int phone;
    107 
    108         fibril_rwlock_write_lock(&netif_globals.lock);
    109         if(ERROR_OCCURRED(find_device(device_id, &device))){
    110                 fibril_rwlock_write_unlock(&netif_globals.lock);
    111                 return ERROR_CODE;
    112         }
    113         result = netif_start_message(device);
    114         if(result > NETIF_NULL){
    115                 phone = device->nil_phone;
    116                 fibril_rwlock_write_unlock(&netif_globals.lock);
    117                 nil_device_state_msg(phone, device_id, result);
    118                 return EOK;
    119         }else{
    120                 fibril_rwlock_write_unlock(&netif_globals.lock);
    121         }
    122         return result;
    123 }
    124 
    125 int netif_stop_req(int netif_phone, device_id_t device_id){
    126         ERROR_DECLARE;
    127 
    128         device_ref device;
    129         int result;
    130         int phone;
    131 
    132         fibril_rwlock_write_lock(&netif_globals.lock);
    133         if(ERROR_OCCURRED(find_device(device_id, &device))){
    134                 fibril_rwlock_write_unlock(&netif_globals.lock);
    135                 return ERROR_CODE;
    136         }
    137         result = netif_stop_message(device);
    138         if(result > NETIF_NULL){
    139                 phone = device->nil_phone;
    140                 fibril_rwlock_write_unlock(&netif_globals.lock);
    141                 nil_device_state_msg(phone, device_id, result);
    142                 return EOK;
    143         }else{
    144                 fibril_rwlock_write_unlock(&netif_globals.lock);
    145         }
    146         return result;
    147 }
    148 
    149 int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats){
    150         int res;
    151 
    152         fibril_rwlock_read_lock(&netif_globals.lock);
    153         res = netif_get_device_stats(device_id, stats);
    154         fibril_rwlock_read_unlock(&netif_globals.lock);
    155         return res;
    156 }
    157 
    158 int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data){
    159         ERROR_DECLARE;
    160 
    161         measured_string_t translation;
    162 
    163         if(!(address && data)){
    164                 return EBADMEM;
    165         }
    166         fibril_rwlock_read_lock(&netif_globals.lock);
    167         if(! ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))){
    168                 *address = measured_string_copy(&translation);
    169                 ERROR_CODE = (*address) ? EOK : ENOMEM;
    170         }
    171         fibril_rwlock_read_unlock(&netif_globals.lock);
    172         *data = (** address).value;
    173         return ERROR_CODE;
    174 }
    175 
    176 int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver){
    177         return EOK;
    178 }
    179 
    180 int find_device(device_id_t device_id, device_ref * device){
    181         if(! device){
    182                 return EBADMEM;
    183         }
    184         *device = device_map_find(&netif_globals.device_map, device_id);
    185         if(! * device){
    186                 return ENOENT;
    187         }
    188         if((** device).state == NETIF_NULL) return EPERM;
    189         return EOK;
    190 }
    191 
    192 void null_device_stats(device_stats_ref stats){
    193         bzero(stats, sizeof(device_stats_t));
    194 }
    195 
    196 int register_message(device_id_t device_id, int phone){
     185static int register_message(device_id_t device_id, int phone){
    197186        ERROR_DECLARE;
    198187
  • uspace/lib/net/netif/netif_nil_bundle.c

    r7d6fe4db r849ed54  
    3737
    3838#include <async.h>
    39 
    4039#include <ipc/ipc.h>
    4140
    42 #include "../messages.h"
    43 
    44 #include "../structures/packet/packet.h"
    45 
    46 #include "../nil/nil_module.h"
    47 
    48 #include "netif.h"
    49 
    50 /** Network interface module global data.
    51  */
    52 extern netif_globals_t netif_globals;
     41#include <net_messages.h>
     42#include <packet/packet.h>
     43#include <nil_module.h>
     44#include <netif_nil_bundle.h>
     45#include <netif.h>
    5346
    5447/** Distributes the messages between the module parts.
     
    6154 *  @returns Other error codes as defined for each specific module message function.
    6255 */
    63 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     56int netif_nil_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     57        if(IS_NET_NIL_MESSAGE(call) || (IPC_GET_METHOD(*call) == IPC_M_CONNECT_TO_ME)){
     58                return nil_message(callid, call, answer, answer_count);
     59        }else{
     60                return netif_message(callid, call, answer, answer_count);
     61        }
     62}
    6463
    6564/** Starts the bundle network interface module.
     
    6968 *  @returns Other error codes as defined for each specific module message function.
    7069 */
    71 int module_start(async_client_conn_t client_connection);
    72 
    73 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    74         if(IS_NET_NIL_MESSAGE(call) || (IPC_GET_METHOD(*call) == IPC_M_CONNECT_TO_ME)){
    75                 return nil_message(callid, call, answer, answer_count);
    76         }else{
    77                 return netif_message(callid, call, answer, answer_count);
    78         }
    79 }
    80 
    81 int module_start(async_client_conn_t client_connection){
     70int netif_nil_module_start(async_client_conn_t client_connection){
    8271        ERROR_DECLARE;
    8372
  • uspace/lib/net/netif/netif_standalone.c

    r7d6fe4db r849ed54  
    3636
    3737#include <async.h>
    38 
    3938#include <ipc/ipc.h>
    4039
    41 #include "netif.h"
     40#include <netif.h>
     41#include <netif_standalone.h>
    4242
    4343/** Delegates the messages to the netif_message() function.
     
    5050 *  @returns Other error codes as defined for each specific module message function.
    5151 */
    52 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     52int netif_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     53        return netif_message(callid, call, answer, answer_count);
     54}
    5355
    5456/** Starts the network interface module.
     
    5860 *  @returns Other error codes as defined for each specific module message function.
    5961 */
    60 int module_start(async_client_conn_t client_connection);
    61 
    62 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    63         return netif_message(callid, call, answer, answer_count);
    64 }
    65 
    66 int module_start(async_client_conn_t client_connection){
     62int netif_module_start(async_client_conn_t client_connection){
    6763        ERROR_DECLARE;
    6864
  • uspace/lib/net/nil/nil_remote.c

    r7d6fe4db r849ed54  
    3636 */
    3737
    38 #include "../messages.h"
    39 
    40 #include "../include/device.h"
    41 #include "../include/nil_interface.h"
    42 
    43 #include "../structures/packet/packet.h"
    44 #include "../structures/packet/packet_client.h"
    45 
    46 #include "nil_messages.h"
     38#include <net_messages.h>
     39#include <net_device.h>
     40#include <nil_interface.h>
     41#include <packet/packet.h>
     42#include <packet/packet_client.h>
     43#include <nil_messages.h>
    4744
    4845int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
  • uspace/lib/net/tl/icmp_client.c

    r7d6fe4db r849ed54  
    3636 */
    3737
    38 #include <errno.h>
    39 
    4038#ifdef CONFIG_DEBUG
    4139        #include <stdio.h>
    4240#endif
    4341
     42#include <errno.h>
    4443#include <sys/types.h>
    4544
    46 #include "../../include/icmp_codes.h"
    47 #include "../../include/icmp_client.h"
    48 
    49 #include "../../structures/packet/packet.h"
    50 #include "../../structures/packet/packet_client.h"
    51 
    52 #include "icmp_header.h"
     45#include <icmp_codes.h>
     46#include <icmp_client.h>
     47#include <packet/packet.h>
     48#include <packet/packet_client.h>
     49#include <icmp_header.h>
    5350
    5451int icmp_client_process_packet(packet_t packet, icmp_type_t * type, icmp_code_t * code, icmp_param_t * pointer, icmp_param_t * mtu){
  • uspace/lib/net/tl/icmp_remote.c

    r7d6fe4db r849ed54  
    3838#include <async.h>
    3939#include <errno.h>
    40 
    4140#include <ipc/ipc.h>
    4241#include <ipc/services.h>
    43 
    4442#include <sys/types.h>
    4543
    46 #include "../../messages.h"
    47 #include "../../modules.h"
    48 
    49 #include "../../include/icmp_interface.h"
    50 
    51 #include "../../structures/packet/packet_client.h"
    52 
    53 #include "icmp_messages.h"
     44#include <net_messages.h>
     45#include <net_modules.h>
     46#include <icmp_interface.h>
     47#include <packet/packet_client.h>
     48#include <icmp_messages.h>
    5449
    5550int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet){
  • uspace/lib/net/tl/tl_common.c

    r7d6fe4db r849ed54  
    3939#include <ipc/services.h>
    4040
    41 #include "../err.h"
    42 
    43 #include "../structures/packet/packet.h"
    44 #include "../structures/packet/packet_client.h"
    45 
    46 #include "../include/device.h"
    47 #include "../include/icmp_interface.h"
    48 #include "../include/in.h"
    49 #include "../include/in6.h"
    50 #include "../include/inet.h"
    51 #include "../include/ip_interface.h"
    52 #include "../include/socket_codes.h"
    53 #include "../include/socket_errno.h"
    54 
    55 #include "tl_common.h"
     41#include <net_err.h>
     42#include <packet/packet.h>
     43#include <packet/packet_client.h>
     44#include <net_device.h>
     45#include <icmp_interface.h>
     46#include <in.h>
     47#include <in6.h>
     48#include <inet.h>
     49#include <ip_interface.h>
     50#include <socket_codes.h>
     51#include <socket_errno.h>
     52#include <tl_common.h>
    5653
    5754DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t);
Note: See TracChangeset for help on using the changeset viewer.