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