Changeset f14291b in mainline for uspace/lib/net/generic/net_remote.c
- Timestamp:
- 2010-10-19T20:55:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a93d79a
- Parents:
- 1882525 (diff), a7a85d16 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/net_remote.c
r1882525 rf14291b 27 27 */ 28 28 29 /** @addtogroup net30 * 29 /** @addtogroup libnet 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * 34 * Networking interface implementation for remote modules. 35 * @see net_interface.h 36 36 */ 37 37 38 38 #include <ipc/services.h> 39 #include <ipc/net_net.h> 39 40 40 41 #include <malloc.h> 41 42 42 #include < net_messages.h>43 #include <net _modules.h>44 #include <net _device.h>43 #include <generic.h> 44 #include <net/modules.h> 45 #include <net/device.h> 45 46 #include <net_interface.h> 46 47 #include <adt/measured_strings.h> 47 #include <net_net_messages.h>48 48 49 int net_connect_module(services_t service){ 49 /** Connects to the networking module. 50 * 51 * @returns The networking module phone on success. 52 */ 53 int net_connect_module(void) 54 { 50 55 return connect_to_service(SERVICE_NETWORKING); 51 56 } 52 57 53 void net_free_settings(measured_string_ref settings, char * data){ 54 if(settings){ 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 */ 65 void net_free_settings(measured_string_ref settings, char *data) 66 { 67 if (settings) 55 68 free(settings); 56 } 57 if(data){ 69 if (data) 58 70 free(data); 59 }60 71 } 61 72 62 int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data){ 63 return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, 0, 0, * configuration, count, configuration, data); 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 */ 91 int 92 net_get_conf_req(int net_phone, measured_string_ref *configuration, 93 size_t count, char **data) 94 { 95 return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, 0, 0, 96 *configuration, count, configuration, data); 64 97 } 65 98 66 int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data){ 67 return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, device_id, 0, * configuration, count, configuration, data); 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 */ 118 int 119 net_get_device_conf_req(int net_phone, device_id_t device_id, 120 measured_string_ref *configuration, size_t count, char **data) 121 { 122 return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, 123 device_id, 0, *configuration, count, configuration, data); 68 124 } 69 125
Note:
See TracChangeset
for help on using the changeset viewer.