Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/net/net.c

    r1bfd3d3 rfb04cba8  
    7878DEVICE_MAP_IMPLEMENT(netifs, netif_t);
    7979
    80 static int startup(void);
    81 
    8280/** Add the configured setting to the configuration map.
    8381 *
     
    8684 * @param[in] value         The setting value.
    8785 *
    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 */
     90int add_configuration(measured_strings_ref configuration, const char *name,
    9391    const char *value)
    9492{
    9593        int rc;
    9694       
    97         measured_string_t *setting =
     95        measured_string_ref setting =
    9896            measured_string_create_bulk(value, 0);
    9997        if (!setting)
     
    112110/** Generate new system-unique device identifier.
    113111 *
    114  * @return              The system-unique devic identifier.
     112 * @returns             The system-unique devic identifier.
    115113 */
    116114static device_id_t generate_new_device_id(void)
     
    119117}
    120118
    121 static int parse_line(measured_strings_t *configuration, char *line)
     119static int parse_line(measured_strings_ref configuration, char *line)
    122120{
    123121        int rc;
     
    165163       
    166164        /* Create a bulk measured string till the end */
    167         measured_string_t *setting =
     165        measured_string_ref setting =
    168166            measured_string_create_bulk(value, 0);
    169167        if (!setting)
     
    181179
    182180static int read_configuration_file(const char *directory, const char *filename,
    183     measured_strings_t *configuration)
     181    measured_strings_ref configuration)
    184182{
    185183        printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
     
    237235 * @param[in,out] netif The network interface structure.
    238236 *
    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.
    241239 *
    242240 */
     
    248246/** Read the networking subsystem global configuration.
    249247 *
    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.
    252250 *
    253251 */
     
    264262 *                              its own one.
    265263 *
    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.
    268266 *
    269267 */
     
    315313 *                              its own one.
    316314 *
    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.
    320318 *
    321319 */
     
    339337                goto out;
    340338       
    341         rc = startup();
    342         if (rc != EOK)
    343                 goto out;
    344        
    345         task_retval(0);
    346339        async_manager();
    347340
     
    360353 * @param[out] data          The found configuration settings data.
    361354 *
    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 */
     358static int net_get_conf(measured_strings_ref netif_conf,
     359    measured_string_ref configuration, size_t count, char **data)
    367360{
    368361        if (data)
     
    371364        size_t index;
    372365        for (index = 0; index < count; index++) {
    373                 measured_string_t *setting =
     366                measured_string_ref setting =
    374367                    measured_strings_find(netif_conf, configuration[index].value, 0);
    375368                if (!setting)
     
    389382}
    390383
    391 int net_get_conf_req(int net_phone, measured_string_t **configuration,
     384int net_get_conf_req(int net_phone, measured_string_ref *configuration,
    392385    size_t count, char **data)
    393386{
     
    399392
    400393int 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)
    402395{
    403396        if ((!configuration) || (count == 0))
     
    411404}
    412405
    413 void net_free_settings(measured_string_t *settings, char *data)
     406void net_free_settings(measured_string_ref settings, char *data)
    414407{
    415408}
     
    422415 * @param[in] netif The network interface specific data.
    423416 *
    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.
     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.
    431424 *
    432425 */
     
    436429       
    437430        /* Mandatory netif */
    438         measured_string_t *setting =
     431        measured_string_ref setting =
    439432            measured_strings_find(&netif->configuration, CONF_NETIF, 0);
    440433       
     
    514507/** Read the configuration and start all network interfaces.
    515508 *
    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.
    525518 *
    526519 */
     
    557550               
    558551                /* Mandatory name */
    559                 measured_string_t *setting =
     552                measured_string_ref setting =
    560553                    measured_strings_find(&netif->configuration, CONF_NAME, 0);
    561554                if (!setting) {
     
    617610 *                          in the answer parameter.
    618611 *
    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.
    621614 *
    622615 * @see net_interface.h
     
    627620    int *answer_count)
    628621{
    629         measured_string_t *strings;
     622        measured_string_ref strings;
    630623        char *data;
    631624        int rc;
Note: See TracChangeset for help on using the changeset viewer.