Changes in uspace/srv/net/net/net.c [1bfd3d3:fb04cba8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/net/net.c
r1bfd3d3 rfb04cba8 78 78 DEVICE_MAP_IMPLEMENT(netifs, netif_t); 79 79 80 static int startup(void);81 82 80 /** Add the configured setting to the configuration map. 83 81 * … … 86 84 * @param[in] value The setting value. 87 85 * 88 * @return EOK on success.89 * @return ENOMEM if there is not enough memory left.90 * 91 */ 92 int add_configuration(measured_strings_ t *configuration, const char *name,86 * @returns EOK on success. 87 * @returns ENOMEM if there is not enough memory left. 88 * 89 */ 90 int add_configuration(measured_strings_ref configuration, const char *name, 93 91 const char *value) 94 92 { 95 93 int rc; 96 94 97 measured_string_ t *setting =95 measured_string_ref setting = 98 96 measured_string_create_bulk(value, 0); 99 97 if (!setting) … … 112 110 /** Generate new system-unique device identifier. 113 111 * 114 * @return The system-unique devic identifier.112 * @returns The system-unique devic identifier. 115 113 */ 116 114 static device_id_t generate_new_device_id(void) … … 119 117 } 120 118 121 static int parse_line(measured_strings_ t *configuration, char *line)119 static int parse_line(measured_strings_ref configuration, char *line) 122 120 { 123 121 int rc; … … 165 163 166 164 /* Create a bulk measured string till the end */ 167 measured_string_ t *setting =165 measured_string_ref setting = 168 166 measured_string_create_bulk(value, 0); 169 167 if (!setting) … … 181 179 182 180 static int read_configuration_file(const char *directory, const char *filename, 183 measured_strings_ t *configuration)181 measured_strings_ref configuration) 184 182 { 185 183 printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename); … … 237 235 * @param[in,out] netif The network interface structure. 238 236 * 239 * @return EOK on success.240 * @return Other error codes as defined for the add_configuration() function.237 * @returns EOK on success. 238 * @returns Other error codes as defined for the add_configuration() function. 241 239 * 242 240 */ … … 248 246 /** Read the networking subsystem global configuration. 249 247 * 250 * @return EOK on success.251 * @return Other error codes as defined for the add_configuration() function.248 * @returns EOK on success. 249 * @returns Other error codes as defined for the add_configuration() function. 252 250 * 253 251 */ … … 264 262 * its own one. 265 263 * 266 * @return EOK on success.267 * @return ENOMEM if there is not enough memory left.264 * @returns EOK on success. 265 * @returns ENOMEM if there is not enough memory left. 268 266 * 269 267 */ … … 315 313 * its own one. 316 314 * 317 * @return EOK on successful module termination.318 * @return Other error codes as defined for the net_initialize() function.319 * @return Other error codes as defined for the REGISTER_ME() macro function.315 * @returns EOK on successful module termination. 316 * @returns Other error codes as defined for the net_initialize() function. 317 * @returns Other error codes as defined for the REGISTER_ME() macro function. 320 318 * 321 319 */ … … 339 337 goto out; 340 338 341 rc = startup();342 if (rc != EOK)343 goto out;344 345 task_retval(0);346 339 async_manager(); 347 340 … … 360 353 * @param[out] data The found configuration settings data. 361 354 * 362 * @return EOK.363 * 364 */ 365 static int net_get_conf(measured_strings_ t *netif_conf,366 measured_string_ t *configuration, size_t count, char **data)355 * @returns EOK. 356 * 357 */ 358 static int net_get_conf(measured_strings_ref netif_conf, 359 measured_string_ref configuration, size_t count, char **data) 367 360 { 368 361 if (data) … … 371 364 size_t index; 372 365 for (index = 0; index < count; index++) { 373 measured_string_ t *setting =366 measured_string_ref setting = 374 367 measured_strings_find(netif_conf, configuration[index].value, 0); 375 368 if (!setting) … … 389 382 } 390 383 391 int net_get_conf_req(int net_phone, measured_string_ t **configuration,384 int net_get_conf_req(int net_phone, measured_string_ref *configuration, 392 385 size_t count, char **data) 393 386 { … … 399 392 400 393 int net_get_device_conf_req(int net_phone, device_id_t device_id, 401 measured_string_ t **configuration, size_t count, char **data)394 measured_string_ref *configuration, size_t count, char **data) 402 395 { 403 396 if ((!configuration) || (count == 0)) … … 411 404 } 412 405 413 void net_free_settings(measured_string_ t *settings, char *data)406 void net_free_settings(measured_string_ref settings, char *data) 414 407 { 415 408 } … … 422 415 * @param[in] netif The network interface specific data. 423 416 * 424 * @return EOK on success.425 * @return EINVAL if there are some settings missing.426 * @return ENOENT if the internet protocol module is not known.427 * @return Other error codes as defined for the netif_probe_req() function.428 * @return Other error codes as defined for the nil_device_req() function.429 * @return Other error codes as defined for the needed internet layer430 * registering function.417 * @returns EOK on success. 418 * @returns EINVAL if there are some settings missing. 419 * @returns ENOENT if the internet protocol module is not known. 420 * @returns Other error codes as defined for the netif_probe_req() function. 421 * @returns Other error codes as defined for the nil_device_req() function. 422 * @returns Other error codes as defined for the needed internet layer 423 * registering function. 431 424 * 432 425 */ … … 436 429 437 430 /* Mandatory netif */ 438 measured_string_ t *setting =431 measured_string_ref setting = 439 432 measured_strings_find(&netif->configuration, CONF_NETIF, 0); 440 433 … … 514 507 /** Read the configuration and start all network interfaces. 515 508 * 516 * @return EOK on success.517 * @return EXDEV if there is no available system-unique device identifier.518 * @return EINVAL if any of the network interface names are not configured.519 * @return ENOMEM if there is not enough memory left.520 * @return Other error codes as defined for the read_configuration()521 * function.522 * @return Other error codes as defined for the read_netif_configuration()523 * function.524 * @return Other error codes as defined for the start_device() function.509 * @returns EOK on success. 510 * @returns EXDEV if there is no available system-unique device identifier. 511 * @returns EINVAL if any of the network interface names are not configured. 512 * @returns ENOMEM if there is not enough memory left. 513 * @returns Other error codes as defined for the read_configuration() 514 * function. 515 * @returns Other error codes as defined for the read_netif_configuration() 516 * function. 517 * @returns Other error codes as defined for the start_device() function. 525 518 * 526 519 */ … … 557 550 558 551 /* Mandatory name */ 559 measured_string_ t *setting =552 measured_string_ref setting = 560 553 measured_strings_find(&netif->configuration, CONF_NAME, 0); 561 554 if (!setting) { … … 617 610 * in the answer parameter. 618 611 * 619 * @return EOK on success.620 * @return ENOTSUP if the message is not known.612 * @returns EOK on success. 613 * @returns ENOTSUP if the message is not known. 621 614 * 622 615 * @see net_interface.h … … 627 620 int *answer_count) 628 621 { 629 measured_string_ t *strings;622 measured_string_ref strings; 630 623 char *data; 631 624 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.