Changeset fdbc3ff in mainline for uspace/srv/net/net/net.c


Ignore:
Timestamp:
2010-11-19T23:50:06Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46d4d9f
Parents:
b4c9c61 (diff), a9c6b966 (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rb4c9c61 rfdbc3ff  
    7878DEVICE_MAP_IMPLEMENT(netifs, netif_t);
    7979
     80static int startup(void);
     81
    8082/** Add the configured setting to the configuration map.
    8183 *
     
    8486 * @param[in] value         The setting value.
    8587 *
    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,
     88 * @return EOK on success.
     89 * @return ENOMEM if there is not enough memory left.
     90 *
     91 */
     92int add_configuration(measured_strings_t *configuration, const char *name,
    9193    const char *value)
    9294{
    9395        int rc;
    9496       
    95         measured_string_ref setting =
     97        measured_string_t *setting =
    9698            measured_string_create_bulk(value, 0);
    9799        if (!setting)
     
    110112/** Generate new system-unique device identifier.
    111113 *
    112  * @returns             The system-unique devic identifier.
     114 * @return              The system-unique devic identifier.
    113115 */
    114116static device_id_t generate_new_device_id(void)
     
    117119}
    118120
    119 static int parse_line(measured_strings_ref configuration, char *line)
     121static int parse_line(measured_strings_t *configuration, char *line)
    120122{
    121123        int rc;
     
    163165       
    164166        /* Create a bulk measured string till the end */
    165         measured_string_ref setting =
     167        measured_string_t *setting =
    166168            measured_string_create_bulk(value, 0);
    167169        if (!setting)
     
    179181
    180182static int read_configuration_file(const char *directory, const char *filename,
    181     measured_strings_ref configuration)
     183    measured_strings_t *configuration)
    182184{
    183185        printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
     
    235237 * @param[in,out] netif The network interface structure.
    236238 *
    237  * @returns EOK on success.
    238  * @returns Other 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.
    239241 *
    240242 */
     
    246248/** Read the networking subsystem global configuration.
    247249 *
    248  * @returns EOK on success.
    249  * @returns Other 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.
    250252 *
    251253 */
     
    262264 *                              its own one.
    263265 *
    264  * @returns EOK on success.
    265  * @returns ENOMEM if there is not enough memory left.
     266 * @return EOK on success.
     267 * @return ENOMEM if there is not enough memory left.
    266268 *
    267269 */
     
    313315 *                              its own one.
    314316 *
    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.
     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.
    318320 *
    319321 */
     
    337339                goto out;
    338340       
     341        rc = startup();
     342        if (rc != EOK)
     343                goto out;
     344       
     345        task_retval(0);
    339346        async_manager();
    340347
     
    353360 * @param[out] data          The found configuration settings data.
    354361 *
    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)
     362 * @return EOK.
     363 *
     364 */
     365static int net_get_conf(measured_strings_t *netif_conf,
     366    measured_string_t *configuration, size_t count, char **data)
    360367{
    361368        if (data)
     
    364371        size_t index;
    365372        for (index = 0; index < count; index++) {
    366                 measured_string_ref setting =
     373                measured_string_t *setting =
    367374                    measured_strings_find(netif_conf, configuration[index].value, 0);
    368375                if (!setting)
     
    382389}
    383390
    384 int net_get_conf_req(int net_phone, measured_string_ref *configuration,
     391int net_get_conf_req(int net_phone, measured_string_t **configuration,
    385392    size_t count, char **data)
    386393{
     
    392399
    393400int 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)
    395402{
    396403        if ((!configuration) || (count == 0))
     
    404411}
    405412
    406 void net_free_settings(measured_string_ref settings, char *data)
     413void net_free_settings(measured_string_t *settings, char *data)
    407414{
    408415}
     
    415422 * @param[in] netif The network interface specific data.
    416423 *
    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.
     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.
    424431 *
    425432 */
     
    429436       
    430437        /* Mandatory netif */
    431         measured_string_ref setting =
     438        measured_string_t *setting =
    432439            measured_strings_find(&netif->configuration, CONF_NETIF, 0);
    433440       
     
    507514/** Read the configuration and start all network interfaces.
    508515 *
    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.
     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.
    518525 *
    519526 */
     
    550557               
    551558                /* Mandatory name */
    552                 measured_string_ref setting =
     559                measured_string_t *setting =
    553560                    measured_strings_find(&netif->configuration, CONF_NAME, 0);
    554561                if (!setting) {
     
    610617 *                          in the answer parameter.
    611618 *
    612  * @returns EOK on success.
    613  * @returns ENOTSUP if the message is not known.
     619 * @return EOK on success.
     620 * @return ENOTSUP if the message is not known.
    614621 *
    615622 * @see net_interface.h
     
    620627    int *answer_count)
    621628{
    622         measured_string_ref strings;
     629        measured_string_t *strings;
    623630        char *data;
    624631        int rc;
Note: See TracChangeset for help on using the changeset viewer.