Changeset 614d065 in mainline


Ignore:
Timestamp:
2010-10-16T14:32:17Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9f9c7fd
Parents:
b69ceea
Message:

Cleanup networking module interfaces.

Location:
uspace
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/net_remote.c

    rb69ceea r614d065  
    4747#include <adt/measured_strings.h>
    4848
    49 int net_connect_module(services_t service)
     49/** Connects to the networking module.
     50 *
     51 * @returns             The networking module phone on success.
     52 */
     53int net_connect_module(void)
    5054{
    5155        return connect_to_service(SERVICE_NETWORKING);
    5256}
    5357
     58/** Frees the received settings.
     59 *
     60 * @param[in] settings  The received settings.
     61 * @param[in] data      The received settings data.
     62 * @see net_get_device_conf_req()
     63 * @see net_get_conf_req()
     64 */
    5465void net_free_settings(measured_string_ref settings, char *data)
    5566{
    5667        if (settings)
    5768                free(settings);
    58 
    5969        if (data)
    6070                free(data);
    6171}
    6272
     73/** Returns the global configuration.
     74 *
     75 * The configuration names are read and the appropriate settings are set
     76 * instead. Call net_free_settings() function to release the returned
     77 * configuration.
     78 *
     79 * @param[in] net_phone The networking module phone.
     80 * @param[in,out] configuration The requested configuration. The names are read
     81 * and the appropriate settings are set instead.
     82 *
     83 * @param[in] count     The configuration entries count.
     84 * @param[in,out] data  The configuration and settings data.
     85 * @returns             EOK on success.
     86 * @returns             EINVAL if the configuration is NULL.
     87 * @returns             EINVAL if the count is zero.
     88 * @returns             Other error codes as defined for the
     89 *                      generic_translate_req() function.
     90 */
    6391int
    6492net_get_conf_req(int net_phone, measured_string_ref *configuration,
     
    6997}
    7098
     99/** Returns the device specific configuration.
     100 *
     101 * Returns the global configuration if the device specific is not found.
     102 * The configuration names are read and the appropriate settings are set
     103 * instead. Call net_free_settings() function to release the returned
     104 * configuration.
     105 *
     106 * @param[in] net_phone The networking module phone.
     107 * @param[in] device_id The device identifier.
     108 * @param[in,out] configuration The requested device configuration. The names
     109 *                      are read and the appropriate settings are set instead.
     110 * @param[in] count     The configuration entries count.
     111 * @param[in,out] data  The configuration and settings data.
     112 * @returns             EOK on success.
     113 * @returns             EINVAL if the configuration is NULL.
     114 * @returns             EINVAL if the count is zero.
     115 * @returns             Other error codes as defined for the
     116 *                      generic_translate_req() function.
     117 */
    71118int
    72119net_get_device_conf_req(int net_phone, device_id_t device_id,
  • uspace/lib/net/include/net_interface.h

    rb69ceea r614d065  
    2727 */
    2828
    29 /** @addtogroup net
     29/** @addtogroup libnet
    3030 *  @{
    3131 */
    3232
    33 #ifndef __NET_NET_INTERFACE_H__
    34 #define __NET_NET_INTERFACE_H__
     33#ifndef LIBNET_NET_INTERFACE_H_
     34#define LIBNET_NET_INTERFACE_H_
    3535
    3636#include <ipc/services.h>
     
    4040
    4141/** @name Networking module interface
    42  *  This interface is used by other modules.
     42 * This interface is used by other modules.
    4343 */
    4444/*@{*/
    4545
    46 /** Returns the device specific configuration.
    47  *  Returns the global configuration if the device specific is not found.
    48  *  The configuration names are read and the appropriate settings are set instead.
    49  *  Call net_free_settings() function to release the returned configuration.
    50  *  @param[in] net_phone The networking module phone.
    51  *  @param[in] device_id The device identifier.
    52  *  @param[in,out] configuration The requested device configuration. The names are read and the appropriate settings are set instead.
    53  *  @param[in] count The configuration entries count.
    54  *  @param[in,out] data The configuration and settings data.
    55  *  @returns EOK on success.
    56  *  @returns EINVAL if the configuration is NULL.
    57  *  @returns EINVAL if the count is zero (0).
    58  *  @returns Other error codes as defined for the generic_translate_req() function.
    59  */
    60 extern int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data);
    61 
    62 /** Returns the global configuration.
    63  *  The configuration names are read and the appropriate settings are set instead.
    64  *  Call net_free_settings() function to release the returned configuration.
    65  *  @param[in] net_phone The networking module phone.
    66  *  @param[in,out] configuration The requested configuration. The names are read and the appropriate settings are set instead.
    67  *  @param[in] count The configuration entries count.
    68  *  @param[in,out] data The configuration and settings data.
    69  *  @returns EOK on success.
    70  *  @returns EINVAL if the configuration is NULL.
    71  *  @returns EINVAL if the count is zero (0).
    72  *  @returns Other error codes as defined for the generic_translate_req() function.
    73  */
    74 extern int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data);
    75 
    76 /** Frees the received settings.
    77  *  @param[in] settings The received settings.
    78  *  @param[in] data The received settings data.
    79  *  @see net_get_device_conf_req()
    80  *  @see net_get_conf_req()
    81  */
    82 extern void net_free_settings(measured_string_ref settings, char * data);
    83 
    84 /** Connects to the networking module.
    85  *  @param service The networking module service. Ignored parameter.
    86  *  @returns The networking module phone on success.
    87  */
    88 extern int net_connect_module(services_t service);
     46extern int net_get_device_conf_req(int, device_id_t, measured_string_ref *,
     47    size_t, char **);
     48extern int net_get_conf_req(int, measured_string_ref *, size_t, char **);
     49extern void net_free_settings(measured_string_ref, char *);
     50extern int net_connect_module(void);
    8951
    9052/*@}*/
  • uspace/srv/net/il/arp/arp_module.c

    rb69ceea r614d065  
    8080       
    8181        async_set_client_connection(client_connection);
    82         arp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
     82        arp_globals.net_phone = net_connect_module();
    8383        ERROR_PROPAGATE(pm_init());
    8484       
  • uspace/srv/net/il/ip/ip_module.c

    rb69ceea r614d065  
    7979       
    8080        async_set_client_connection(client_connection);
    81         ip_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
     81        ip_globals.net_phone = net_connect_module();
    8282        ERROR_PROPAGATE(pm_init());
    8383       
  • uspace/srv/net/nil/eth/eth_module.c

    rb69ceea r614d065  
    6363       
    6464        async_set_client_connection(client_connection);
    65         int net_phone = net_connect_module(SERVICE_NETWORKING);
     65        int net_phone = net_connect_module();
    6666        ERROR_PROPAGATE(pm_init());
    6767       
  • uspace/srv/net/nil/nildummy/nildummy_module.c

    rb69ceea r614d065  
    7171       
    7272        async_set_client_connection(client_connection);
    73         int net_phone = net_connect_module(SERVICE_NETWORKING);
     73        int net_phone = net_connect_module();
    7474        ERROR_PROPAGATE(pm_init());
    7575       
  • uspace/srv/net/tl/icmp/icmp_module.c

    rb69ceea r614d065  
    6969
    7070        async_set_client_connection(client_connection);
    71         icmp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
     71        icmp_globals.net_phone = net_connect_module();
    7272        if(icmp_globals.net_phone < 0){
    7373                return icmp_globals.net_phone;
  • uspace/srv/net/tl/tcp/tcp_module.c

    rb69ceea r614d065  
    7171       
    7272        async_set_client_connection(client_connection);
    73         tcp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
     73        tcp_globals.net_phone = net_connect_module();
    7474        ERROR_PROPAGATE(pm_init());
    7575       
  • uspace/srv/net/tl/udp/udp_module.c

    rb69ceea r614d065  
    6969
    7070        async_set_client_connection(client_connection);
    71         udp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
     71        udp_globals.net_phone = net_connect_module();
    7272        if(udp_globals.net_phone < 0){
    7373                return udp_globals.net_phone;
Note: See TracChangeset for help on using the changeset viewer.