Changeset fdbc3ff in mainline for uspace/lib


Ignore:
Timestamp:
2010-11-19T23:50:06Z (15 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.

Location:
uspace/lib
Files:
1 deleted
69 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/libblock.c

    rb4c9c61 rfdbc3ff  
    7575typedef struct {
    7676        link_t link;
    77         dev_handle_t dev_handle;
     77        devmap_handle_t devmap_handle;
    7878        int dev_phone;
    7979        fibril_mutex_t comm_area_lock;
     
    9191static int get_num_blocks(int dev_phone, aoff64_t *nblocks);
    9292
    93 static devcon_t *devcon_search(dev_handle_t dev_handle)
     93static devcon_t *devcon_search(devmap_handle_t devmap_handle)
    9494{
    9595        link_t *cur;
     
    9898        for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
    9999                devcon_t *devcon = list_get_instance(cur, devcon_t, link);
    100                 if (devcon->dev_handle == dev_handle) {
     100                if (devcon->devmap_handle == devmap_handle) {
    101101                        fibril_mutex_unlock(&dcl_lock);
    102102                        return devcon;
     
    107107}
    108108
    109 static int devcon_add(dev_handle_t dev_handle, int dev_phone, size_t bsize,
     109static int devcon_add(devmap_handle_t devmap_handle, int dev_phone, size_t bsize,
    110110    void *comm_area, size_t comm_size)
    111111{
     
    121121       
    122122        link_initialize(&devcon->link);
    123         devcon->dev_handle = dev_handle;
     123        devcon->devmap_handle = devmap_handle;
    124124        devcon->dev_phone = dev_phone;
    125125        fibril_mutex_initialize(&devcon->comm_area_lock);
     
    134134        for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
    135135                devcon_t *d = list_get_instance(cur, devcon_t, link);
    136                 if (d->dev_handle == dev_handle) {
     136                if (d->devmap_handle == devmap_handle) {
    137137                        fibril_mutex_unlock(&dcl_lock);
    138138                        free(devcon);
     
    152152}
    153153
    154 int block_init(dev_handle_t dev_handle, size_t comm_size)
     154int block_init(devmap_handle_t devmap_handle, size_t comm_size)
    155155{
    156156        int rc;
     
    165165        }
    166166
    167         dev_phone = devmap_device_connect(dev_handle, IPC_FLAG_BLOCKING);
     167        dev_phone = devmap_device_connect(devmap_handle, IPC_FLAG_BLOCKING);
    168168        if (dev_phone < 0) {
    169169                munmap(comm_area, comm_size);
     
    185185        }
    186186       
    187         rc = devcon_add(dev_handle, dev_phone, bsize, comm_area, comm_size);
     187        rc = devcon_add(devmap_handle, dev_phone, bsize, comm_area, comm_size);
    188188        if (rc != EOK) {
    189189                munmap(comm_area, comm_size);
     
    195195}
    196196
    197 void block_fini(dev_handle_t dev_handle)
    198 {
    199         devcon_t *devcon = devcon_search(dev_handle);
     197void block_fini(devmap_handle_t devmap_handle)
     198{
     199        devcon_t *devcon = devcon_search(devmap_handle);
    200200        assert(devcon);
    201201       
    202202        if (devcon->cache)
    203                 (void) block_cache_fini(dev_handle);
     203                (void) block_cache_fini(devmap_handle);
    204204
    205205        devcon_remove(devcon);
     
    214214}
    215215
    216 int block_bb_read(dev_handle_t dev_handle, aoff64_t ba)
     216int block_bb_read(devmap_handle_t devmap_handle, aoff64_t ba)
    217217{
    218218        void *bb_buf;
    219219        int rc;
    220220
    221         devcon_t *devcon = devcon_search(dev_handle);
     221        devcon_t *devcon = devcon_search(devmap_handle);
    222222        if (!devcon)
    223223                return ENOENT;
     
    244244}
    245245
    246 void *block_bb_get(dev_handle_t dev_handle)
    247 {
    248         devcon_t *devcon = devcon_search(dev_handle);
     246void *block_bb_get(devmap_handle_t devmap_handle)
     247{
     248        devcon_t *devcon = devcon_search(devmap_handle);
    249249        assert(devcon);
    250250        return devcon->bb_buf;
     
    272272};
    273273
    274 int block_cache_init(dev_handle_t dev_handle, size_t size, unsigned blocks,
     274int block_cache_init(devmap_handle_t devmap_handle, size_t size, unsigned blocks,
    275275    enum cache_mode mode)
    276276{
    277         devcon_t *devcon = devcon_search(dev_handle);
     277        devcon_t *devcon = devcon_search(devmap_handle);
    278278        cache_t *cache;
    279279        if (!devcon)
     
    305305}
    306306
    307 int block_cache_fini(dev_handle_t dev_handle)
    308 {
    309         devcon_t *devcon = devcon_search(dev_handle);
     307int block_cache_fini(devmap_handle_t devmap_handle)
     308{
     309        devcon_t *devcon = devcon_search(devmap_handle);
    310310        cache_t *cache;
    311311        int rc;
     
    374374 * @param block                 Pointer to where the function will store the
    375375 *                              block pointer on success.
    376  * @param dev_handle            Device handle of the block device.
     376 * @param devmap_handle         Device handle of the block device.
    377377 * @param boff                  Block offset.
    378378 * @param flags                 If BLOCK_FLAGS_NOREAD is specified, block_get()
     
    382382 * @return                      EOK on success or a negative error code.
    383383 */
    384 int block_get(block_t **block, dev_handle_t dev_handle, aoff64_t boff, int flags)
     384int block_get(block_t **block, devmap_handle_t devmap_handle, aoff64_t boff, int flags)
    385385{
    386386        devcon_t *devcon;
     
    391391        int rc;
    392392       
    393         devcon = devcon_search(dev_handle);
     393        devcon = devcon_search(devmap_handle);
    394394
    395395        assert(devcon);
     
    500500
    501501                block_initialize(b);
    502                 b->dev_handle = dev_handle;
     502                b->devmap_handle = devmap_handle;
    503503                b->size = cache->lblock_size;
    504504                b->boff = boff;
     
    549549int block_put(block_t *block)
    550550{
    551         devcon_t *devcon = devcon_search(block->dev_handle);
     551        devcon_t *devcon = devcon_search(block->devmap_handle);
    552552        cache_t *cache;
    553553        unsigned blocks_cached;
     
    645645/** Read sequential data from a block device.
    646646 *
    647  * @param dev_handle    Device handle of the block device.
     647 * @param devmap_handle Device handle of the block device.
    648648 * @param bufpos        Pointer to the first unread valid offset within the
    649649 *                      communication buffer.
     
    657657 * @return              EOK on success or a negative return code on failure.
    658658 */
    659 int block_seqread(dev_handle_t dev_handle, size_t *bufpos, size_t *buflen,
     659int block_seqread(devmap_handle_t devmap_handle, size_t *bufpos, size_t *buflen,
    660660    aoff64_t *pos, void *dst, size_t size)
    661661{
     
    665665        devcon_t *devcon;
    666666
    667         devcon = devcon_search(dev_handle);
     667        devcon = devcon_search(devmap_handle);
    668668        assert(devcon);
    669669        block_size = devcon->pblock_size;
     
    711711/** Read blocks directly from device (bypass cache).
    712712 *
    713  * @param dev_handle    Device handle of the block device.
     713 * @param devmap_handle Device handle of the block device.
    714714 * @param ba            Address of first block.
    715715 * @param cnt           Number of blocks.
     
    718718 * @return              EOK on success or negative error code on failure.
    719719 */
    720 int block_read_direct(dev_handle_t dev_handle, aoff64_t ba, size_t cnt, void *buf)
     720int block_read_direct(devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt, void *buf)
    721721{
    722722        devcon_t *devcon;
    723723        int rc;
    724724
    725         devcon = devcon_search(dev_handle);
     725        devcon = devcon_search(devmap_handle);
    726726        assert(devcon);
    727727       
     
    739739/** Write blocks directly to device (bypass cache).
    740740 *
    741  * @param dev_handle    Device handle of the block device.
     741 * @param devmap_handle Device handle of the block device.
    742742 * @param ba            Address of first block.
    743743 * @param cnt           Number of blocks.
     
    746746 * @return              EOK on success or negative error code on failure.
    747747 */
    748 int block_write_direct(dev_handle_t dev_handle, aoff64_t ba, size_t cnt,
     748int block_write_direct(devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt,
    749749    const void *data)
    750750{
     
    752752        int rc;
    753753
    754         devcon = devcon_search(dev_handle);
     754        devcon = devcon_search(devmap_handle);
    755755        assert(devcon);
    756756       
     
    767767/** Get device block size.
    768768 *
    769  * @param dev_handle    Device handle of the block device.
     769 * @param devmap_handle Device handle of the block device.
    770770 * @param bsize         Output block size.
    771771 *
    772772 * @return              EOK on success or negative error code on failure.
    773773 */
    774 int block_get_bsize(dev_handle_t dev_handle, size_t *bsize)
     774int block_get_bsize(devmap_handle_t devmap_handle, size_t *bsize)
    775775{
    776776        devcon_t *devcon;
    777777
    778         devcon = devcon_search(dev_handle);
     778        devcon = devcon_search(devmap_handle);
    779779        assert(devcon);
    780780       
     
    784784/** Get number of blocks on device.
    785785 *
    786  * @param dev_handle    Device handle of the block device.
     786 * @param devmap_handle Device handle of the block device.
    787787 * @param nblocks       Output number of blocks.
    788788 *
    789789 * @return              EOK on success or negative error code on failure.
    790790 */
    791 int block_get_nblocks(dev_handle_t dev_handle, aoff64_t *nblocks)
     791int block_get_nblocks(devmap_handle_t devmap_handle, aoff64_t *nblocks)
    792792{
    793793        devcon_t *devcon;
    794794
    795         devcon = devcon_search(dev_handle);
     795        devcon = devcon_search(devmap_handle);
    796796        assert(devcon);
    797797       
     
    818818                printf("Error %d reading %d blocks starting at block %" PRIuOFF64
    819819                    " from device handle %d\n", rc, cnt, ba,
    820                     devcon->dev_handle);
     820                    devcon->devmap_handle);
    821821#ifndef NDEBUG
    822822                stacktrace_print();
     
    844844        if (rc != EOK) {
    845845                printf("Error %d writing %d blocks starting at block %" PRIuOFF64
    846                     " to device handle %d\n", rc, cnt, ba, devcon->dev_handle);
     846                    " to device handle %d\n", rc, cnt, ba, devcon->devmap_handle);
    847847#ifndef NDEBUG
    848848                stacktrace_print();
  • uspace/lib/block/libblock.h

    rb4c9c61 rfdbc3ff  
    7272        fibril_rwlock_t contents_lock;
    7373        /** Handle of the device where the block resides. */
    74         dev_handle_t dev_handle;
     74        devmap_handle_t devmap_handle;
    7575        /** Block offset on the block device. Counted in 'size'-byte blocks. */
    7676        aoff64_t boff;
     
    9393};
    9494
    95 extern int block_init(dev_handle_t, size_t);
    96 extern void block_fini(dev_handle_t);
     95extern int block_init(devmap_handle_t, size_t);
     96extern void block_fini(devmap_handle_t);
    9797
    98 extern int block_bb_read(dev_handle_t, aoff64_t);
    99 extern void *block_bb_get(dev_handle_t);
     98extern int block_bb_read(devmap_handle_t, aoff64_t);
     99extern void *block_bb_get(devmap_handle_t);
    100100
    101 extern int block_cache_init(dev_handle_t, size_t, unsigned, enum cache_mode);
    102 extern int block_cache_fini(dev_handle_t);
     101extern int block_cache_init(devmap_handle_t, size_t, unsigned, enum cache_mode);
     102extern int block_cache_fini(devmap_handle_t);
    103103
    104 extern int block_get(block_t **, dev_handle_t, aoff64_t, int);
     104extern int block_get(block_t **, devmap_handle_t, aoff64_t, int);
    105105extern int block_put(block_t *);
    106106
    107 extern int block_seqread(dev_handle_t, size_t *, size_t *, aoff64_t *, void *,
     107extern int block_seqread(devmap_handle_t, size_t *, size_t *, aoff64_t *, void *,
    108108    size_t);
    109109
    110 extern int block_get_bsize(dev_handle_t, size_t *);
    111 extern int block_get_nblocks(dev_handle_t, aoff64_t *);
    112 extern int block_read_direct(dev_handle_t, aoff64_t, size_t, void *);
    113 extern int block_write_direct(dev_handle_t, aoff64_t, size_t, const void *);
     110extern int block_get_bsize(devmap_handle_t, size_t *);
     111extern int block_get_nblocks(devmap_handle_t, aoff64_t *);
     112extern int block_read_direct(devmap_handle_t, aoff64_t, size_t, void *);
     113extern int block_write_direct(devmap_handle_t, aoff64_t, size_t, const void *);
    114114
    115115#endif
  • uspace/lib/c/generic/adt/char_map.c

    rb4c9c61 rfdbc3ff  
    6060 * @param[in] value     The integral value to be stored for the key character
    6161 *                      string.
    62  * @returns             EOK on success.
    63  * @returns             ENOMEM if there is not enough memory left.
    64  * @returns             EEXIST if the key character string is already used.
     62 * @return              EOK on success.
     63 * @return              ENOMEM if there is not enough memory left.
     64 * @return              EEXIST if the key character string is already used.
    6565 */
    6666static int
    67 char_map_add_item(char_map_ref map, const char *identifier, size_t length,
     67char_map_add_item(char_map_t *map, const char *identifier, size_t length,
    6868    const int value)
    6969{
    7070        if (map->next == (map->size - 1)) {
    71                 char_map_ref *tmp;
    72 
    73                 tmp = (char_map_ref *) realloc(map->items,
    74                     sizeof(char_map_ref) * 2 * map->size);
     71                char_map_t **tmp;
     72
     73                tmp = (char_map_t **) realloc(map->items,
     74                    sizeof(char_map_t *) * 2 * map->size);
    7575                if (!tmp)
    7676                        return ENOMEM;
     
    8080        }
    8181
    82         map->items[map->next] = (char_map_ref) malloc(sizeof(char_map_t));
     82        map->items[map->next] = (char_map_t *) malloc(sizeof(char_map_t));
    8383        if (!map->items[map->next])
    8484                return ENOMEM;
     
    107107 *
    108108 * @param[in] map       The character string to integer map.
    109  * @returns             TRUE if the map is valid.
    110  * @returns             FALSE otherwise.
    111  */
    112 static int char_map_is_valid(const char_map_ref map)
     109 * @return              TRUE if the map is valid.
     110 * @return              FALSE otherwise.
     111 */
     112static int char_map_is_valid(const char_map_t *map)
    113113{
    114114        return map && (map->magic == CHAR_MAP_MAGIC_VALUE);
     
    127127 * @param[in] value     The integral value to be stored for the key character
    128128 *                      string.
    129  * @returns             EOK on success.
    130  * @returns             EINVAL if the map is not valid.
    131  * @returns             EINVAL if the identifier parameter is NULL.
    132  * @returns             EINVAL if the length parameter zero (0) and the
     129 * @return              EOK on success.
     130 * @return              EINVAL if the map is not valid.
     131 * @return              EINVAL if the identifier parameter is NULL.
     132 * @return              EINVAL if the length parameter zero (0) and the
    133133 *                      identifier parameter is an empty character string (the
    134134 *                      first character is the terminating zero ('\0')
    135135 *                      character.
    136  * @returns             EEXIST if the key character string is already used.
    137  * @returns             Other error codes as defined for the
     136 * @return              EEXIST if the key character string is already used.
     137 * @return              Other error codes as defined for the
    138138 *                      char_map_add_item() function.
    139139 */
    140140int
    141 char_map_add(char_map_ref map, const char *identifier, size_t length,
     141char_map_add(char_map_t *map, const char *identifier, size_t length,
    142142    const int value)
    143143{
     
    172172 * @param[in,out] map   The character string to integer map.
    173173 */
    174 void char_map_destroy(char_map_ref map)
     174void char_map_destroy(char_map_t *map)
    175175{
    176176        if (char_map_is_valid(map)) {
     
    196196 *                      zero (0) which means that the string is processed until
    197197 *                      the terminating zero ('\0') character is found.
    198  * @returns             The node holding the integral value assigned to the key
     198 * @return              The node holding the integral value assigned to the key
    199199 *                      character string.
    200  * @returns             NULL if the key is not assigned a node.
    201  */
    202 static char_map_ref
    203 char_map_find_node(const char_map_ref map, const char *identifier,
     200 * @return              NULL if the key is not assigned a node.
     201 */
     202static char_map_t *
     203char_map_find_node(const char_map_t *map, const char *identifier,
    204204    size_t length)
    205205{
     
    224224        }
    225225
    226         return map;
     226        return (char_map_t *) map;
    227227}
    228228
     
    239239 *                      zero (0) which means that the string is processed until
    240240 *                      the terminating zero ('\0') character is found.
    241  * @returns             The integral value assigned to the key character string.
    242  * @returns             CHAR_MAP_NULL if the key is not assigned a value.
    243  */
    244 int char_map_exclude(char_map_ref map, const char *identifier, size_t length)
    245 {
    246         char_map_ref node;
     241 * @return              The integral value assigned to the key character string.
     242 * @return              CHAR_MAP_NULL if the key is not assigned a value.
     243 */
     244int char_map_exclude(char_map_t *map, const char *identifier, size_t length)
     245{
     246        char_map_t *node;
    247247
    248248        node = char_map_find_node(map, identifier, length);
     
    267267 *                      zero (0) which means that the string is processed until
    268268 *                      the terminating zero ('\0') character is found.
    269  *  @returns            The integral value assigned to the key character string.
    270  *  @returns            CHAR_MAP_NULL if the key is not assigned a value.
    271  */
    272 int char_map_find(const char_map_ref map, const char *identifier, size_t length)
    273 {
    274         char_map_ref node;
     269 *  @return             The integral value assigned to the key character string.
     270 *  @return             CHAR_MAP_NULL if the key is not assigned a value.
     271 */
     272int char_map_find(const char_map_t *map, const char *identifier, size_t length)
     273{
     274        char_map_t *node;
    275275
    276276        node = char_map_find_node(map, identifier, length);
     
    281281 *
    282282 *  @param[in,out] map  The character string to integer map.
    283  *  @returns            EOK on success.
    284  *  @returns            EINVAL if the map parameter is NULL.
    285  *  @returns            ENOMEM if there is not enough memory left.
    286  */
    287 int char_map_initialize(char_map_ref map)
     283 *  @return             EOK on success.
     284 *  @return             EINVAL if the map parameter is NULL.
     285 *  @return             ENOMEM if there is not enough memory left.
     286 */
     287int char_map_initialize(char_map_t *map)
    288288{
    289289        if (!map)
     
    295295        map->next = 0;
    296296
    297         map->items = malloc(sizeof(char_map_ref) * map->size);
     297        map->items = malloc(sizeof(char_map_t *) * map->size);
    298298        if (!map->items) {
    299299                map->magic = 0;
     
    319319 *  @param[in] value    The integral value to be stored for the key character
    320320 *                      string.
    321  *  @returns            EOK on success.
    322  *  @returns            EINVAL if the map is not valid.
    323  *  @returns            EINVAL if the identifier parameter is NULL.
    324  *  @returns            EINVAL if the length parameter zero (0) and the
     321 *  @return             EOK on success.
     322 *  @return             EINVAL if the map is not valid.
     323 *  @return             EINVAL if the identifier parameter is NULL.
     324 *  @return             EINVAL if the length parameter zero (0) and the
    325325 *                      identifier parameter is an empty character string (the
    326326 *                      first character is the terminating zero ('\0) character.
    327  *  @returns            EEXIST if the key character string is already used.
    328  *  @returns            Other error codes as defined for the char_map_add_item()
     327 *  @return             EEXIST if the key character string is already used.
     328 *  @return             Other error codes as defined for the char_map_add_item()
    329329 *                      function.
    330330 */
    331331int
    332 char_map_update(char_map_ref map, const char *identifier, const size_t length,
     332char_map_update(char_map_t *map, const char *identifier, const size_t length,
    333333    const int value)
    334334{
    335         char_map_ref node;
     335        char_map_t *node;
    336336
    337337        node = char_map_find_node(map, identifier, length);
  • uspace/lib/c/generic/adt/dynamic_fifo.c

    rb4c9c61 rfdbc3ff  
    5656 *
    5757 * @param[in] fifo      The dynamic queue.
    58  * @returns             TRUE if the queue is valid.
    59  * @returns             FALSE otherwise.
    60  */
    61 static int dyn_fifo_is_valid(dyn_fifo_ref fifo)
     58 * @return              TRUE if the queue is valid.
     59 * @return              FALSE otherwise.
     60 */
     61static int dyn_fifo_is_valid(dyn_fifo_t *fifo)
    6262{
    6363        return fifo && (fifo->magic_value == DYN_FIFO_MAGIC_VALUE);
     
    6868 * @param[in,out] fifo  The dynamic queue.
    6969 * @param[in] size      The initial queue size.
    70  * @returns             EOK on success.
    71  * @returns             EINVAL if the queue is not valid.
    72  * @returns             EBADMEM if the fifo parameter is NULL.
    73  * @returns             ENOMEM if there is not enough memory left.
    74  */
    75 int dyn_fifo_initialize(dyn_fifo_ref fifo, int size)
     70 * @return              EOK on success.
     71 * @return              EINVAL if the queue is not valid.
     72 * @return              EBADMEM if the fifo parameter is NULL.
     73 * @return              ENOMEM if there is not enough memory left.
     74 */
     75int dyn_fifo_initialize(dyn_fifo_t *fifo, int size)
    7676{
    7777        if (!fifo)
     
    100100 *                      this limit. May be zero or negative to indicate no
    101101 *                      limit.
    102  * @returns             EOK on success.
    103  * @returns             EINVAL if the queue is not valid.
    104  * @returns             ENOMEM if there is not enough memory left.
    105  */
    106 int dyn_fifo_push(dyn_fifo_ref fifo, int value, int max_size)
     102 * @return              EOK on success.
     103 * @return              EINVAL if the queue is not valid.
     104 * @return              ENOMEM if there is not enough memory left.
     105 */
     106int dyn_fifo_push(dyn_fifo_t *fifo, int value, int max_size)
    107107{
    108108        int *new_items;
     
    150150 *
    151151 * @param[in,out] fifo  The dynamic queue.
    152  * @returns             Value of the first item in the queue.
    153  * @returns             EINVAL if the queue is not valid.
    154  * @returns             ENOENT if the queue is empty.
    155  */
    156 int dyn_fifo_pop(dyn_fifo_ref fifo)
     152 * @return              Value of the first item in the queue.
     153 * @return              EINVAL if the queue is not valid.
     154 * @return              ENOENT if the queue is empty.
     155 */
     156int dyn_fifo_pop(dyn_fifo_t *fifo)
    157157{
    158158        int value;
     
    172172 *
    173173 * @param[in,out] fifo  The dynamic queue.
    174  * @returnsi            Value of the first item in the queue.
    175  * @returns             EINVAL if the queue is not valid.
    176  * @returns             ENOENT if the queue is empty.
    177  */
    178 int dyn_fifo_value(dyn_fifo_ref fifo)
     174 * @return              Value of the first item in the queue.
     175 * @return              EINVAL if the queue is not valid.
     176 * @return              ENOENT if the queue is empty.
     177 */
     178int dyn_fifo_value(dyn_fifo_t *fifo)
    179179{
    180180        if (!dyn_fifo_is_valid(fifo))
     
    190190 *
    191191 * @param[in,out] fifo  The dynamic queue.
    192  * @returns             EOK on success.
    193  * @returns             EINVAL if the queue is not valid.
    194  */
    195 int dyn_fifo_destroy(dyn_fifo_ref fifo)
     192 * @return              EOK on success.
     193 * @return              EINVAL if the queue is not valid.
     194 */
     195int dyn_fifo_destroy(dyn_fifo_t *fifo)
    196196{
    197197        if (!dyn_fifo_is_valid(fifo))
  • uspace/lib/c/generic/adt/measured_strings.c

    rb4c9c61 rfdbc3ff  
    5555 *                      appended with the terminating zero ('\0') character
    5656 *                      otherwise.
    57  * @returns             The new bundled character string with measured length.
    58  * @returns             NULL if there is not enough memory left.
    59  */
    60 measured_string_ref
     57 * @return              The new bundled character string with measured length.
     58 * @return              NULL if there is not enough memory left.
     59 */
     60measured_string_t *
    6161measured_string_create_bulk(const char *string, size_t length)
    6262{
    63         measured_string_ref new;
     63        measured_string_t *new;
    6464
    6565        if (length == 0) {
     
    6767                        length++;
    6868        }
    69         new = (measured_string_ref) malloc(sizeof(measured_string_t) +
     69        new = (measured_string_t *) malloc(sizeof(measured_string_t) +
    7070            (sizeof(char) * (length + 1)));
    7171        if (!new)
     
    8484 *
    8585 * @param[in] source    The source measured string to be copied.
    86  * @returns             The copy of the given measured string.
    87  * @returns             NULL if the source parameter is NULL.
    88  * @returns             NULL if there is not enough memory left.
    89  */
    90 measured_string_ref measured_string_copy(measured_string_ref source)
    91 {
    92         measured_string_ref new;
     86 * @return              The copy of the given measured string.
     87 * @return              NULL if the source parameter is NULL.
     88 * @return              NULL if there is not enough memory left.
     89 */
     90measured_string_t *measured_string_copy(measured_string_t *source)
     91{
     92        measured_string_t *new;
    9393
    9494        if (!source)
    9595                return NULL;
    9696
    97         new = (measured_string_ref) malloc(sizeof(measured_string_t));
     97        new = (measured_string_t *) malloc(sizeof(measured_string_t));
    9898        if (new) {
    9999                new->value = (char *) malloc(source->length + 1);
     
    120120 *                      actual character strings.
    121121 *  @param[in] count    The size of the measured strings array.
    122  *  @returns            EOK on success.
    123  *  @returns            EINVAL if the strings or data parameter is NULL.
    124  *  @returns            EINVAL if the count parameter is zero (0).
    125  *  @returns            EINVAL if the sent array differs in size.
    126  *  @returns            EINVAL if there is inconsistency in sent measured
     122 *  @return             EOK on success.
     123 *  @return             EINVAL if the strings or data parameter is NULL.
     124 *  @return             EINVAL if the count parameter is zero (0).
     125 *  @return             EINVAL if the sent array differs in size.
     126 *  @return             EINVAL if there is inconsistency in sent measured
    127127 *                      strings' lengths (should not occur).
    128  *  @returns            ENOMEM if there is not enough memory left.
    129  *  @returns            Other error codes as defined for the
     128 *  @return             ENOMEM if there is not enough memory left.
     129 *  @return             Other error codes as defined for the
    130130 *                      async_data_write_finalize() function.
    131131 */
    132132int
    133 measured_strings_receive(measured_string_ref *strings, char **data,
     133measured_strings_receive(measured_string_t **strings, char **data,
    134134    size_t count)
    135135{
     
    166166        (*data)[lengths[count] - 1] = '\0';
    167167
    168         *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
     168        *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
    169169            count);
    170170        if (!*strings) {
     
    209209 * @param[in] strings   The measured strings array to be processed.
    210210 * @param[in] count     The measured strings array size.
    211  * @returns             The computed sizes array.
    212  * @returns             NULL if there is not enough memory left.
    213  */
    214 static size_t *prepare_lengths(const measured_string_ref strings, size_t count)
     211 * @return              The computed sizes array.
     212 * @return              NULL if there is not enough memory left.
     213 */
     214static size_t *prepare_lengths(const measured_string_t *strings, size_t count)
    215215{
    216216        size_t *lengths;
     
    238238 * @param[in] strings   The measured strings array to be transferred.
    239239 * @param[in] count     The measured strings array size.
    240  * @returns             EOK on success.
    241  * @returns             EINVAL if the strings parameter is NULL.
    242  * @returns             EINVAL if the count parameter is zero (0).
    243  * @returns             EINVAL if the calling module does not accept the given
     240 * @return              EOK on success.
     241 * @return              EINVAL if the strings parameter is NULL.
     242 * @return              EINVAL if the count parameter is zero (0).
     243 * @return              EINVAL if the calling module does not accept the given
    244244 *                      array size.
    245  * @returns             EINVAL if there is inconsistency in sent measured
     245 * @return              EINVAL if there is inconsistency in sent measured
    246246 *                      strings' lengths (should not occur).
    247  * @returns             Other error codes as defined for the
     247 * @return              Other error codes as defined for the
    248248 *                      async_data_read_finalize() function.
    249249 */
    250 int measured_strings_reply(const measured_string_ref strings, size_t count)
     250int measured_strings_reply(const measured_string_t *strings, size_t count)
    251251{
    252252        size_t *lengths;
     
    302302 *                      actual character strings.
    303303 * @param[in] count     The size of the measured strings array.
    304  * @returns             EOK on success.
    305  * @returns             EINVAL if the strings or data parameter is NULL.
    306  * @returns             EINVAL if the phone or count parameter is not positive.
    307  * @returns             EINVAL if the sent array differs in size.
    308  * @returns             ENOMEM if there is not enough memory left.
    309  * @returns             Other error codes as defined for the
     304 * @return              EOK on success.
     305 * @return              EINVAL if the strings or data parameter is NULL.
     306 * @return              EINVAL if the phone or count parameter is not positive.
     307 * @return              EINVAL if the sent array differs in size.
     308 * @return              ENOMEM if there is not enough memory left.
     309 * @return              Other error codes as defined for the
    310310 *                      async_data_read_start() function.
    311311 */
    312312int
    313 measured_strings_return(int phone, measured_string_ref *strings, char **data,
     313measured_strings_return(int phone, measured_string_t **strings, char **data,
    314314    size_t count)
    315315{
     
    339339        }
    340340
    341         *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
     341        *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
    342342            count);
    343343        if (!*strings) {
     
    378378 * @param[in] strings   The measured strings array to be transferred.
    379379 * @param[in] count     The measured strings array size.
    380  * @returns             EOK on success.
    381  * @returns             EINVAL if the strings parameter is NULL.
    382  * @returns             EINVAL if the phone or count parameter is not positive.
    383  * @returns             Other error codes as defined for the
     380 * @return              EOK on success.
     381 * @return              EINVAL if the strings parameter is NULL.
     382 * @return              EINVAL if the phone or count parameter is not positive.
     383 * @return              Other error codes as defined for the
    384384 *                      async_data_write_start() function.
    385385 */
    386386int
    387 measured_strings_send(int phone, const measured_string_ref strings,
     387measured_strings_send(int phone, const measured_string_t *strings,
    388388    size_t count)
    389389{
  • uspace/lib/c/generic/devman.c

    rb4c9c61 rfdbc3ff  
    141141
    142142int devman_child_device_register(
    143         const char *name, match_id_list_t *match_ids, device_handle_t parent_handle, device_handle_t *handle)
     143        const char *name, match_id_list_t *match_ids, devman_handle_t parent_handle, devman_handle_t *handle)
    144144{               
    145145        int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
     
    180180}
    181181
    182 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name)
     182int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name)
    183183{
    184184        int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
     
    189189        async_serialize_start();
    190190        ipc_call_t answer;
    191         aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev_handle, &answer);
     191        aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer);
    192192       
    193193        ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
     
    224224}
    225225
    226 int devman_device_connect(device_handle_t handle, unsigned int flags)
     226int devman_device_connect(devman_handle_t handle, unsigned int flags)
    227227{
    228228        int phone;
     
    239239}
    240240
    241 int devman_parent_device_connect(device_handle_t handle, unsigned int flags)
     241int devman_parent_device_connect(devman_handle_t handle, unsigned int flags)
    242242{
    243243        int phone;
     
    254254}
    255255
    256 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags)
     256int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags)
    257257{
    258258        int phone = devman_get_phone(DEVMAN_CLIENT, flags);
     
    280280        if (retval != EOK) {
    281281                if (handle != NULL)
    282                         *handle = (device_handle_t) -1;
     282                        *handle = (devman_handle_t) -1;
    283283                return retval;
    284284        }
    285285       
    286286        if (handle != NULL)
    287                 *handle = (device_handle_t) IPC_GET_ARG1(answer);
     287                *handle = (devman_handle_t) IPC_GET_ARG1(answer);
    288288       
    289289        return retval;
  • uspace/lib/c/generic/devmap.c

    rb4c9c61 rfdbc3ff  
    132132 *
    133133 */
    134 int devmap_device_register(const char *fqdn, dev_handle_t *handle)
     134int devmap_device_register(const char *fqdn, devmap_handle_t *handle)
    135135{
    136136        int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
     
    163163       
    164164        if (handle != NULL)
    165                 *handle = (dev_handle_t) IPC_GET_ARG1(answer);
     165                *handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    166166       
    167167        return retval;
    168168}
    169169
    170 int devmap_device_get_handle(const char *fqdn, dev_handle_t *handle, unsigned int flags)
     170int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags)
    171171{
    172172        int phone = devmap_get_phone(DEVMAP_CLIENT, flags);
     
    194194        if (retval != EOK) {
    195195                if (handle != NULL)
    196                         *handle = (dev_handle_t) -1;
     196                        *handle = (devmap_handle_t) -1;
    197197                return retval;
    198198        }
    199199       
    200200        if (handle != NULL)
    201                 *handle = (dev_handle_t) IPC_GET_ARG1(answer);
     201                *handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    202202       
    203203        return retval;
    204204}
    205205
    206 int devmap_namespace_get_handle(const char *name, dev_handle_t *handle, unsigned int flags)
     206int devmap_namespace_get_handle(const char *name, devmap_handle_t *handle, unsigned int flags)
    207207{
    208208        int phone = devmap_get_phone(DEVMAP_CLIENT, flags);
     
    230230        if (retval != EOK) {
    231231                if (handle != NULL)
    232                         *handle = (dev_handle_t) -1;
     232                        *handle = (devmap_handle_t) -1;
    233233                return retval;
    234234        }
    235235       
    236236        if (handle != NULL)
    237                 *handle = (dev_handle_t) IPC_GET_ARG1(answer);
     237                *handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    238238       
    239239        return retval;
    240240}
    241241
    242 devmap_handle_type_t devmap_handle_probe(dev_handle_t handle)
     242devmap_handle_type_t devmap_handle_probe(devmap_handle_t handle)
    243243{
    244244        int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
     
    255255}
    256256
    257 int devmap_device_connect(dev_handle_t handle, unsigned int flags)
     257int devmap_device_connect(devmap_handle_t handle, unsigned int flags)
    258258{
    259259        int phone;
     
    305305}
    306306
    307 static size_t devmap_count_devices_internal(int phone, dev_handle_t ns_handle)
     307static size_t devmap_count_devices_internal(int phone, devmap_handle_t ns_handle)
    308308{
    309309        ipcarg_t count;
     
    325325}
    326326
    327 size_t devmap_count_devices(dev_handle_t ns_handle)
     327size_t devmap_count_devices(devmap_handle_t ns_handle)
    328328{
    329329        int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
     
    387387}
    388388
    389 size_t devmap_get_devices(dev_handle_t ns_handle, dev_desc_t **data)
     389size_t devmap_get_devices(devmap_handle_t ns_handle, dev_desc_t **data)
    390390{
    391391        int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
  • uspace/lib/c/generic/net/icmp_api.c

    rb4c9c61 rfdbc3ff  
    6666 * @param[in] addr      The target host address.
    6767 * @param[in] addrlen   The torget host address length.
    68  * @returns             ICMP_ECHO on success.
    69  * @returns             ETIMEOUT if the reply has not arrived before the
     68 * @return              ICMP_ECHO on success.
     69 * @return              ETIMEOUT if the reply has not arrived before the
    7070 *                      timeout.
    71  * @returns             ICMP type of the received error notification.
    72  * @returns             EINVAL if the addrlen parameter is less or equal to
     71 * @return              ICMP type of the received error notification.
     72 * @return              EINVAL if the addrlen parameter is less or equal to
    7373 *                      zero.
    74  * @returns             ENOMEM if there is not enough memory left.
    75  * @returns             EPARTY if there was an internal error.
     74 * @return              ENOMEM if there is not enough memory left.
     75 * @return              EPARTY if there was an internal error.
    7676 */
    7777int
  • uspace/lib/c/generic/net/icmp_common.c

    rb4c9c61 rfdbc3ff  
    5050 * @param[in] timeout   The connection timeout in microseconds. No timeout if
    5151 *                      set to zero.
    52  * @returns             The ICMP module phone on success.
    53  * @returns             ETIMEOUT if the connection timeouted.
     52 * @return              The ICMP module phone on success.
     53 * @return              ETIMEOUT if the connection timeouted.
    5454 */
    5555int icmp_connect_module(services_t service, suseconds_t timeout)
  • uspace/lib/c/generic/net/inet.c

    rb4c9c61 rfdbc3ff  
    5151 *  @param[out] address The character buffer to be filled.
    5252 *  @param[in] length   The buffer length.
    53  *  @returns            EOK on success.
    54  *  @returns            EINVAL if the data or address parameter is NULL.
    55  *  @returns            ENOMEM if the character buffer is not long enough.
    56  *  @returns            ENOTSUP if the address family is not supported.
     53 *  @return             EOK on success.
     54 *  @return             EINVAL if the data or address parameter is NULL.
     55 *  @return             ENOMEM if the character buffer is not long enough.
     56 *  @return             ENOTSUP if the address family is not supported.
    5757 */
    5858int
     
    101101 *  @param[in] address  The character buffer to be parsed.
    102102 *  @param[out] data    The address data to be filled.
    103  *  @returns            EOK on success.
    104  *  @returns            EINVAL if the data parameter is NULL.
    105  *  @returns            ENOENT if the address parameter is NULL.
    106  *  @returns            ENOTSUP if the address family is not supported.
     103 *  @return             EOK on success.
     104 *  @return             EINVAL if the data parameter is NULL.
     105 *  @return             ENOENT if the address parameter is NULL.
     106 *  @return             ENOTSUP if the address family is not supported.
    107107 */
    108108int inet_pton(uint16_t family, const char *address, uint8_t *data)
  • uspace/lib/c/generic/net/modules.c

    rb4c9c61 rfdbc3ff  
    159159 *
    160160 * @param[in] need      The needed module service.
    161  * @returns             The phone of the needed service.
     161 * @return              The phone of the needed service.
    162162 */
    163163int connect_to_service(services_t need)
     
    171171 *  @param[in] timeout  The connection timeout in microseconds. No timeout if
    172172 *                      set to zero (0).
    173  *  @returns            The phone of the needed service.
    174  *  @returns            ETIMEOUT if the connection timeouted.
     173 *  @return             The phone of the needed service.
     174 *  @return             ETIMEOUT if the connection timeouted.
    175175 */
    176176int connect_to_service_timeout(services_t need, suseconds_t timeout)
     
    204204 * @param[out] data     The data buffer to be filled.
    205205 * @param[out] length   The buffer length.
    206  * @returns             EOK on success.
    207  * @returns             EBADMEM if the data or the length parameter is NULL.
    208  * @returns             EINVAL if the client does not send data.
    209  * @returns             ENOMEM if there is not enough memory left.
    210  * @returns             Other error codes as defined for the
     206 * @return              EOK on success.
     207 * @return              EBADMEM if the data or the length parameter is NULL.
     208 * @return              EINVAL if the client does not send data.
     209 * @return              ENOMEM if there is not enough memory left.
     210 * @return              Other error codes as defined for the
    211211 *                      async_data_write_finalize() function.
    212212 */
     
    242242 * @param[in] data      The data buffer to be sent.
    243243 * @param[in] data_length The buffer length.
    244  * @returns             EOK on success.
    245  * @returns             EINVAL if the client does not expect the data.
    246  * @returns             EOVERFLOW if the client does not expect all the data.
     244 * @return              EOK on success.
     245 * @return              EINVAL if the client does not expect the data.
     246 * @return              EOVERFLOW if the client does not expect all the data.
    247247 *                      Only partial data are transfered.
    248  * @returns             Other error codes as defined for the
     248 * @return              Other error codes as defined for the
    249249 *                      async_data_read_finalize() function.
    250250 */
  • uspace/lib/c/generic/net/packet.c

    rb4c9c61 rfdbc3ff  
    6464typedef packet_t packet_map_t[PACKET_MAP_SIZE];
    6565
    66 /** Type definition of the packet map page pointer. */
    67 typedef packet_map_t * packet_map_ref;
    68 
    6966/** Packet map.
    7067 * Maps packet identifiers to the packet references.
     
    8582/** Initializes the packet map.
    8683 *
    87  * @returns             EOK on success.
    88  * @returns             ENOMEM if there is not enough memory left.
     84 * @return              EOK on success.
     85 * @return              ENOMEM if there is not enough memory left.
    8986 */
    9087int pm_init(void)
     
    104101 *
    105102 * @param[in] packet_id The packet identifier to be found.
    106  * @returns             The found packet reference.
    107  * @returns             NULL if the mapping does not exist.
     103 * @return              The found packet reference.
     104 * @return              NULL if the mapping does not exist.
    108105 */
    109106packet_t pm_find(packet_id_t packet_id)
    110107{
    111         packet_map_ref map;
     108        packet_map_t *map;
    112109        packet_t packet;
    113110
     
    133130 *
    134131 * @param[in] packet    The packet to be remembered.
    135  * @returns             EOK on success.
    136  * @returns             EINVAL if the packet is not valid.
    137  * @returns             EINVAL if the packet map is not initialized.
    138  * @returns             ENOMEM if there is not enough memory left.
     132 * @return              EOK on success.
     133 * @return              EINVAL if the packet is not valid.
     134 * @return              EINVAL if the packet map is not initialized.
     135 * @return              ENOMEM if there is not enough memory left.
    139136 */
    140137int pm_add(packet_t packet)
    141138{
    142         packet_map_ref map;
     139        packet_map_t *map;
    143140        int rc;
    144141
     
    154151        } else {
    155152                do {
    156                         map = (packet_map_ref) malloc(sizeof(packet_map_t));
     153                        map = (packet_map_t *) malloc(sizeof(packet_map_t));
    157154                        if (!map) {
    158155                                fibril_rwlock_write_unlock(&pm_globals.lock);
     
    180177        int count;
    181178        int index;
    182         packet_map_ref map;
     179        packet_map_t *map;
    183180        packet_t packet;
    184181
     
    208205 * @param[in] order     The packet order value.
    209206 * @param[in] metric    The metric value of the packet.
    210  * @returns             EOK on success.
    211  * @returns             EINVAL if the first parameter is NULL.
    212  * @returns             EINVAL if the packet is not valid.
     207 * @return              EOK on success.
     208 * @return              EINVAL if the first parameter is NULL.
     209 * @return              EINVAL if the packet is not valid.
    213210 */
    214211int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric)
     
    252249 * @param[in] first     The first packet of the queue.
    253250 * @param[in] order     The packet order value.
    254  * @returns             The packet with the given order.
    255  * @returns             NULL if the first packet is not valid.
    256  * @returns             NULL if the packet is not found.
     251 * @return              The packet with the given order.
     252 * @return              NULL if the first packet is not valid.
     253 * @return              NULL if the packet is not found.
    257254 */
    258255packet_t pq_find(packet_t packet, size_t order)
     
    278275 * @param[in] packet    The packet in the queue.
    279276 * @param[in] new_packet The new packet to be inserted.
    280  * @returns             EOK on success.
    281  * @returns             EINVAL if etiher of the packets is invalid.
     277 * @return              EOK on success.
     278 * @return              EINVAL if etiher of the packets is invalid.
    282279 */
    283280int pq_insert_after(packet_t packet, packet_t new_packet)
     
    301298 *
    302299 * @param[in] packet    The packet to be detached.
    303  * @returns             The next packet in the queue. If the packet is the first
     300 * @return              The next packet in the queue. If the packet is the first
    304301 *                      one of the queue, this becomes the new first one.
    305  * @returns             NULL if there is no packet left.
    306  * @returns             NULL if the packet is not valid.
     302 * @return              NULL if there is no packet left.
     303 * @return              NULL if the packet is not valid.
    307304 */
    308305packet_t pq_detach(packet_t packet)
     
    331328 * @param[in] order     The packet order value.
    332329 * @param[in] metric    The metric value of the packet.
    333  * @returns             EOK on success.
    334  * @returns             EINVAL if the packet is invalid.
     330 * @return              EOK on success.
     331 * @return              EINVAL if the packet is invalid.
    335332 */
    336333int pq_set_order(packet_t packet, size_t order, size_t metric)
     
    349346 * @param[out] order    The packet order value.
    350347 * @param[out] metric   The metric value of the packet.
    351  * @returns             EOK on success.
    352  * @returns             EINVAL if the packet is invalid.
     348 * @return              EOK on success.
     349 * @return              EINVAL if the packet is invalid.
    353350 */
    354351int pq_get_order(packet_t packet, size_t *order, size_t *metric)
     
    394391 *
    395392 * @param[in] packet    The packet queue member.
    396  * @returns             The next packet in the queue.
    397  * @returns             NULL if there is no next packet.
    398  * @returns             NULL if the packet is not valid.
     393 * @return              The next packet in the queue.
     394 * @return              NULL if there is no next packet.
     395 * @return              NULL if the packet is not valid.
    399396 */
    400397packet_t pq_next(packet_t packet)
     
    409406 *
    410407 * @param[in] packet    The packet queue member.
    411  * @returns             The previous packet in the queue.
    412  * @returns             NULL if there is no previous packet.
    413  * @returns             NULL if the packet is not valid.
     408 * @return              The previous packet in the queue.
     409 * @return              NULL if there is no previous packet.
     410 * @return              NULL if the packet is not valid.
    414411 */
    415412packet_t pq_previous(packet_t packet)
  • uspace/lib/c/generic/net/socket_client.c

    rb4c9c61 rfdbc3ff  
    7979typedef struct socket socket_t;
    8080
    81 /** Type definition of the socket specific data pointer.
    82  * @see socket
    83  */
    84 typedef socket_t *socket_ref;
    85 
    8681/** Socket specific data.
    8782 *
     
    162157
    163158        /** Active sockets. */
    164         sockets_ref sockets;
     159        sockets_t *sockets;
    165160
    166161        /** Safety lock.
     
    183178/** Returns the active sockets.
    184179 *
    185  *  @returns            The active sockets.
    186  */
    187 static sockets_ref socket_get_sockets(void)
     180 *  @return             The active sockets.
     181 */
     182static sockets_t *socket_get_sockets(void)
    188183{
    189184        if (!socket_globals.sockets) {
    190185                socket_globals.sockets =
    191                     (sockets_ref) malloc(sizeof(sockets_t));
     186                    (sockets_t *) malloc(sizeof(sockets_t));
    192187                if (!socket_globals.sockets)
    193188                        return NULL;
     
    213208        ipc_callid_t callid;
    214209        ipc_call_t call;
    215         socket_ref socket;
     210        socket_t *socket;
    216211        int rc;
    217212
     
    291286 * Connects to the TCP module if necessary.
    292287 *
    293  * @returns             The TCP module phone.
    294  * @returns             Other error codes as defined for the
     288 * @return              The TCP module phone.
     289 * @return              Other error codes as defined for the
    295290 *                      bind_service_timeout() function.
    296291 */
     
    310305 * Connects to the UDP module if necessary.
    311306 *
    312  * @returns             The UDP module phone.
    313  * @returns             Other error codes as defined for the
     307 * @return              The UDP module phone.
     308 * @return              Other error codes as defined for the
    314309 *                      bind_service_timeout() function.
    315310 */
     
    327322/** Tries to find a new free socket identifier.
    328323 *
    329  * @returns             The new socket identifier.
    330  * @returns             ELIMIT if there is no socket identifier available.
     324 * @return              The new socket identifier.
     325 * @return              ELIMIT if there is no socket identifier available.
    331326 */
    332327static int socket_generate_new_id(void)
    333328{
    334         sockets_ref sockets;
     329        sockets_t *sockets;
    335330        int socket_id = 0;
    336331        int count;
     
    372367 */
    373368static void
    374 socket_initialize(socket_ref socket, int socket_id, int phone,
     369socket_initialize(socket_t *socket, int socket_id, int phone,
    375370    services_t service)
    376371{
     
    392387 * @param[in] type      Socket type.
    393388 * @param[in] protocol  Socket protocol.
    394  * @returns             The socket identifier on success.
    395  * @returns             EPFNOTSUPPORT if the protocol family is not supported.
    396  * @returns             ESOCKNOTSUPPORT if the socket type is not supported.
    397  * @returns             EPROTONOSUPPORT if the protocol is not supported.
    398  * @returns             ENOMEM if there is not enough memory left.
    399  * @returns             ELIMIT if there was not a free socket identifier found
     389 * @return              The socket identifier on success.
     390 * @return              EPFNOTSUPPORT if the protocol family is not supported.
     391 * @return              ESOCKNOTSUPPORT if the socket type is not supported.
     392 * @return              EPROTONOSUPPORT if the protocol is not supported.
     393 * @return              ENOMEM if there is not enough memory left.
     394 * @return              ELIMIT if there was not a free socket identifier found
    400395 *                      this time.
    401  * @returns             Other error codes as defined for the NET_SOCKET message.
    402  * @returns             Other error codes as defined for the
     396 * @return              Other error codes as defined for the NET_SOCKET message.
     397 * @return              Other error codes as defined for the
    403398 *                      bind_service_timeout() function.
    404399 */
    405400int socket(int domain, int type, int protocol)
    406401{
    407         socket_ref socket;
     402        socket_t *socket;
    408403        int phone;
    409404        int socket_id;
     
    463458
    464459        // create a new socket structure
    465         socket = (socket_ref) malloc(sizeof(socket_t));
     460        socket = (socket_t *) malloc(sizeof(socket_t));
    466461        if (!socket)
    467462                return ENOMEM;
     
    514509 * @param[in] data      The data to be sent.
    515510 * @param[in] datalength The data length.
    516  * @returns             EOK on success.
    517  * @returns             ENOTSOCK if the socket is not found.
    518  * @returns             EBADMEM if the data parameter is NULL.
    519  * @returns             NO_DATA if the datalength parameter is zero (0).
    520  * @returns             Other error codes as defined for the spcific message.
     511 * @return              EOK on success.
     512 * @return              ENOTSOCK if the socket is not found.
     513 * @return              EBADMEM if the data parameter is NULL.
     514 * @return              NO_DATA if the datalength parameter is zero (0).
     515 * @return              Other error codes as defined for the spcific message.
    521516 */
    522517static int
     
    524519    const void *data, size_t datalength)
    525520{
    526         socket_ref socket;
     521        socket_t *socket;
    527522        aid_t message_id;
    528523        ipcarg_t result;
     
    559554 * @param[in] my_addr   The port address.
    560555 * @param[in] addrlen   The address length.
    561  * @returns             EOK on success.
    562  * @returns             ENOTSOCK if the socket is not found.
    563  * @returns             EBADMEM if the my_addr parameter is NULL.
    564  * @returns             NO_DATA if the addlen parameter is zero.
    565  * @returns             Other error codes as defined for the NET_SOCKET_BIND
     556 * @return              EOK on success.
     557 * @return              ENOTSOCK if the socket is not found.
     558 * @return              EBADMEM if the my_addr parameter is NULL.
     559 * @return              NO_DATA if the addlen parameter is zero.
     560 * @return              Other error codes as defined for the NET_SOCKET_BIND
    566561 *                      message.
    567562 */
     
    580575 * @param[in] socket_id Socket identifier.
    581576 * @param[in] backlog   The maximum number of waiting sockets to be accepted.
    582  * @returns             EOK on success.
    583  * @returns             EINVAL if the backlog parameter is not positive (<=0).
    584  * @returns             ENOTSOCK if the socket is not found.
    585  * @returns             Other error codes as defined for the NET_SOCKET_LISTEN
     577 * @return              EOK on success.
     578 * @return              EINVAL if the backlog parameter is not positive (<=0).
     579 * @return              ENOTSOCK if the socket is not found.
     580 * @return              Other error codes as defined for the NET_SOCKET_LISTEN
    586581 *                      message.
    587582 */
    588583int listen(int socket_id, int backlog)
    589584{
    590         socket_ref socket;
     585        socket_t *socket;
    591586        int result;
    592587
     
    618613 * @param[out] cliaddr  The remote client address.
    619614 * @param[in] addrlen   The address length.
    620  * @returns             EOK on success.
    621  * @returns             EBADMEM if the cliaddr or addrlen parameter is NULL.
    622  * @returns             EINVAL if the backlog parameter is not positive (<=0).
    623  * @returns             ENOTSOCK if the socket is not found.
    624  * @returns             Other error codes as defined for the NET_SOCKET_ACCEPT
     615 * @return              EOK on success.
     616 * @return              EBADMEM if the cliaddr or addrlen parameter is NULL.
     617 * @return              EINVAL if the backlog parameter is not positive (<=0).
     618 * @return              ENOTSOCK if the socket is not found.
     619 * @return              Other error codes as defined for the NET_SOCKET_ACCEPT
    625620 *                      message.
    626621 */
    627622int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen)
    628623{
    629         socket_ref socket;
    630         socket_ref new_socket;
     624        socket_t *socket;
     625        socket_t *new_socket;
    631626        aid_t message_id;
    632627        ipcarg_t ipc_result;
     
    661656
    662657        // create a new scoket
    663         new_socket = (socket_ref) malloc(sizeof(socket_t));
     658        new_socket = (socket_t *) malloc(sizeof(socket_t));
    664659        if (!new_socket) {
    665660                fibril_mutex_unlock(&socket->accept_lock);
     
    721716 * @param[in] serv_addr The remote server address.
    722717 * @param[in] addrlen   The address length.
    723  * @returns             EOK on success.
    724  * @returns             EBADMEM if the serv_addr parameter is NULL.
    725  * @returns             NO_DATA if the addlen parameter is zero.
    726  * @returns             ENOTSOCK if the socket is not found.
    727  * @returns             Other error codes as defined for the NET_SOCKET_CONNECT
     718 * @return              EOK on success.
     719 * @return              EBADMEM if the serv_addr parameter is NULL.
     720 * @return              NO_DATA if the addlen parameter is zero.
     721 * @return              ENOTSOCK if the socket is not found.
     722 * @return              Other error codes as defined for the NET_SOCKET_CONNECT
    728723 *                      message.
    729724 */
     
    745740 * @param[in] socket    The socket to be destroyed.
    746741 */
    747 static void socket_destroy(socket_ref socket)
     742static void socket_destroy(socket_t *socket)
    748743{
    749744        int accepted_id;
     
    761756 *
    762757 * @param[in] socket_id Socket identifier.
    763  * @returns             EOK on success.
    764  * @returns             ENOTSOCK if the socket is not found.
    765  * @returns             EINPROGRESS if there is another blocking function in
     758 * @return              EOK on success.
     759 * @return              ENOTSOCK if the socket is not found.
     760 * @return              EINPROGRESS if there is another blocking function in
    766761 *                      progress.
    767  * @returns             Other error codes as defined for the NET_SOCKET_CLOSE
     762 * @return              Other error codes as defined for the NET_SOCKET_CLOSE
    768763 *                      message.
    769764 */
    770765int closesocket(int socket_id)
    771766{
    772         socket_ref socket;
     767        socket_t *socket;
    773768        int rc;
    774769
     
    811806 *                      sockets.
    812807 * @param[in] addrlen   The address length. Used only if toaddr is not NULL.
    813  * @returns             EOK on success.
    814  * @returns             ENOTSOCK if the socket is not found.
    815  * @returns             EBADMEM if the data or toaddr parameter is NULL.
    816  * @returns             NO_DATA if the datalength or the addrlen parameter is
     808 * @return              EOK on success.
     809 * @return              ENOTSOCK if the socket is not found.
     810 * @return              EBADMEM if the data or toaddr parameter is NULL.
     811 * @return              NO_DATA if the datalength or the addrlen parameter is
    817812 *                      zero (0).
    818  * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
     813 * @return              Other error codes as defined for the NET_SOCKET_SENDTO
    819814 *                      message.
    820815 */
     
    824819    socklen_t addrlen)
    825820{
    826         socket_ref socket;
     821        socket_t *socket;
    827822        aid_t message_id;
    828823        ipcarg_t result;
     
    913908 * @param[in] datalength The data length.
    914909 * @param[in] flags     Various send flags.
    915  * @returns             EOK on success.
    916  * @returns             ENOTSOCK if the socket is not found.
    917  * @returns             EBADMEM if the data parameter is NULL.
    918  * @returns             NO_DATA if the datalength parameter is zero.
    919  * @returns             Other error codes as defined for the NET_SOCKET_SEND
     910 * @return              EOK on success.
     911 * @return              ENOTSOCK if the socket is not found.
     912 * @return              EBADMEM if the data parameter is NULL.
     913 * @return              NO_DATA if the datalength parameter is zero.
     914 * @return              Other error codes as defined for the NET_SOCKET_SEND
    920915 *                      message.
    921916 */
     
    937932 * @param[in] toaddr    The destination address.
    938933 * @param[in] addrlen   The address length.
    939  * @returns             EOK on success.
    940  * @returns             ENOTSOCK if the socket is not found.
    941  * @returns             EBADMEM if the data or toaddr parameter is NULL.
    942  * @returns             NO_DATA if the datalength or the addrlen parameter is
     934 * @return              EOK on success.
     935 * @return              ENOTSOCK if the socket is not found.
     936 * @return              EBADMEM if the data or toaddr parameter is NULL.
     937 * @return              NO_DATA if the datalength or the addrlen parameter is
    943938 *                      zero.
    944  * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
     939 * @return              Other error codes as defined for the NET_SOCKET_SENDTO
    945940 *                      message.
    946941 */
     
    971966 *                      read. The actual address length is set. Used only if
    972967 *                      fromaddr is not NULL.
    973  * @returns             EOK on success.
    974  * @returns             ENOTSOCK if the socket is not found.
    975  * @returns             EBADMEM if the data parameter is NULL.
    976  * @returns             NO_DATA if the datalength or addrlen parameter is zero.
    977  * @returns             Other error codes as defined for the spcific message.
     968 * @return              EOK on success.
     969 * @return              ENOTSOCK if the socket is not found.
     970 * @return              EBADMEM if the data parameter is NULL.
     971 * @return              NO_DATA if the datalength or addrlen parameter is zero.
     972 * @return              Other error codes as defined for the spcific message.
    978973 */
    979974static int
     
    981976    int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
    982977{
    983         socket_ref socket;
     978        socket_t *socket;
    984979        aid_t message_id;
    985980        ipcarg_t ipc_result;
     
    11001095 * @param[in] datalength The data length.
    11011096 * @param[in] flags     Various receive flags.
    1102  * @returns             EOK on success.
    1103  * @returns             ENOTSOCK if the socket is not found.
    1104  * @returns             EBADMEM if the data parameter is NULL.
    1105  * @returns             NO_DATA if the datalength parameter is zero.
    1106  * @returns             Other error codes as defined for the NET_SOCKET_RECV
     1097 * @return              EOK on success.
     1098 * @return              ENOTSOCK if the socket is not found.
     1099 * @return              EBADMEM if the data parameter is NULL.
     1100 * @return              NO_DATA if the datalength parameter is zero.
     1101 * @return              Other error codes as defined for the NET_SOCKET_RECV
    11071102 *                      message.
    11081103 */
     
    11231118 * @param[in,out] addrlen The address length. The maximum address length is
    11241119 *                      read. The actual address length is set.
    1125  * @returns             EOK on success.
    1126  * @returns             ENOTSOCK if the socket is not found.
    1127  * @returns             EBADMEM if the data or fromaddr parameter is NULL.
    1128  * @returns             NO_DATA if the datalength or addrlen parameter is zero.
    1129  * @returns             Other error codes as defined for the NET_SOCKET_RECVFROM
     1120 * @return              EOK on success.
     1121 * @return              ENOTSOCK if the socket is not found.
     1122 * @return              EBADMEM if the data or fromaddr parameter is NULL.
     1123 * @return              NO_DATA if the datalength or addrlen parameter is zero.
     1124 * @return              Other error codes as defined for the NET_SOCKET_RECVFROM
    11301125 *                      message.
    11311126 */
     
    11531148 * @param[in,out] optlen The value buffer length. The maximum length is read.
    11541149 *                      The actual length is set.
    1155  * @returns             EOK on success.
    1156  * @returns             ENOTSOCK if the socket is not found.
    1157  * @returns             EBADMEM if the value or optlen parameter is NULL.
    1158  * @returns             NO_DATA if the optlen parameter is zero.
    1159  * @returns             Other error codes as defined for the
     1150 * @return              EOK on success.
     1151 * @return              ENOTSOCK if the socket is not found.
     1152 * @return              EBADMEM if the value or optlen parameter is NULL.
     1153 * @return              NO_DATA if the optlen parameter is zero.
     1154 * @return              Other error codes as defined for the
    11601155 *                      NET_SOCKET_GETSOCKOPT message.
    11611156 */
     
    11631158getsockopt(int socket_id, int level, int optname, void *value, size_t *optlen)
    11641159{
    1165         socket_ref socket;
     1160        socket_t *socket;
    11661161        aid_t message_id;
    11671162        ipcarg_t result;
     
    12061201 * @param[in] value     The value to be set.
    12071202 * @param[in] optlen    The value length.
    1208  * @returns             EOK on success.
    1209  * @returns             ENOTSOCK if the socket is not found.
    1210  * @returns             EBADMEM if the value parameter is NULL.
    1211  * @returns             NO_DATA if the optlen parameter is zero.
    1212  * @returns             Other error codes as defined for the
     1203 * @return              EOK on success.
     1204 * @return              ENOTSOCK if the socket is not found.
     1205 * @return              EBADMEM if the value parameter is NULL.
     1206 * @return              NO_DATA if the optlen parameter is zero.
     1207 * @return              Other error codes as defined for the
    12131208 *                      NET_SOCKET_SETSOCKOPT message.
    12141209 */
  • uspace/lib/c/generic/vfs/vfs.c

    rb4c9c61 rfdbc3ff  
    136136        }
    137137       
    138         dev_handle_t dev_handle;
    139         int res = devmap_device_get_handle(fqdn, &dev_handle, flags);
     138        devmap_handle_t devmap_handle;
     139        int res = devmap_device_get_handle(fqdn, &devmap_handle, flags);
    140140        if (res != EOK) {
    141141                if (null_id != -1)
     
    159159       
    160160        ipcarg_t rc_orig;
    161         aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
     161        aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, devmap_handle, flags, NULL);
    162162        ipcarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
    163163        if (rc != EOK) {
     
    328328        ipc_call_t answer;
    329329        aid_t req = async_send_4(vfs_phone, VFS_IN_OPEN_NODE, node->fs_handle,
    330             node->dev_handle, node->index, oflag, &answer);
     330            node->devmap_handle, node->index, oflag, &answer);
    331331       
    332332        ipcarg_t rc;
     
    797797        if (rc == EOK) {
    798798                node->fs_handle = stat.fs_handle;
    799                 node->dev_handle = stat.dev_handle;
     799                node->devmap_handle = stat.devmap_handle;
    800800                node->index = stat.index;
    801801        }
  • uspace/lib/c/include/adt/char_map.h

    rb4c9c61 rfdbc3ff  
    4848typedef struct char_map char_map_t;
    4949
    50 /** Type definition of the character string to integer map pointer.
    51  *  @see char_map
    52  */
    53 typedef char_map_t *char_map_ref;
    54 
    5550/** Character string to integer map item.
    5651 *
     
    6964        int next;
    7065        /** Next character array. */
    71         char_map_ref *items;
     66        char_map_t **items;
    7267        /** Consistency check magic value. */
    7368        int magic;
    7469};
    7570
    76 extern int char_map_initialize(char_map_ref);
    77 extern void char_map_destroy(char_map_ref);
    78 extern int char_map_exclude(char_map_ref, const char *, size_t);
    79 extern int char_map_add(char_map_ref, const char *, size_t, const int);
    80 extern int char_map_find(const char_map_ref, const char *, size_t);
    81 extern int char_map_update(char_map_ref, const char *, size_t, const int);
     71extern int char_map_initialize(char_map_t *);
     72extern void char_map_destroy(char_map_t *);
     73extern int char_map_exclude(char_map_t *, const char *, size_t);
     74extern int char_map_add(char_map_t *, const char *, size_t, const int);
     75extern int char_map_find(const char_map_t *, const char *, size_t);
     76extern int char_map_update(char_map_t *, const char *, size_t, const int);
    8277
    8378#endif
  • uspace/lib/c/include/adt/dynamic_fifo.h

    rb4c9c61 rfdbc3ff  
    4444typedef struct dyn_fifo dyn_fifo_t;
    4545
    46 /** Type definition of the dynamic fifo queue pointer.
    47  *  @see dyn_fifo
    48  */
    49 typedef dyn_fifo_t *dyn_fifo_ref;
    50 
    5146/** Dynamic first in first out positive integer queue.
    5247 * Possitive integer values only.
     
    6661};
    6762
    68 extern int dyn_fifo_initialize(dyn_fifo_ref, int);
    69 extern int dyn_fifo_destroy(dyn_fifo_ref);
    70 extern int dyn_fifo_push(dyn_fifo_ref, int, int);
    71 extern int dyn_fifo_pop(dyn_fifo_ref);
    72 extern int dyn_fifo_value(dyn_fifo_ref);
     63extern int dyn_fifo_initialize(dyn_fifo_t *, int);
     64extern int dyn_fifo_destroy(dyn_fifo_t *);
     65extern int dyn_fifo_push(dyn_fifo_t *, int, int);
     66extern int dyn_fifo_pop(dyn_fifo_t *);
     67extern int dyn_fifo_value(dyn_fifo_t *);
    7368
    7469#endif
  • uspace/lib/c/include/adt/generic_char_map.h

    rb4c9c61 rfdbc3ff  
    5555        \
    5656        typedef struct name name##_t; \
    57         typedef name##_t *name##_ref; \
    5857        \
    5958        struct  name { \
     
    6362        }; \
    6463        \
    65         int name##_add(name##_ref, const char *, const size_t, type *); \
    66         int name##_count(name##_ref); \
    67         void name##_destroy(name##_ref); \
    68         void name##_exclude(name##_ref, const char *, const size_t); \
    69         type *name##_find(name##_ref, const char *, const size_t); \
    70         int name##_initialize(name##_ref); \
    71         int name##_is_valid(name##_ref);
     64        int name##_add(name##_t *, const char *, const size_t, type *); \
     65        int name##_count(name##_t *); \
     66        void name##_destroy(name##_t *); \
     67        void name##_exclude(name##_t *, const char *, const size_t); \
     68        type *name##_find(name##_t *, const char *, const size_t); \
     69        int name##_initialize(name##_t *); \
     70        int name##_is_valid(name##_t *);
    7271
    7372/** Character string to generic type map implementation.
     
    8180        GENERIC_FIELD_IMPLEMENT(name##_items, type) \
    8281        \
    83         int name##_add(name##_ref map, const char *name, const size_t length, \
     82        int name##_add(name##_t *map, const char *name, const size_t length, \
    8483             type *value) \
    8584        { \
     
    9998        } \
    10099        \
    101         int name##_count(name##_ref map) \
     100        int name##_count(name##_t *map) \
    102101        { \
    103102                return name##_is_valid(map) ? \
     
    105104        } \
    106105        \
    107         void name##_destroy(name##_ref map) \
     106        void name##_destroy(name##_t *map) \
    108107        { \
    109108                if (name##_is_valid(map)) { \
     
    113112        } \
    114113        \
    115         void name##_exclude(name##_ref map, const char *name, \
     114        void name##_exclude(name##_t *map, const char *name, \
    116115            const size_t length) \
    117116        { \
     
    125124        } \
    126125        \
    127         type *name##_find(name##_ref map, const char *name, \
     126        type *name##_find(name##_t *map, const char *name, \
    128127            const size_t length) \
    129128        { \
     
    138137        } \
    139138        \
    140         int name##_initialize(name##_ref map) \
     139        int name##_initialize(name##_t *map) \
    141140        { \
    142141                int rc; \
     
    155154        } \
    156155        \
    157         int name##_is_valid(name##_ref map) \
     156        int name##_is_valid(name##_t *map) \
    158157        { \
    159158                return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/generic_field.h

    rb4c9c61 rfdbc3ff  
    5353#define GENERIC_FIELD_DECLARE(name, type) \
    5454        typedef struct name name##_t; \
    55         typedef name##_t *name##_ref; \
    5655        \
    5756        struct  name { \
     
    6261        }; \
    6362        \
    64         int name##_add(name##_ref, type *); \
    65         int name##_count(name##_ref); \
    66         void name##_destroy(name##_ref); \
    67         void name##_exclude_index(name##_ref, int); \
    68         type **name##_get_field(name##_ref); \
    69         type *name##_get_index(name##_ref, int); \
    70         int name##_initialize(name##_ref); \
    71         int name##_is_valid(name##_ref);
     63        int name##_add(name##_t *, type *); \
     64        int name##_count(name##_t *); \
     65        void name##_destroy(name##_t *); \
     66        void name##_exclude_index(name##_t *, int); \
     67        type **name##_get_field(name##_t *); \
     68        type *name##_get_index(name##_t *, int); \
     69        int name##_initialize(name##_t *); \
     70        int name##_is_valid(name##_t *);
    7271
    7372/** Generic type field implementation.
     
    7978 */
    8079#define GENERIC_FIELD_IMPLEMENT(name, type) \
    81         int name##_add(name##_ref field, type *value) \
     80        int name##_add(name##_t *field, type *value) \
    8281        { \
    8382                if (name##_is_valid(field)) { \
     
    9998        } \
    10099        \
    101         int name##_count(name##_ref field) \
     100        int name##_count(name##_t *field) \
    102101        { \
    103102                return name##_is_valid(field) ? field->next : -1; \
    104103        } \
    105104        \
    106         void name##_destroy(name##_ref field) \
     105        void name##_destroy(name##_t *field) \
    107106        { \
    108107                if (name##_is_valid(field)) { \
     
    117116        } \
    118117         \
    119         void name##_exclude_index(name##_ref field, int index) \
     118        void name##_exclude_index(name##_t *field, int index) \
    120119        { \
    121120                if (name##_is_valid(field) && (index >= 0) && \
     
    126125        } \
    127126         \
    128         type *name##_get_index(name##_ref field, int index) \
     127        type *name##_get_index(name##_t *field, int index) \
    129128        { \
    130129                if (name##_is_valid(field) && (index >= 0) && \
     
    134133        } \
    135134        \
    136         type **name##_get_field(name##_ref field) \
     135        type **name##_get_field(name##_t *field) \
    137136        { \
    138137                return name##_is_valid(field) ? field->items : NULL; \
    139138        } \
    140139        \
    141         int name##_initialize(name##_ref field) \
     140        int name##_initialize(name##_t *field) \
    142141        { \
    143142                if (!field) \
     
    153152        } \
    154153        \
    155         int name##_is_valid(name##_ref field) \
     154        int name##_is_valid(name##_t *field) \
    156155        { \
    157156                return field && (field->magic == GENERIC_FIELD_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/int_map.h

    rb4c9c61 rfdbc3ff  
    5656#define INT_MAP_DECLARE(name, type) \
    5757        typedef struct name name##_t; \
    58         typedef name##_t *name##_ref; \
    5958        typedef struct name##_item name##_item_t; \
    60         typedef name##_item_t *name##_item_ref; \
    6159        \
    6260        struct  name##_item { \
     
    6967                int size; \
    7068                int next; \
    71                 name##_item_ref items; \
     69                name##_item_t *items; \
    7270                int magic; \
    7371        }; \
    7472        \
    75         int name##_add(name##_ref, int, type *); \
    76         void name##_clear(name##_ref); \
    77         int name##_count(name##_ref); \
    78         void name##_destroy(name##_ref); \
    79         void name##_exclude(name##_ref, int); \
    80         void name##_exclude_index(name##_ref, int); \
    81         type *name##_find(name##_ref, int); \
    82         int name##_update(name##_ref, int, int); \
    83         type *name##_get_index(name##_ref, int); \
    84         int name##_initialize(name##_ref); \
    85         int name##_is_valid(name##_ref); \
    86         void name##_item_destroy(name##_item_ref); \
    87         int name##_item_is_valid(name##_item_ref);
     73        int name##_add(name##_t *, int, type *); \
     74        void name##_clear(name##_t *); \
     75        int name##_count(name##_t *); \
     76        void name##_destroy(name##_t *); \
     77        void name##_exclude(name##_t *, int); \
     78        void name##_exclude_index(name##_t *, int); \
     79        type *name##_find(name##_t *, int); \
     80        int name##_update(name##_t *, int, int); \
     81        type *name##_get_index(name##_t *, int); \
     82        int name##_initialize(name##_t *); \
     83        int name##_is_valid(name##_t *); \
     84        void name##_item_destroy(name##_item_t *); \
     85        int name##_item_is_valid(name##_item_t *);
    8886
    8987/** Integer to generic type map implementation.
     
    9593 */
    9694#define INT_MAP_IMPLEMENT(name, type) \
    97         int name##_add(name##_ref map, int key, type *value) \
     95        int name##_add(name##_t *map, int key, type *value) \
    9896        { \
    9997                if (name##_is_valid(map)) { \
    10098                        if (map->next == (map->size - 1)) { \
    101                                 name##_item_ref tmp; \
    102                                 tmp = (name##_item_ref) realloc(map->items, \
     99                                name##_item_t *tmp; \
     100                                tmp = (name##_item_t *) realloc(map->items, \
    103101                                    sizeof(name##_item_t) * 2 * map->size); \
    104102                                if (!tmp) \
     
    117115        } \
    118116        \
    119         void name##_clear(name##_ref map) \
     117        void name##_clear(name##_t *map) \
    120118        { \
    121119                if (name##_is_valid(map)) { \
     
    132130        } \
    133131        \
    134         int name##_count(name##_ref map) \
     132        int name##_count(name##_t *map) \
    135133        { \
    136134                return name##_is_valid(map) ? map->next : -1; \
    137135        } \
    138136        \
    139         void name##_destroy(name##_ref map) \
     137        void name##_destroy(name##_t *map) \
    140138        { \
    141139                if (name##_is_valid(map)) { \
     
    152150        } \
    153151        \
    154         void name##_exclude(name##_ref map, int key) \
     152        void name##_exclude(name##_t *map, int key) \
    155153        { \
    156154                if (name##_is_valid(map)) { \
     
    166164        } \
    167165        \
    168         void name##_exclude_index(name##_ref map, int index) \
     166        void name##_exclude_index(name##_t *map, int index) \
    169167        { \
    170168                if (name##_is_valid(map) && (index >= 0) && \
     
    175173        } \
    176174        \
    177         type *name##_find(name##_ref map, int key) \
     175        type *name##_find(name##_t *map, int key) \
    178176        { \
    179177                if (name##_is_valid(map)) { \
     
    189187        } \
    190188        \
    191         int name##_update(name##_ref map, int key, int new_key) \
     189        int name##_update(name##_t *map, int key, int new_key) \
    192190        { \
    193191                if (name##_is_valid(map)) { \
     
    208206        } \
    209207        \
    210         type *name##_get_index(name##_ref map, int index) \
     208        type *name##_get_index(name##_t *map, int index) \
    211209        { \
    212210                if (name##_is_valid(map) && (index >= 0) && \
     
    218216        } \
    219217        \
    220         int name##_initialize(name##_ref map) \
     218        int name##_initialize(name##_t *map) \
    221219        { \
    222220                if (!map) \
     
    224222                map->size = 2; \
    225223                map->next = 0; \
    226                 map->items = (name##_item_ref) malloc(sizeof(name##_item_t) * \
     224                map->items = (name##_item_t *) malloc(sizeof(name##_item_t) * \
    227225                    map->size); \
    228226                if (!map->items) \
     
    233231        } \
    234232        \
    235         int name##_is_valid(name##_ref map) \
     233        int name##_is_valid(name##_t *map) \
    236234        { \
    237235                return map && (map->magic == INT_MAP_MAGIC_VALUE); \
    238236        } \
    239237        \
    240         void name##_item_destroy(name##_item_ref item) \
     238        void name##_item_destroy(name##_item_t *item) \
    241239        { \
    242240                if (name##_item_is_valid(item)) { \
     
    249247        } \
    250248        \
    251         int name##_item_is_valid(name##_item_ref item) \
     249        int name##_item_is_valid(name##_item_t *item) \
    252250        { \
    253251                return item && (item->magic == INT_MAP_ITEM_MAGIC_VALUE); \
  • uspace/lib/c/include/adt/measured_strings.h

    rb4c9c61 rfdbc3ff  
    4747typedef struct measured_string measured_string_t;
    4848
    49 /** Type definition of the character string with measured length pointer.
    50  * @see measured_string
    51  */
    52 typedef measured_string_t *measured_string_ref;
    53 
    5449/** Character string with measured length.
    5550 *
     
    6459};
    6560
    66 extern measured_string_ref measured_string_create_bulk(const char *, size_t);
    67 extern measured_string_ref measured_string_copy(measured_string_ref);
    68 extern int measured_strings_receive(measured_string_ref *, char **, size_t);
    69 extern int measured_strings_reply(const measured_string_ref, size_t);
    70 extern int measured_strings_return(int, measured_string_ref *, char **, size_t);
    71 extern int measured_strings_send(int, const measured_string_ref, size_t);
     61extern measured_string_t *measured_string_create_bulk(const char *, size_t);
     62extern measured_string_t *measured_string_copy(measured_string_t *);
     63extern int measured_strings_receive(measured_string_t **, char **, size_t);
     64extern int measured_strings_reply(const measured_string_t *, size_t);
     65extern int measured_strings_return(int, measured_string_t **, char **, size_t);
     66extern int measured_strings_send(int, const measured_string_t *, size_t);
    7267
    7368#endif
  • uspace/lib/c/include/devman.h

    rb4c9c61 rfdbc3ff  
    4242
    4343
    44 int devman_get_phone(devman_interface_t, unsigned int);
    45 void devman_hangup_phone(devman_interface_t iface);
     44extern int devman_get_phone(devman_interface_t, unsigned int);
     45extern void devman_hangup_phone(devman_interface_t);
    4646
    47 int devman_driver_register(const char *, async_client_conn_t);
    48 int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *);
     47extern int devman_driver_register(const char *, async_client_conn_t);
     48extern int devman_child_device_register(const char *, match_id_list_t *,
     49    devman_handle_t, devman_handle_t *);
    4950
    50 int devman_device_connect(device_handle_t handle, unsigned int flags);
    51 int devman_parent_device_connect(device_handle_t handle, unsigned int flags);
     51extern int devman_device_connect(devman_handle_t, unsigned int);
     52extern int devman_parent_device_connect(devman_handle_t, unsigned int);
    5253
    53 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags);
     54extern int devman_device_get_handle(const char *, devman_handle_t *,
     55    unsigned int);
    5456
    55 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name);
     57extern int devman_add_device_to_class(devman_handle_t, const char *);
    5658
    5759#endif
  • uspace/lib/c/include/devmap.h

    rb4c9c61 rfdbc3ff  
    4444
    4545extern int devmap_driver_register(const char *, async_client_conn_t);
    46 extern int devmap_device_register(const char *, dev_handle_t *);
     46extern int devmap_device_register(const char *, devmap_handle_t *);
    4747
    48 extern int devmap_device_get_handle(const char *, dev_handle_t *, unsigned int);
    49 extern int devmap_namespace_get_handle(const char *, dev_handle_t *, unsigned int);
    50 extern devmap_handle_type_t devmap_handle_probe(dev_handle_t);
     48extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
     49extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int);
     50extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t);
    5151
    52 extern int devmap_device_connect(dev_handle_t, unsigned int);
     52extern int devmap_device_connect(devmap_handle_t, unsigned int);
    5353
    5454extern int devmap_null_create(void);
     
    5656
    5757extern size_t devmap_count_namespaces(void);
    58 extern size_t devmap_count_devices(dev_handle_t);
     58extern size_t devmap_count_devices(devmap_handle_t);
    5959
    6060extern size_t devmap_get_namespaces(dev_desc_t **);
    61 extern size_t devmap_get_devices(dev_handle_t, dev_desc_t **);
     61extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **);
    6262
    6363#endif
  • uspace/lib/c/include/ipc/devman.h

    rb4c9c61 rfdbc3ff  
    4242#define DEVMAN_NAME_MAXLEN 256
    4343
    44 typedef ipcarg_t device_handle_t;
     44typedef ipcarg_t devman_handle_t;
    4545
    4646/** Ids of device models used for device-to-driver matching.
  • uspace/lib/c/include/ipc/devmap.h

    rb4c9c61 rfdbc3ff  
    4040#define DEVMAP_NAME_MAXLEN  255
    4141
    42 typedef ipcarg_t dev_handle_t;
     42typedef ipcarg_t devmap_handle_t;
    4343
    4444typedef enum {
     
    8181
    8282typedef struct {
    83         dev_handle_t handle;
     83        devmap_handle_t handle;
    8484        char name[DEVMAP_NAME_MAXLEN + 1];
    8585} dev_desc_t;
  • uspace/lib/c/include/net/device.h

    rb4c9c61 rfdbc3ff  
    5959 */
    6060typedef struct device_stats device_stats_t;
    61 
    62 /** Type definition of the device usage statistics pointer.
    63  * @see device_stats
    64  */
    65 typedef device_stats_t *device_stats_ref;
    6661
    6762/** Device state. */
  • uspace/lib/c/include/net/modules.h

    rb4c9c61 rfdbc3ff  
    6969 *
    7070 * @param[in] need      The needed module service.
    71  * @returns             The phone of the needed service.
     71 * @return              The phone of the needed service.
    7272 */
    7373typedef int connect_module_t(services_t need);
  • uspace/lib/c/include/net/packet.h

    rb4c9c61 rfdbc3ff  
    4848typedef struct packet * packet_t;
    4949
    50 /** Type definition of the packet pointer.
    51  * @see packet
    52  */
    53 typedef packet_t * packet_ref;
    54 
    5550/** Type definition of the packet dimension.
    5651 * @see packet_dimension
    5752 */
    5853typedef struct packet_dimension packet_dimension_t;
    59 
    60 /** Type definition of the packet dimension pointer.
    61  * @see packet_dimension
    62  */
    63 typedef packet_dimension_t * packet_dimension_ref;
    6454
    6555/** Packet dimension. */
  • uspace/lib/c/include/net/packet_header.h

    rb4c9c61 rfdbc3ff  
    124124/** Returns whether the packet is valid.
    125125 * @param[in] packet    The packet to be checked.
    126  * @returns             True if the packet is not NULL and the magic value is
     126 * @return              True if the packet is not NULL and the magic value is
    127127 *                      correct.
    128  * @returns             False otherwise.
     128 * @return              False otherwise.
    129129 */
    130130static inline int packet_is_valid(const packet_t packet)
  • uspace/lib/c/include/sys/stat.h

    rb4c9c61 rfdbc3ff  
    4343struct stat {
    4444        fs_handle_t fs_handle;
    45         dev_handle_t dev_handle;
     45        devmap_handle_t devmap_handle;
    4646        fs_index_t index;
    4747        unsigned int lnkcnt;
     
    4949        bool is_directory;
    5050        aoff64_t size;
    51         dev_handle_t device;
     51        devmap_handle_t device;
    5252};
    5353
  • uspace/lib/c/include/unistd.h

    rb4c9c61 rfdbc3ff  
    4141
    4242#ifndef NULL
    43         #define NULL  0
     43        #define NULL  0UL
    4444#endif
    4545
  • uspace/lib/c/include/vfs/vfs.h

    rb4c9c61 rfdbc3ff  
    4747typedef struct {
    4848        fs_handle_t fs_handle;
    49         dev_handle_t dev_handle;
     49        devmap_handle_t devmap_handle;
    5050        fs_index_t index;
    5151} fdi_node_t;
  • uspace/lib/drv/generic/driver.c

    rb4c9c61 rfdbc3ff  
    139139}
    140140
    141 static device_t * driver_get_device(link_t *devices, device_handle_t handle)
     141static device_t * driver_get_device(link_t *devices, devman_handle_t handle)
    142142{
    143143        device_t *dev = NULL;
     
    163163        int res = EOK;
    164164       
    165         device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
     165        devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
    166166        device_t *dev = create_device();
    167167        dev->handle = dev_handle;
     
    221221         * the device to which the client connected.
    222222         */
    223         device_handle_t handle = IPC_GET_ARG2(*icall);
     223        devman_handle_t handle = IPC_GET_ARG2(*icall);
    224224        device_t *dev = driver_get_device(&devices, handle);
    225225
  • uspace/lib/drv/include/driver.h

    rb4c9c61 rfdbc3ff  
    118118         * device manager).
    119119         */
    120         device_handle_t handle;
     120        devman_handle_t handle;
    121121       
    122122        /**
  • uspace/lib/fs/libfs.c

    rb4c9c61 rfdbc3ff  
    150150    ipc_call_t *request)
    151151{
    152         dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     152        devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    153153        fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request);
    154154        fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*request);
    155         dev_handle_t mr_dev_handle = (dev_handle_t) IPC_GET_ARG4(*request);
     155        devmap_handle_t mr_devmap_handle = (devmap_handle_t) IPC_GET_ARG4(*request);
    156156        int res;
    157157        ipcarg_t rc;
     
    174174       
    175175        fs_node_t *fn;
    176         res = ops->node_get(&fn, mp_dev_handle, mp_fs_index);
     176        res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
    177177        if ((res != EOK) || (!fn)) {
    178178                ipc_hangup(mountee_phone);
     
    201201        ipc_call_t answer;
    202202        rc = async_data_write_forward_1_1(mountee_phone, VFS_OUT_MOUNTED,
    203             mr_dev_handle, &answer);
     203            mr_devmap_handle, &answer);
    204204       
    205205        if (rc == EOK) {
    206206                fn->mp_data.mp_active = true;
    207207                fn->mp_data.fs_handle = mr_fs_handle;
    208                 fn->mp_data.dev_handle = mr_dev_handle;
     208                fn->mp_data.devmap_handle = mr_devmap_handle;
    209209                fn->mp_data.phone = mountee_phone;
    210210        }
     
    219219void libfs_unmount(libfs_ops_t *ops, ipc_callid_t rid, ipc_call_t *request)
    220220{
    221         dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     221        devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    222222        fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request);
    223223        fs_node_t *fn;
    224224        int res;
    225225
    226         res = ops->node_get(&fn, mp_dev_handle, mp_fs_index);
     226        res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
    227227        if ((res != EOK) || (!fn)) {
    228228                ipc_answer_0(rid, combine_rc(res, ENOENT));
     
    243243         */
    244244        res = async_req_1_0(fn->mp_data.phone, VFS_OUT_UNMOUNTED,
    245             fn->mp_data.dev_handle);
     245            fn->mp_data.devmap_handle);
    246246
    247247        /*
     
    252252                fn->mp_data.mp_active = false;
    253253                fn->mp_data.fs_handle = 0;
    254                 fn->mp_data.dev_handle = 0;
     254                fn->mp_data.devmap_handle = 0;
    255255                fn->mp_data.phone = 0;
    256256                /* Drop the reference created in libfs_mount(). */
     
    281281        unsigned int last = IPC_GET_ARG2(*request);
    282282        unsigned int next = first;
    283         dev_handle_t dev_handle = IPC_GET_ARG3(*request);
     283        devmap_handle_t devmap_handle = IPC_GET_ARG3(*request);
    284284        int lflag = IPC_GET_ARG4(*request);
    285285        fs_index_t index = IPC_GET_ARG5(*request);
     
    295295        fs_node_t *tmp = NULL;
    296296       
    297         rc = ops->root_get(&cur, dev_handle);
     297        rc = ops->root_get(&cur, devmap_handle);
    298298        on_error(rc, goto out_with_answer);
    299299       
    300300        if (cur->mp_data.mp_active) {
    301301                ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
    302                     next, last, cur->mp_data.dev_handle, lflag, index,
     302                    next, last, cur->mp_data.devmap_handle, lflag, index,
    303303                    IPC_FF_ROUTE_FROM_ME);
    304304                (void) ops->node_put(cur);
     
    358358                       
    359359                        ipc_forward_slow(rid, tmp->mp_data.phone,
    360                             VFS_OUT_LOOKUP, next, last, tmp->mp_data.dev_handle,
     360                            VFS_OUT_LOOKUP, next, last, tmp->mp_data.devmap_handle,
    361361                            lflag, index, IPC_FF_ROUTE_FROM_ME);
    362362                        (void) ops->node_put(cur);
     
    385385                                fs_node_t *fn;
    386386                                if (lflag & L_CREATE)
    387                                         rc = ops->create(&fn, dev_handle,
     387                                        rc = ops->create(&fn, devmap_handle,
    388388                                            lflag);
    389389                                else
    390                                         rc = ops->node_get(&fn, dev_handle,
     390                                        rc = ops->node_get(&fn, devmap_handle,
    391391                                            index);
    392392                                on_error(rc, goto out_with_answer);
     
    401401                                                aoff64_t size = ops->size_get(fn);
    402402                                                ipc_answer_5(rid, fs_handle,
    403                                                     dev_handle,
     403                                                    devmap_handle,
    404404                                                    ops->index_get(fn),
    405405                                                    LOWER32(size),
     
    469469                        fs_node_t *fn;
    470470                        if (lflag & L_CREATE)
    471                                 rc = ops->create(&fn, dev_handle, lflag);
     471                                rc = ops->create(&fn, devmap_handle, lflag);
    472472                        else
    473                                 rc = ops->node_get(&fn, dev_handle, index);
     473                                rc = ops->node_get(&fn, devmap_handle, index);
    474474                        on_error(rc, goto out_with_answer);
    475475                       
     
    483483                                        aoff64_t size = ops->size_get(fn);
    484484                                        ipc_answer_5(rid, fs_handle,
    485                                             dev_handle,
     485                                            devmap_handle,
    486486                                            ops->index_get(fn),
    487487                                            LOWER32(size),
     
    509509                if (rc == EOK) {
    510510                        aoff64_t size = ops->size_get(cur);
    511                         ipc_answer_5(rid, fs_handle, dev_handle,
     511                        ipc_answer_5(rid, fs_handle, devmap_handle,
    512512                            ops->index_get(cur), LOWER32(size), UPPER32(size),
    513513                            old_lnkcnt);
     
    547547                if (rc == EOK) {
    548548                        aoff64_t size = ops->size_get(cur);
    549                         ipc_answer_5(rid, fs_handle, dev_handle,
     549                        ipc_answer_5(rid, fs_handle, devmap_handle,
    550550                            ops->index_get(cur), LOWER32(size), UPPER32(size),
    551551                            ops->lnkcnt_get(cur));
     
    571571    ipc_call_t *request)
    572572{
    573         dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     573        devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    574574        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    575575       
    576576        fs_node_t *fn;
    577         int rc = ops->node_get(&fn, dev_handle, index);
     577        int rc = ops->node_get(&fn, devmap_handle, index);
    578578        on_error(rc, answer_and_return(rid, rc));
    579579       
     
    592592       
    593593        stat.fs_handle = fs_handle;
    594         stat.dev_handle = dev_handle;
     594        stat.devmap_handle = devmap_handle;
    595595        stat.index = index;
    596596        stat.lnkcnt = ops->lnkcnt_get(fn);
     
    617617    ipc_call_t *request)
    618618{
    619         dev_handle_t dev_handle = IPC_GET_ARG1(*request);
     619        devmap_handle_t devmap_handle = IPC_GET_ARG1(*request);
    620620        fs_index_t index = IPC_GET_ARG2(*request);
    621621       
    622622        fs_node_t *fn;
    623         int rc = ops->node_get(&fn, dev_handle, index);
     623        int rc = ops->node_get(&fn, devmap_handle, index);
    624624        on_error(rc, answer_and_return(rid, rc));
    625625       
  • uspace/lib/fs/libfs.h

    rb4c9c61 rfdbc3ff  
    4747        int phone;
    4848        fs_handle_t fs_handle;
    49         dev_handle_t dev_handle;
     49        devmap_handle_t devmap_handle;
    5050} mp_data_t;
    5151
     
    6161         * argument holds the output argument.
    6262         */
    63         int (* root_get)(fs_node_t **, dev_handle_t);
     63        int (* root_get)(fs_node_t **, devmap_handle_t);
    6464        int (* match)(fs_node_t **, fs_node_t *, const char *);
    65         int (* node_get)(fs_node_t **, dev_handle_t, fs_index_t);
     65        int (* node_get)(fs_node_t **, devmap_handle_t, fs_index_t);
    6666        int (* node_open)(fs_node_t *);
    6767        int (* node_put)(fs_node_t *);
    68         int (* create)(fs_node_t **, dev_handle_t, int);
     68        int (* create)(fs_node_t **, devmap_handle_t, int);
    6969        int (* destroy)(fs_node_t *);
    7070        int (* link)(fs_node_t *, fs_node_t *, const char *);
     
    8181        bool (* is_directory)(fs_node_t *);
    8282        bool (* is_file)(fs_node_t *);
    83         dev_handle_t (* device_get)(fs_node_t *);
     83        devmap_handle_t (* device_get)(fs_node_t *);
    8484} libfs_ops_t;
    8585
  • uspace/lib/net/adt/module_map.c

    rb4c9c61 rfdbc3ff  
    5959 *                      running.
    6060 * @param[in] connect_module The module connecting function.
    61  * @returns             EOK on success.
    62  * @returns             ENOMEM if there is not enough memory left.
     61 * @return              EOK on success.
     62 * @return              ENOMEM if there is not enough memory left.
    6363 */
    6464int
    65 add_module(module_ref *module, modules_ref modules, const char *name,
     65add_module(module_t **module, modules_t *modules, const char *name,
    6666    const char *filename, services_t service, task_id_t task_id,
    6767    connect_module_t connect_module)
    6868{
    69         module_ref tmp_module;
     69        module_t *tmp_module;
    7070        int rc;
    7171
    72         tmp_module = (module_ref) malloc(sizeof(module_t));
     72        tmp_module = (module_t *) malloc(sizeof(module_t));
    7373        if (!tmp_module)
    7474                return ENOMEM;
     
    100100 * @param[in] modules   The module map.
    101101 * @param[in] name      The module name.
    102  * @returns             The running module found. It does not have to be
     102 * @return              The running module found. It does not have to be
    103103 *                      connected.
    104  * @returns             NULL if there is no such module.
     104 * @return              NULL if there is no such module.
    105105 */
    106 module_ref get_running_module(modules_ref modules, char *name)
     106module_t *get_running_module(modules_t *modules, char *name)
    107107{
    108         module_ref module;
     108        module_t *module;
    109109
    110110        module = modules_find(modules, name, 0);
     
    126126 *
    127127 * @param[in] fname     The module full or relative path filename.
    128  * @returns             The new module task identifier on success.
    129  * @returns             Zero if there is no such module.
     128 * @return              The new module task identifier on success.
     129 * @return              Zero if there is no such module.
    130130 */
    131131task_id_t spawn(const char *fname)
  • uspace/lib/net/generic/generic.c

    rb4c9c61 rfdbc3ff  
    9292 * @param[out] address  The desired address.
    9393 * @param[out] data     The address data container.
    94  * @returns             EOK on success.
    95  * @returns             EBADMEM if the address parameter and/or the data
     94 * @return              EOK on success.
     95 * @return              EBADMEM if the address parameter and/or the data
    9696 *                      parameter is NULL.
    97  * @returns             Other error codes as defined for the specific service
     97 * @return              Other error codes as defined for the specific service
    9898 *                      message.
    9999 */
    100100int
    101101generic_get_addr_req(int phone, int message, device_id_t device_id,
    102     measured_string_ref *address, char ** data)
     102    measured_string_t **address, char ** data)
    103103{
    104104        aid_t message_id;
     
    138138int
    139139generic_packet_size_req_remote(int phone, int message, device_id_t device_id,
    140     packet_dimension_ref packet_dimension)
     140    packet_dimension_t *packet_dimension)
    141141{
    142142        if (!packet_dimension)
     
    223223 * @param[out] translation The translated values.
    224224 * @param[out] data     The translation data container.
    225  * @returns             EOK on success.
    226  * @returns             EINVAL if the configuration parameter is NULL.
    227  * @returns             EINVAL if the count parameter is zero.
    228  * @returns             EBADMEM if the translation or the data parameters are
     225 * @return              EOK on success.
     226 * @return              EINVAL if the configuration parameter is NULL.
     227 * @return              EINVAL if the count parameter is zero.
     228 * @return              EBADMEM if the translation or the data parameters are
    229229 *                      NULL.
    230  * @returns             Other error codes as defined for the specific service
     230 * @return              Other error codes as defined for the specific service
    231231 *                      message.
    232232 */
    233233int
    234234generic_translate_req(int phone, int message, device_id_t device_id,
    235     services_t service, measured_string_ref configuration, size_t count,
    236     measured_string_ref *translation, char **data)
     235    services_t service, measured_string_t *configuration, size_t count,
     236    measured_string_t **translation, char **data)
    237237{
    238238        aid_t message_id;
  • uspace/lib/net/generic/net_checksum.c

    rb4c9c61 rfdbc3ff  
    4848 *
    4949 * @param[in] sum       Computed checksum.
    50  * @returns             Compacted computed checksum to the 16 bits.
     50 * @return              Compacted computed checksum to the 16 bits.
    5151 */
    5252uint16_t compact_checksum(uint32_t sum)
     
    6666 * @param[in] data      Pointer to the beginning of data to process.
    6767 * @param[in] length    Length of the data in bytes.
    68  * @returns             The computed checksum of the length bytes of the data.
     68 * @return              The computed checksum of the length bytes of the data.
    6969 */
    7070uint32_t compute_checksum(uint32_t seed, uint8_t *data, size_t length)
     
    8888 * @param[in] data      Pointer to the beginning of data to process.
    8989 * @param[in] length    Length of the data in bits.
    90  * @returns             The computed CRC32 of the length bits of the data.
     90 * @return              The computed CRC32 of the length bits of the data.
    9191 */
    9292uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length)
     
    142142 * @param[in] data      Pointer to the beginning of data to process.
    143143 * @param[in] length    Length of the data in bits.
    144  * @returns             The computed CRC32 of the length bits of the data.
     144 * @return              The computed CRC32 of the length bits of the data.
    145145 */
    146146uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length)
     
    193193 *
    194194 * @param[in] checksum  The computed checksum.
    195  * @returns             The internet protocol header checksum.
    196  * @returns             0xFFFF if the computed checksum is zero.
     195 * @return              The internet protocol header checksum.
     196 * @return              0xFFFF if the computed checksum is zero.
    197197 */
    198198uint16_t flip_checksum(uint16_t checksum)
     
    211211 * @param[in] data      The header data.
    212212 * @param[in] length    The header length in bytes.
    213  * @returns             The internet protocol header checksum.
    214  * @returns             0xFFFF if the computed checksum is zero.
     213 * @return              The internet protocol header checksum.
     214 * @return              0xFFFF if the computed checksum is zero.
    215215 */
    216216uint16_t ip_checksum(uint8_t *data, size_t length)
  • uspace/lib/net/generic/net_remote.c

    rb4c9c61 rfdbc3ff  
    4949/** Connects to the networking module.
    5050 *
    51  * @returns             The networking module phone on success.
     51 * @return              The networking module phone on success.
    5252 */
    5353int net_connect_module(void)
     
    6363 * @see net_get_conf_req()
    6464 */
    65 void net_free_settings(measured_string_ref settings, char *data)
     65void net_free_settings(measured_string_t *settings, char *data)
    6666{
    6767        if (settings)
     
    8383 * @param[in] count     The configuration entries count.
    8484 * @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
     85 * @return              EOK on success.
     86 * @return              EINVAL if the configuration is NULL.
     87 * @return              EINVAL if the count is zero.
     88 * @return              Other error codes as defined for the
    8989 *                      generic_translate_req() function.
    9090 */
    9191int
    92 net_get_conf_req(int net_phone, measured_string_ref *configuration,
     92net_get_conf_req(int net_phone, measured_string_t **configuration,
    9393    size_t count, char **data)
    9494{
     
    110110 * @param[in] count     The configuration entries count.
    111111 * @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
     112 * @return              EOK on success.
     113 * @return              EINVAL if the configuration is NULL.
     114 * @return              EINVAL if the count is zero.
     115 * @return              Other error codes as defined for the
    116116 *                      generic_translate_req() function.
    117117 */
    118118int
    119119net_get_device_conf_req(int net_phone, device_id_t device_id,
    120     measured_string_ref *configuration, size_t count, char **data)
     120    measured_string_t **configuration, size_t count, char **data)
    121121{
    122122        return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF,
  • uspace/lib/net/generic/packet_client.c

    rb4c9c61 rfdbc3ff  
    5353 * @param[in] data      The data to be copied.
    5454 * @param[in] length    The length of the copied data.
    55  * @returns             EOK on success.
    56  * @returns             EINVAL if the packet is not valid.
    57  * @returns             ENOMEM if there is not enough memory left.
     55 * @return              EOK on success.
     56 * @return              EINVAL if the packet is not valid.
     57 * @return              ENOMEM if there is not enough memory left.
    5858 */
    5959int packet_copy_data(packet_t packet, const void *data, size_t length)
     
    7878 * @param[in] length    The space length to be allocated at the beginning of the
    7979 *                      packet content.
    80  * @returns             The pointer to the allocated memory.
    81  * @returns             NULL if there is not enough memory left.
     80 * @return              The pointer to the allocated memory.
     81 * @return              NULL if there is not enough memory left.
    8282 */
    8383void *packet_prefix(packet_t packet, size_t length)
     
    9999 * @param[in] length    The space length to be allocated at the end of the
    100100 *                       packet content.
    101  * @returns             The pointer to the allocated memory.
    102  * @returns             NULL if there is not enough memory left.
     101 * @return              The pointer to the allocated memory.
     102 * @return              NULL if there is not enough memory left.
    103103 */
    104104void *packet_suffix(packet_t packet, size_t length)
     
    120120 * @param[in] suffix    The suffix length to be removed from the end of the
    121121 *                      packet content.
    122  * @returns             EOK on success.
    123  * @returns             EINVAL if the packet is not valid.
    124  * @returns             ENOMEM if there is not enough memory left.
     122 * @return              EOK on success.
     123 * @return              EINVAL if the packet is not valid.
     124 * @return              ENOMEM if there is not enough memory left.
    125125 */
    126126int packet_trim(packet_t packet, size_t prefix, size_t suffix)
     
    140140 *
    141141 * @param[in] packet    The packet.
    142  * @returns             The packet identifier.
    143  * @returns             Zero if the packet is not valid.
     142 * @return              The packet identifier.
     143 * @return              Zero if the packet is not valid.
    144144 */
    145145packet_id_t packet_get_id(const packet_t packet)
     
    153153 * @param[out] src      The source address. May be NULL if not desired.
    154154 * @param[out] dest     The destination address. May be NULL if not desired.
    155  * @returns             The stored addresses length.
    156  * @returns             Zero if the addresses are not present.
    157  * @returns             EINVAL if the packet is not valid.
     155 * @return              The stored addresses length.
     156 * @return              Zero if the addresses are not present.
     157 * @return              EINVAL if the packet is not valid.
    158158 */
    159159int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)
     
    174174 *
    175175 * @param[in] packet    The packet.
    176  * @returns             The packet content length in bytes.
    177  * @returns             Zero if the packet is not valid.
     176 * @return              The packet content length in bytes.
     177 * @return              Zero if the packet is not valid.
    178178 */
    179179size_t packet_get_data_length(const packet_t packet)
     
    188188 *
    189189 * @param[in] packet    The packet.
    190  * @returns             The pointer to the beginning of the packet content.
    191  * @returns             NULL if the packet is not valid.
     190 * @return              The pointer to the beginning of the packet content.
     191 * @return              NULL if the packet is not valid.
    192192 */
    193193void *packet_get_data(const packet_t packet)
     
    205205 * @param[in] dest      The new destination address. May be NULL.
    206206 * @param[in] addr_len  The addresses length.
    207  * @returns             EOK on success.
    208  * @returns             EINVAL if the packet is not valid.
    209  * @returns             ENOMEM if there is not enough memory left.
     207 * @return              EOK on success.
     208 * @return              EINVAL if the packet is not valid.
     209 * @return              ENOMEM if there is not enough memory left.
    210210 */
    211211int
     
    254254 * @param[in] phone     The packet server module phone.
    255255 * @param[in] packet    The original packet.
    256  * @returns             The packet copy.
    257  * @returns             NULL on error.
     256 * @return              The packet copy.
     257 * @return              NULL on error.
    258258 */
    259259packet_t packet_get_copy(int phone, packet_t packet)
  • uspace/lib/net/generic/packet_remote.c

    rb4c9c61 rfdbc3ff  
    6464 */
    6565static int
    66 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size)
     66packet_return(int phone, packet_t *packet, packet_id_t packet_id, size_t size)
    6767{
    6868        ipc_call_t answer;
     
    100100 * @param[out] packet   The packet reference.
    101101 * @param[in] packet_id The packet identifier.
    102  * @returns             EOK on success.
    103  * @returns             EINVAL if the packet parameter is NULL.
    104  * @returns             Other error codes as defined for the NET_PACKET_GET_SIZE
     102 * @return              EOK on success.
     103 * @return              EINVAL if the packet parameter is NULL.
     104 * @return              Other error codes as defined for the NET_PACKET_GET_SIZE
    105105 *                      message.
    106  * @returns             Other error codes as defined for the packet_return()
     106 * @return              Other error codes as defined for the packet_return()
    107107 *                      function.
    108108 */
    109 int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id)
     109int packet_translate_remote(int phone, packet_t *packet, packet_id_t packet_id)
    110110{
    111111        int rc;
     
    145145 * @param[in] max_content The maximal content length in bytes.
    146146 * @param[in] max_suffix The maximal suffix length in bytes.
    147  * @returns             The packet reference.
    148  * @returns             NULL on error.
     147 * @return              The packet reference.
     148 * @return              NULL on error.
    149149 */
    150150packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
     
    177177 * @param[in] phone     The packet server module phone.
    178178 * @param[in] content   The maximal content length in bytes.
    179  * @returns             The packet reference.
    180  * @returns             NULL on error.
     179 * @return              The packet reference.
     180 * @return              NULL on error.
    181181 */
    182182packet_t packet_get_1_remote(int phone, size_t content)
  • uspace/lib/net/generic/protocol_map.c

    rb4c9c61 rfdbc3ff  
    4242 * @param[in] nil       Network interface layer service.
    4343 * @param[in] il        Internetwork layer service.
    44  * @returns             Network interface layer type of the internetworking
     44 * @return              Network interface layer type of the internetworking
    4545 *                      layer service.
    46  * @returns             Zero if mapping is not found.
     46 * @return              Zero if mapping is not found.
    4747 */
    4848eth_type_t protocol_map(services_t nil, services_t il)
     
    6868 * @param[in] nil       Network interface layer service.
    6969 * @param[in] protocol  Network interface layer type.
    70  * @returns             Internetwork layer service of the network interface
     70 * @return              Internetwork layer service of the network interface
    7171 *                      layer type.
    72  * @returns             Zero if mapping is not found.
     72 * @return              Zero if mapping is not found.
    7373 */
    7474services_t protocol_unmap(services_t nil, int protocol)
     
    9494 *
    9595 * @param[in] lsap      Link service access point identifier.
    96  * @returns             Ethernet protocol identifier of the link service access
     96 * @return              Ethernet protocol identifier of the link service access
    9797 *                      point identifier.
    98  * @returns             ETH_LSAP_NULL if mapping is not found.
     98 * @return              ETH_LSAP_NULL if mapping is not found.
    9999 */
    100100eth_type_t lsap_map(eth_lsap_t lsap)
     
    114114 *
    115115 * @param[in] ethertype Ethernet protocol identifier.
    116  * @returns             Link service access point identifier.
    117  * @returns             Zero if mapping is not found.
     116 * @return              Link service access point identifier.
     117 * @return              Zero if mapping is not found.
    118118 */
    119119eth_lsap_t lsap_unmap(eth_type_t ethertype)
     
    132132 *
    133133 * @param[in] nil       The network interface service.
    134  * @returns             The hardware type of the network interface service.
    135  * @returns             Zero if mapping is not found.
     134 * @return              The hardware type of the network interface service.
     135 * @return              Zero if mapping is not found.
    136136 */
    137137hw_type_t hardware_map(services_t nil)
  • uspace/lib/net/il/arp_remote.c

    rb4c9c61 rfdbc3ff  
    5252 *
    5353 * @param service       The ARP module service. Ignored parameter.
    54  * @returns             The ARP module phone on success.
     54 * @return              The ARP module phone on success.
    5555 */
    5656int arp_connect_module(services_t service)
     
    6565 *
    6666 * @param[in] arp_phone The ARP module phone used for (semi)remote calls.
    67  * @returns             EOK on success.
     67 * @return              EOK on success.
    6868 */
    6969int arp_clean_cache_req(int arp_phone)
     
    7878 * @param[in] protocol  The requesting protocol service.
    7979 * @param[in] address   The protocol address to be cleared.
    80  * @returns             EOK on success.
    81  * @returns             ENOENT if the mapping is not found.
     80 * @return              EOK on success.
     81 * @return              ENOENT if the mapping is not found.
    8282 */
    8383int
    8484arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol,
    85     measured_string_ref address)
     85    measured_string_t *address)
    8686{
    8787        aid_t message_id;
     
    100100 * @param[in] arp_phone The ARP module phone used for (semi)remote calls.
    101101 * @param[in] device_id The device identifier.
    102  * @returns             EOK on success.
    103  * @returns             ENOENT if the device is not found.
     102 * @return              EOK on success.
     103 * @return              ENOENT if the device is not found.
    104104 */
    105105int arp_clear_device_req(int arp_phone, device_id_t device_id)
     
    119119 * @param[in] netif     The underlying device network interface layer service.
    120120 * @param[in] address   The local requesting protocol address of the device.
    121  * @returns             EOK on success.
    122  * @returns             EEXIST if the device is already used.
    123  * @returns             ENOMEM if there is not enough memory left.
    124  * @returns             ENOENT if the network interface service is not known.
    125  * @returns             EREFUSED if the network interface service is not
     121 * @return              EOK on success.
     122 * @return              EEXIST if the device is already used.
     123 * @return              ENOMEM if there is not enough memory left.
     124 * @return              ENOENT if the network interface service is not known.
     125 * @return              EREFUSED if the network interface service is not
    126126 *                      responding.
    127  * @returns             Other error codes as defined for the
     127 * @return              Other error codes as defined for the
    128128 *                      nil_packet_get_size() function.
    129  * @returns             Other error codes as defined for the nil_get_addr()
     129 * @return              Other error codes as defined for the nil_get_addr()
    130130 *                      function.
    131  * @returns             Other error codes as defined for the
     131 * @return              Other error codes as defined for the
    132132 *                      nil_get_broadcast_addr() function.
    133133 */
    134134int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol,
    135     services_t netif, measured_string_ref address)
     135    services_t netif, measured_string_t *address)
    136136{
    137137        aid_t message_id;
     
    157157 * @param[out] translation The translation of the local protocol address.
    158158 * @param[out] data     The allocated raw translation data container.
    159  * @returns             EOK on success.
    160  * @returns             EINVAL if the address parameter is NULL.
    161  * @returns             EBADMEM if the translation or the data parameters are
     159 * @return              EOK on success.
     160 * @return              EINVAL if the address parameter is NULL.
     161 * @return              EBADMEM if the translation or the data parameters are
    162162 *                      NULL.
    163  * @returns             ENOENT if the mapping is not found.
     163 * @return              ENOENT if the mapping is not found.
    164164 */
    165165int
    166166arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol,
    167     measured_string_ref address, measured_string_ref *translation, char **data)
     167    measured_string_t *address, measured_string_t **translation, char **data)
    168168{
    169169        return generic_translate_req(arp_phone, NET_ARP_TRANSLATE, device_id,
  • uspace/lib/net/il/ip_client.c

    rb4c9c61 rfdbc3ff  
    4848 *
    4949 * @param[in] packet    The packet.
    50  * @returns             The IP header length in bytes.
    51  * @returns             Zero if there is no IP header.
     50 * @return              The IP header length in bytes.
     51 * @return              Zero if there is no IP header.
    5252 */
    5353size_t ip_client_header_length(packet_t packet)
    5454{
    55         ip_header_ref header;
    56 
    57         header = (ip_header_ref) packet_get_data(packet);
     55        ip_header_t *header;
     56
     57        header = (ip_header_t *) packet_get_data(packet);
    5858        if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t)))
    5959                return 0;
     
    7272 * @param[out] header   The constructed IPv4 pseudo header.
    7373 * @param[out] headerlen The length of the IP pseudo header in bytes.
    74  * @returns             EOK on success.
    75  * @returns             EBADMEM if the header and/or the headerlen parameter is
     74 * @return              EOK on success.
     75 * @return              EBADMEM if the header and/or the headerlen parameter is
    7676 *                      NULL.
    77  * @returns             EINVAL if the source address and/or the destination
     77 * @return              EINVAL if the source address and/or the destination
    7878 *                      address parameter is NULL.
    79  * @returns             EINVAL if the source address length is less than struct
     79 * @return              EINVAL if the source address length is less than struct
    8080 *                      sockaddr length.
    81  * @returns             EINVAL if the source address length differs from the
     81 * @return              EINVAL if the source address length differs from the
    8282 *                      destination address length.
    83  * @returns             EINVAL if the source address family differs from the
     83 * @return              EINVAL if the source address family differs from the
    8484 *                      destination family.
    85  * @returns             EAFNOSUPPORT if the address family is not supported.
    86  * @returns             ENOMEM if there is not enough memory left.
     85 * @return              EAFNOSUPPORT if the address family is not supported.
     86 * @return              ENOMEM if there is not enough memory left.
    8787 */
    8888int
     
    9191    size_t data_length, void **header, size_t *headerlen)
    9292{
    93         ipv4_pseudo_header_ref header_in;
     93        ipv4_pseudo_header_t *header_in;
    9494        struct sockaddr_in *address_in;
    9595
     
    109109               
    110110                *headerlen = sizeof(*header_in);
    111                 header_in = (ipv4_pseudo_header_ref) malloc(*headerlen);
     111                header_in = (ipv4_pseudo_header_t *) malloc(*headerlen);
    112112                if (!header_in)
    113113                        return ENOMEM;
     
    148148 *                      disabled.
    149149 * @param[in] ipopt_length The prefixed IP options length in bytes.
    150  * @returns             EOK on success.
    151  * @returns             ENOMEM if there is not enough memory left in the packet.
     150 * @return              EOK on success.
     151 * @return              ENOMEM if there is not enough memory left in the packet.
    152152 */
    153153int
     
    155155    ip_tos_t tos, int dont_fragment, size_t ipopt_length)
    156156{
    157         ip_header_ref header;
     157        ip_header_t *header;
    158158        uint8_t *data;
    159159        size_t padding;
     
    177177
    178178        // set the header
    179         header = (ip_header_ref) data;
     179        header = (ip_header_t *) data;
    180180        header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) +
    181181            ipopt_length);
     
    203203 * @param[out] ipopt_length The IP options length in bytes. May be NULL if not
    204204 *                      desired.
    205  * @returns             The prefixed IP header length in bytes on success.
    206  * @returns             ENOMEM if the packet is too short to contain the IP
     205 * @return              The prefixed IP header length in bytes on success.
     206 * @return              ENOMEM if the packet is too short to contain the IP
    207207 *                      header.
    208208 */
     
    211211    ip_ttl_t *ttl, ip_tos_t *tos, int *dont_fragment, size_t *ipopt_length)
    212212{
    213         ip_header_ref header;
    214 
    215         header = (ip_header_ref) packet_get_data(packet);
     213        ip_header_t *header;
     214
     215        header = (ip_header_t *) packet_get_data(packet);
    216216        if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t)))
    217217                return ENOMEM;
     
    238238 * @param[in] headerlen The length of the IP pseudo header in bytes.
    239239 * @param[in] data_length The data length to be set.
    240  * @returns             EOK on success.
    241  * @returns             EBADMEM if the header parameter is NULL.
    242  * @returns             EINVAL if the headerlen parameter is not IPv4 pseudo
     240 * @return              EOK on success.
     241 * @return              EBADMEM if the header parameter is NULL.
     242 * @return              EINVAL if the headerlen parameter is not IPv4 pseudo
    243243 *                      header length.
    244244 */
     
    247247    size_t data_length)
    248248{
    249         ipv4_pseudo_header_ref header_in;
     249        ipv4_pseudo_header_t *header_in;
    250250
    251251        if (!header)
     
    253253
    254254        if (headerlen == sizeof(ipv4_pseudo_header_t)) {
    255                 header_in = (ipv4_pseudo_header_ref) header;
     255                header_in = (ipv4_pseudo_header_t *) header;
    256256                header_in->data_length = htons(data_length);
    257257                return EOK;
  • uspace/lib/net/il/ip_remote.c

    rb4c9c61 rfdbc3ff  
    7878 * @param[in] me        The requesting module service.
    7979 * @param[in] receiver  The message receiver. Used for remote connection.
    80  * @returns             The phone of the needed service.
    81  * @returns             EOK on success.
    82  * @returns             Other error codes as defined for the bind_service()
     80 * @return              The phone of the needed service.
     81 * @return              EOK on success.
     82 * @return              Other error codes as defined for the bind_service()
    8383 *                      function.
    8484 */
     
    9393 *
    9494 * @param service       The IP module service. Ignored parameter.
    95  * @returns             The IP module phone on success.
     95 * @return              The IP module phone on success.
    9696 */
    9797int ip_connect_module(services_t service)
     
    186186 */
    187187int ip_packet_size_req_remote(int ip_phone, device_id_t device_id,
    188     packet_dimension_ref packet_dimension)
     188    packet_dimension_t *packet_dimension)
    189189{
    190190        return generic_packet_size_req_remote(ip_phone, NET_IL_PACKET_SPACE,
  • uspace/lib/net/include/adt/module_map.h

    rb4c9c61 rfdbc3ff  
    4848typedef struct module_struct module_t;
    4949
    50 /** Type definition of the module structure pointer.
    51  * @see module_struct
    52  */
    53 typedef module_t *module_ref;
    54 
    5550/** Module map.
    5651 * Sorted by module names.
     
    7772};
    7873
    79 extern int add_module(module_ref *, modules_ref, const char *, const char *,
     74extern int add_module(module_t **, modules_t *, const char *, const char *,
    8075    services_t, task_id_t, connect_module_t *);
    81 extern module_ref get_running_module(modules_ref, char *);
     76extern module_t *get_running_module(modules_t *, char *);
    8277extern task_id_t spawn(const char *);
    8378
  • uspace/lib/net/include/arp_interface.h

    rb4c9c61 rfdbc3ff  
    4848
    4949extern int arp_device_req(int, device_id_t, services_t, services_t,
    50     measured_string_ref);
    51 extern int arp_translate_req(int, device_id_t, services_t, measured_string_ref,
    52     measured_string_ref *, char **);
     50    measured_string_t *);
     51extern int arp_translate_req(int, device_id_t, services_t, measured_string_t *,
     52    measured_string_t **, char **);
    5353extern int arp_clear_device_req(int, device_id_t);
    5454extern int arp_clear_address_req(int, device_id_t, services_t,
    55     measured_string_ref);
     55    measured_string_t *);
    5656extern int arp_clean_cache_req(int);
    5757extern int arp_connect_module(services_t);
  • uspace/lib/net/include/generic.h

    rb4c9c61 rfdbc3ff  
    4949    services_t);
    5050extern int generic_device_req_remote(int, int, device_id_t, int, services_t);
    51 extern int generic_get_addr_req(int, int, device_id_t, measured_string_ref *,
     51extern int generic_get_addr_req(int, int, device_id_t, measured_string_t **,
    5252    char **);
    5353extern int generic_packet_size_req_remote(int, int, device_id_t,
    54     packet_dimension_ref);
     54    packet_dimension_t *);
    5555extern int generic_received_msg_remote(int, int, device_id_t, packet_id_t,
    5656    services_t, services_t);
     
    5858    services_t, services_t);
    5959extern int generic_translate_req(int, int, device_id_t, services_t,
    60     measured_string_ref, size_t, measured_string_ref *, char **);
     60    measured_string_t *, size_t, measured_string_t **, char **);
    6161
    6262#endif
  • uspace/lib/net/include/icmp_header.h

    rb4c9c61 rfdbc3ff  
    5252typedef struct icmp_echo icmp_echo_t;
    5353
    54 /** Type definition of the echo specific data pointer.
    55  * @see icmp_echo
    56  */
    57 typedef icmp_echo_t *icmp_echo_ref;
    58 
    5954/** Echo specific data. */
    6055struct icmp_echo {
     
    6964 */
    7065typedef struct icmp_header icmp_header_t;
    71 
    72 /** Type definition of the internet control message header pointer.
    73  * @see icmp_header
    74  */
    75 typedef icmp_header_t *icmp_header_ref;
    7666
    7767/** Internet control message header. */
  • uspace/lib/net/include/il_local.h

    rb4c9c61 rfdbc3ff  
    4444 * @param[out]          answer_count The last parameter for the actual answer in
    4545 *                      the answer parameter.
    46  * @returns             EOK on success.
    47  * @returns             Other error codes as defined for the arp_message()
     46 * @return              EOK on success.
     47 * @return              Other error codes as defined for the arp_message()
    4848 *                      function.
    4949 */
     
    5959 * @param[in] client_connection The client connection processing function. The
    6060 *                      module skeleton propagates its own one.
    61  * @returns             EOK on successful module termination.
    62  * @returns             Other error codes as defined for the arp_initialize()
     61 * @return              EOK on successful module termination.
     62 * @return              Other error codes as defined for the arp_initialize()
    6363 *                      function.
    64  * @returns             Other error codes as defined for the REGISTER_ME() macro
     64 * @return              Other error codes as defined for the REGISTER_ME() macro
    6565 *                      function.
    6666 */
  • uspace/lib/net/include/ip_header.h

    rb4c9c61 rfdbc3ff  
    127127typedef struct ip_header ip_header_t;
    128128
    129 /** Type definition of the internet header pointer.
    130  * @see ip_header
    131  */
    132 typedef ip_header_t *ip_header_ref;
    133 
    134129/** Type definition of the internet option header.
    135130 * @see ip_header
     
    137132typedef struct ip_option ip_option_t;
    138133
    139 /** Type definition of the internet option header pointer.
    140  * @see ip_header
    141  */
    142 typedef ip_option_t *ip_option_ref;
    143 
    144134/** Type definition of the internet version 4 pseudo header.
    145135 * @see ipv4_pseudo_header
    146136 */
    147137typedef struct ipv4_pseudo_header ipv4_pseudo_header_t;
    148 
    149 /** Type definition of the internet version 4 pseudo header pointer.
    150  * @see ipv4_pseudo_header
    151  */
    152 typedef ipv4_pseudo_header_t *ipv4_pseudo_header_ref;
    153138
    154139/** Internet header.
  • uspace/lib/net/include/ip_interface.h

    rb4c9c61 rfdbc3ff  
    6868 * @param[in] error     The packet error reporting service. Prefixes the
    6969 *                      received packet.
    70  * @returns             EOK on success.
     70 * @return              EOK on success.
    7171 */
    7272typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t packet,
  • uspace/lib/net/include/ip_remote.h

    rb4c9c61 rfdbc3ff  
    4444
    4545extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t);
    46 extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_ref);
     46extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_t *);
    4747extern int ip_received_error_msg_remote(int, device_id_t, packet_t, services_t,
    4848    services_t);
  • uspace/lib/net/include/net_interface.h

    rb4c9c61 rfdbc3ff  
    4444/*@{*/
    4545
    46 extern int net_get_device_conf_req(int, device_id_t, measured_string_ref *,
     46extern int net_get_device_conf_req(int, device_id_t, measured_string_t **,
    4747    size_t, char **);
    48 extern int net_get_conf_req(int, measured_string_ref *, size_t, char **);
    49 extern void net_free_settings(measured_string_ref, char *);
     48extern int net_get_conf_req(int, measured_string_t **, size_t, char **);
     49extern void net_free_settings(measured_string_t *, char *);
    5050extern int net_connect_module(void);
    5151
  • uspace/lib/net/include/netif_local.h

    rb4c9c61 rfdbc3ff  
    158158 */
    159159extern int netif_get_addr_message(device_id_t device_id,
    160     measured_string_ref address);
     160    measured_string_t *address);
    161161
    162162/** Process the netif driver specific message.
     
    193193 */
    194194extern int netif_get_device_stats(device_id_t device_id,
    195     device_stats_ref stats);
    196 
    197 extern int netif_get_addr_req_local(int, device_id_t, measured_string_ref *,
     195    device_stats_t *stats);
     196
     197extern int netif_get_addr_req_local(int, device_id_t, measured_string_t **,
    198198    char **);
    199199extern int netif_probe_req_local(int, device_id_t, int, int);
     
    201201extern int netif_start_req_local(int, device_id_t);
    202202extern int netif_stop_req_local(int, device_id_t);
    203 extern int netif_stats_req_local(int, device_id_t, device_stats_ref);
     203extern int netif_stats_req_local(int, device_id_t, device_stats_t *);
    204204extern int netif_bind_service_local(services_t, device_id_t, services_t,
    205205    async_client_conn_t);
    206206
    207207extern int find_device(device_id_t, netif_device_t **);
    208 extern void null_device_stats(device_stats_ref);
     208extern void null_device_stats(device_stats_t *);
    209209extern void netif_pq_release(packet_id_t);
    210210extern packet_t netif_packet_get_1(size_t);
  • uspace/lib/net/include/netif_remote.h

    rb4c9c61 rfdbc3ff  
    4141#include <net/packet.h>
    4242
    43 extern int netif_get_addr_req_remote(int, device_id_t, measured_string_ref *,
     43extern int netif_get_addr_req_remote(int, device_id_t, measured_string_t **,
    4444    char **);
    4545extern int netif_probe_req_remote(int, device_id_t, int, int);
     
    4747extern int netif_start_req_remote(int, device_id_t);
    4848extern int netif_stop_req_remote(int, device_id_t);
    49 extern int netif_stats_req_remote(int, device_id_t, device_stats_ref);
     49extern int netif_stats_req_remote(int, device_id_t, device_stats_t *);
    5050extern int netif_bind_service_remote(services_t, device_id_t, services_t,
    5151    async_client_conn_t);
  • uspace/lib/net/include/packet_client.h

    rb4c9c61 rfdbc3ff  
    6161 * @param[in] type      The type to be allocated at the beginning of the packet
    6262 *                      content.
    63  * @returns             The typed pointer to the allocated memory.
    64  * @returns             NULL if the packet is not valid.
    65  * @returns             NULL if there is not enough memory left.
     63 * @return              The typed pointer to the allocated memory.
     64 * @return              NULL if the packet is not valid.
     65 * @return              NULL if there is not enough memory left.
    6666 */
    6767#define PACKET_PREFIX(packet, type) \
     
    7676 * @param[in] type      The type to be allocated at the end of the packet
    7777 *                      content.
    78  * @returns             The typed pointer to the allocated memory.
    79  * @returns             NULL if the packet is not valid.
    80  * @returns             NULL if there is not enough memory left.
     78 * @return              The typed pointer to the allocated memory.
     79 * @return              NULL if the packet is not valid.
     80 * @return              NULL if there is not enough memory left.
    8181 */
    8282#define PACKET_SUFFIX(packet, type) \
     
    9292 * @param[in] suffix    The type of the suffix to be removed from the end of
    9393 *                      the packet content.
    94  * @returns             EOK on success.
    95  * @returns             EINVAL if the packet is not valid.
    96  * @returns             ENOMEM if there is not enough memory left.
     94 * @return              EOK on success.
     95 * @return              EINVAL if the packet is not valid.
     96 * @return              ENOMEM if there is not enough memory left.
    9797 */
    9898#define PACKET_TRIM(packet, prefix, suffix) \
  • uspace/lib/net/include/packet_remote.h

    rb4c9c61 rfdbc3ff  
    3737#include <sys/types.h>
    3838
    39 extern int packet_translate_remote(int, packet_ref, packet_id_t);
     39extern int packet_translate_remote(int, packet_t *, packet_id_t);
    4040extern packet_t packet_get_4_remote(int, size_t, size_t, size_t, size_t);
    4141extern packet_t packet_get_1_remote(int, size_t);
  • uspace/lib/net/include/socket_core.h

    rb4c9c61 rfdbc3ff  
    6666typedef struct socket_core socket_core_t;
    6767
    68 /** Type definition of the socket core pointer.
    69  * @see socket_core
    70  */
    71 typedef socket_core_t *socket_core_ref;
    72 
    7368/** Type definition of the socket port.
    7469 * @see socket_port
    7570 */
    7671typedef struct socket_port socket_port_t;
    77 
    78 /** Type definition of the socket port pointer.
    79  * @see socket_port
    80  */
    81 typedef socket_port_t *socket_port_ref;
    8272
    8373/** Socket core. */
     
    111101 * the other use the remote addresses.
    112102 */
    113 GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_ref);
     103GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_t *);
    114104
    115105/** Ports map.
     
    118108INT_MAP_DECLARE(socket_ports, socket_port_t);
    119109
    120 extern void socket_cores_release(int, socket_cores_ref, socket_ports_ref,
    121     void (*)(socket_core_ref));
    122 extern int socket_bind(socket_cores_ref, socket_ports_ref, int, void *, size_t,
     110extern void socket_cores_release(int, socket_cores_t *, socket_ports_t *,
     111    void (*)(socket_core_t *));
     112extern int socket_bind(socket_cores_t *, socket_ports_t *, int, void *, size_t,
    123113    int, int, int);
    124 extern int socket_bind_free_port(socket_ports_ref, socket_core_ref, int, int,
     114extern int socket_bind_free_port(socket_ports_t *, socket_core_t *, int, int,
    125115    int);
    126 extern int socket_create(socket_cores_ref, int, void *, int *);
    127 extern int socket_destroy(int, int, socket_cores_ref, socket_ports_ref,
    128     void (*)(socket_core_ref));
     116extern int socket_create(socket_cores_t *, int, void *, int *);
     117extern int socket_destroy(int, int, socket_cores_t *, socket_ports_t *,
     118    void (*)(socket_core_t *));
    129119extern int socket_reply_packets(packet_t, size_t *);
    130 extern socket_core_ref socket_port_find(socket_ports_ref, int, const char *,
     120extern socket_core_t *socket_port_find(socket_ports_t *, int, const char *,
    131121    size_t);
    132 extern void socket_port_release(socket_ports_ref, socket_core_ref);
    133 extern int socket_port_add(socket_ports_ref, int, socket_core_ref,
     122extern void socket_port_release(socket_ports_t *, socket_core_t *);
     123extern int socket_port_add(socket_ports_t *, int, socket_core_t *,
    134124    const char *, size_t);
    135125
  • uspace/lib/net/include/tl_common.h

    rb4c9c61 rfdbc3ff  
    5151DEVICE_MAP_DECLARE(packet_dimensions, packet_dimension_t);
    5252
    53 extern int tl_get_ip_packet_dimension(int, packet_dimensions_ref,
    54     device_id_t, packet_dimension_ref *);
     53extern int tl_get_ip_packet_dimension(int, packet_dimensions_t *,
     54    device_id_t, packet_dimension_t **);
    5555extern int tl_get_address_port(const struct sockaddr *, int, uint16_t *);
    56 extern int tl_update_ip_packet_dimension(packet_dimensions_ref, device_id_t,
     56extern int tl_update_ip_packet_dimension(packet_dimensions_t *, device_id_t,
    5757    size_t);
    5858extern int tl_set_address_port(struct sockaddr *, int, uint16_t);
    5959extern int tl_prepare_icmp_packet(int, int, packet_t, services_t);
    60 extern int tl_socket_read_packet_data(int, packet_ref, size_t,
    61     const packet_dimension_ref, const struct sockaddr *, socklen_t);
     60extern int tl_socket_read_packet_data(int, packet_t *, size_t,
     61    const packet_dimension_t *, const struct sockaddr *, socklen_t);
    6262
    6363#endif
  • uspace/lib/net/include/tl_local.h

    rb4c9c61 rfdbc3ff  
    4545 * @param[in] client_connection The client connection processing function. The
    4646 *                      module skeleton propagates its own one.
    47  * @returns             EOK on successful module termination.
    48  * @returns             Other error codes as defined for the module initialize
     47 * @return              EOK on successful module termination.
     48 * @return              Other error codes as defined for the module initialize
    4949 *                      function.
    50  * @returns             Other error codes as defined for the REGISTER_ME() macro
     50 * @return              Other error codes as defined for the REGISTER_ME() macro
    5151 *                      function.
    5252 */
     
    6262 * @param[out] answer_count The last parameter for the actual answer in the
    6363 *                      answer parameter.
    64  * @returns             EOK on success.
    65  * @returns             Other error codes as defined for the module's message
     64 * @return              EOK on success.
     65 * @return              Other error codes as defined for the module's message
    6666 *                      standalone function.
    6767 */
  • uspace/lib/net/netif/netif_local.c

    rb4c9c61 rfdbc3ff  
    181181 */
    182182int netif_stats_req_local(int netif_phone, device_id_t device_id,
    183     device_stats_ref stats)
     183    device_stats_t *stats)
    184184{
    185185        fibril_rwlock_read_lock(&netif_globals.lock);
     
    203203 */
    204204int netif_get_addr_req_local(int netif_phone, device_id_t device_id,
    205     measured_string_ref *address, char **data)
     205    measured_string_t **address, char **data)
    206206{
    207207        int rc;
     
    253253 * @param[in] stats     The usage statistics.
    254254 */
    255 void null_device_stats(device_stats_ref stats)
     255void null_device_stats(device_stats_t *stats)
    256256{
    257257        bzero(stats, sizeof(device_stats_t));
  • uspace/lib/net/netif/netif_remote.c

    rb4c9c61 rfdbc3ff  
    6060 */
    6161int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
    62     measured_string_ref *address, char **data)
     62    measured_string_t **address, char **data)
    6363{
    6464        return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id,
     
    138138 */
    139139int netif_stats_req_remote(int netif_phone, device_id_t device_id,
    140     device_stats_ref stats)
     140    device_stats_t *stats)
    141141{
    142142        if (!stats)
  • uspace/lib/net/tl/icmp_client.c

    rb4c9c61 rfdbc3ff  
    5757 * @param[out] pointer  The ICMP header pointer.
    5858 * @param[out] mtu      The ICMP header MTU.
    59  * @returns             The ICMP header length.
    60  * @returns             Zero if the packet contains no data.
     59 * @return              The ICMP header length.
     60 * @return              Zero if the packet contains no data.
    6161 */
    6262int
     
    6464    icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu)
    6565{
    66         icmp_header_ref header;
     66        icmp_header_t *header;
    6767
    68         header = (icmp_header_ref) packet_get_data(packet);
     68        header = (icmp_header_t *) packet_get_data(packet);
    6969        if (!header ||
    7070            (packet_get_data_length(packet) < sizeof(icmp_header_t))) {
     
    9292 *
    9393 * @param[in] packet    The packet.
    94  * @returns             The ICMP header length in bytes.
     94 * @return              The ICMP header length in bytes.
    9595 */
    9696size_t icmp_client_header_length(packet_t packet)
  • uspace/lib/net/tl/icmp_remote.c

    rb4c9c61 rfdbc3ff  
    5757 * @param[in] mtu       The error MTU value.
    5858 * @param[in] packet    The original packet.
    59  * @returns             EOK on success.
    60  * @returns             EPERM if the ICMP error notifications are disabled.
    61  * @returns             ENOMEM if there is not enough memory left.
     59 * @return              EOK on success.
     60 * @return              EPERM if the ICMP error notifications are disabled.
     61 * @return              ENOMEM if there is not enough memory left.
    6262 */
    6363int
     
    7878 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    7979 * @param[in] packet    The original packet.
    80  * @returns             EOK on success.
    81  * @returns             EPERM if the ICMP error notifications are disabled.
    82  * @returns             ENOMEM if there is not enough memory left.
     80 * @return              EOK on success.
     81 * @return              EPERM if the ICMP error notifications are disabled.
     82 * @return              ENOMEM if there is not enough memory left.
    8383 */
    8484int icmp_source_quench_msg(int icmp_phone, packet_t packet)
     
    9898 * @param[in] code      The error specific code.
    9999 * @param[in] packet    The original packet.
    100  * @returns             EOK on success.
    101  * @returns             EPERM if the ICMP error notifications are disabled.
    102  * @returns             ENOMEM if there is not enough memory left.
     100 * @return              EOK on success.
     101 * @return              EPERM if the ICMP error notifications are disabled.
     102 * @return              ENOMEM if there is not enough memory left.
    103103 */
    104104int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet)
     
    119119 * @param[in] pointer   The problematic parameter offset.
    120120 * @param[in] packet    The original packet.
    121  * @returns             EOK on success.
    122  * @returns             EPERM if the ICMP error notifications are disabled.
    123  * @returns             ENOMEM if there is not enough memory left.
     121 * @return              EOK on success.
     122 * @return              EPERM if the ICMP error notifications are disabled.
     123 * @return              ENOMEM if there is not enough memory left.
    124124 */
    125125int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
  • uspace/lib/net/tl/socket_core.c

    rb4c9c61 rfdbc3ff  
    6868INT_MAP_IMPLEMENT(socket_cores, socket_core_t);
    6969
    70 GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_ref);
     70GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_t *);
    7171
    7272INT_MAP_IMPLEMENT(socket_ports, socket_port_t);
     
    8585 */
    8686static void
    87 socket_destroy_core(int packet_phone, socket_core_ref socket,
    88     socket_cores_ref local_sockets, socket_ports_ref global_sockets,
    89     void (* socket_release)(socket_core_ref socket))
     87socket_destroy_core(int packet_phone, socket_core_t *socket,
     88    socket_cores_t *local_sockets, socket_ports_t *global_sockets,
     89    void (* socket_release)(socket_core_t *socket))
    9090{
    9191        int packet_id;
     
    121121 */
    122122void
    123 socket_cores_release(int packet_phone, socket_cores_ref local_sockets,
    124     socket_ports_ref global_sockets,
    125     void (* socket_release)(socket_core_ref socket))
     123socket_cores_release(int packet_phone, socket_cores_t *local_sockets,
     124    socket_ports_t *global_sockets,
     125    void (* socket_release)(socket_core_t *socket))
    126126{
    127127        int index;
     
    156156 * @param[in] key       The socket key identifier.
    157157 * @param[in] key_length The socket key length.
    158  * @returns             EOK on success.
    159  * @returns             ENOMEM if there is not enough memory left.
     158 * @return              EOK on success.
     159 * @return              ENOMEM if there is not enough memory left.
    160160 */
    161161static int
    162 socket_port_add_core(socket_port_ref socket_port, socket_core_ref socket,
     162socket_port_add_core(socket_port_t *socket_port, socket_core_t *socket,
    163163    const char *key, size_t key_length)
    164164{
    165         socket_core_ref *socket_ref;
     165        socket_core_t **socket_ref;
    166166        int rc;
    167167
     
    194194 * @param[in] socket    The socket to be added.
    195195 * @param[in] port      The port number to be bound to.
    196  * @returns             EOK on success.
    197  * @returns             ENOMEM if there is not enough memory left.
    198  * @returns             Other error codes as defined for the
     196 * @return              EOK on success.
     197 * @return              ENOMEM if there is not enough memory left.
     198 * @return              Other error codes as defined for the
    199199 *                       socket_ports_add() function.
    200200 */
    201201static int
    202 socket_bind_insert(socket_ports_ref global_sockets, socket_core_ref socket,
     202socket_bind_insert(socket_ports_t *global_sockets, socket_core_t *socket,
    203203    int port)
    204204{
    205         socket_port_ref socket_port;
     205        socket_port_t *socket_port;
    206206        int rc;
    207207
     
    248248 * @param[in] free_ports_end The maximum free port.
    249249 * @param[in] last_used_port The last used free port.
    250  * @returns             EOK on success.
    251  * @returns             ENOTSOCK if the socket was not found.
    252  * @returns             EAFNOSUPPORT if the address family is not supported.
    253  * @returns             EADDRINUSE if the port is already in use.
    254  * @returns             Other error codes as defined for the
     250 * @return              EOK on success.
     251 * @return              ENOTSOCK if the socket was not found.
     252 * @return              EAFNOSUPPORT if the address family is not supported.
     253 * @return              EADDRINUSE if the port is already in use.
     254 * @return              Other error codes as defined for the
    255255 *                      socket_bind_free_port() function.
    256  * @returns             Other error codes as defined for the
     256 * @return              Other error codes as defined for the
    257257 *                      socket_bind_insert() function.
    258258 */
    259259int
    260 socket_bind(socket_cores_ref local_sockets, socket_ports_ref global_sockets,
     260socket_bind(socket_cores_t *local_sockets, socket_ports_t *global_sockets,
    261261    int socket_id, void *addr, size_t addrlen, int free_ports_start,
    262262    int free_ports_end, int last_used_port)
    263263{
    264         socket_core_ref socket;
    265         socket_port_ref socket_port;
     264        socket_core_t *socket;
     265        socket_port_t *socket_port;
    266266        struct sockaddr *address;
    267267        struct sockaddr_in *address_in;
     
    322322 * @param[in] free_ports_end The maximum free port.
    323323 * @param[in] last_used_port The last used free port.
    324  * @returns             EOK on success.
    325  * @returns             ENOTCONN if no free port was found.
    326  * @returns             Other error codes as defined for the
     324 * @return              EOK on success.
     325 * @return              ENOTCONN if no free port was found.
     326 * @return              Other error codes as defined for the
    327327 *                      socket_bind_insert() function.
    328328 */
    329329int
    330 socket_bind_free_port(socket_ports_ref global_sockets, socket_core_ref socket,
     330socket_bind_free_port(socket_ports_t *global_sockets, socket_core_t *socket,
    331331    int free_ports_start, int free_ports_end, int last_used_port)
    332332{
     
    367367 *                      requested. A negative identifier is requested if set to
    368368 *                      false.
    369  * @returns             The new socket identifier.
    370  * @returns             ELIMIT if there is no socket identifier available.
    371  */
    372 static int socket_generate_new_id(socket_cores_ref local_sockets, int positive)
     369 * @return              The new socket identifier.
     370 * @return              ELIMIT if there is no socket identifier available.
     371 */
     372static int socket_generate_new_id(socket_cores_t *local_sockets, int positive)
    373373{
    374374        int socket_id;
     
    410410 *                      chosen if set to zero or negative. A negative identifier
    411411 *                      is chosen if set to negative.
    412  * @returns             EOK on success.
    413  * @returns             EINVAL if the socket_id parameter is NULL.
    414  * @returns             ENOMEM if there is not enough memory left.
     412 * @return              EOK on success.
     413 * @return              EINVAL if the socket_id parameter is NULL.
     414 * @return              ENOMEM if there is not enough memory left.
    415415 */
    416416int
    417 socket_create(socket_cores_ref local_sockets, int app_phone,
     417socket_create(socket_cores_t *local_sockets, int app_phone,
    418418    void *specific_data, int *socket_id)
    419419{
    420         socket_core_ref socket;
     420        socket_core_t *socket;
    421421        int positive;
    422422        int rc;
     
    437437        }
    438438       
    439         socket = (socket_core_ref) malloc(sizeof(*socket));
     439        socket = (socket_core_t *) malloc(sizeof(*socket));
    440440        if (!socket)
    441441                return ENOMEM;
     
    482482 * @param[in,out] global_sockets The global sockets to be updated.
    483483 * @param[in] socket_release The client release callback function.
    484  * @returns             EOK on success.
    485  * @returns             ENOTSOCK if the socket is not found.
     484 * @return              EOK on success.
     485 * @return              ENOTSOCK if the socket is not found.
    486486 */
    487487int
    488 socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets,
    489     socket_ports_ref global_sockets,
    490     void (*socket_release)(socket_core_ref socket))
    491 {
    492         socket_core_ref socket;
     488socket_destroy(int packet_phone, int socket_id, socket_cores_t *local_sockets,
     489    socket_ports_t *global_sockets,
     490    void (*socket_release)(socket_core_t *socket))
     491{
     492        socket_core_t *socket;
    493493        int accepted_id;
    494494
     
    516516 * @param[in] packet    The packet to be transfered.
    517517 * @param[out] length   The total data length.
    518  * @returns             EOK on success.
    519  * @returns             EBADMEM if the length parameter is NULL.
    520  * @returns             ENOMEM if there is not enough memory left.
    521  * @returns             Other error codes as defined for the data_reply()
     518 * @return              EOK on success.
     519 * @return              EBADMEM if the length parameter is NULL.
     520 * @return              ENOMEM if there is not enough memory left.
     521 * @return              Other error codes as defined for the data_reply()
    522522 *                      function.
    523523 */
     
    598598 * @param[in] key       The socket key identifier.
    599599 * @param[in] key_length The socket key length.
    600  * @returns             The found socket.
    601  * @returns             NULL if no socket was found.
    602  */
    603 socket_core_ref
    604 socket_port_find(socket_ports_ref global_sockets, int port, const char *key,
     600 * @return              The found socket.
     601 * @return              NULL if no socket was found.
     602 */
     603socket_core_t *
     604socket_port_find(socket_ports_t *global_sockets, int port, const char *key,
    605605    size_t key_length)
    606606{
    607         socket_port_ref socket_port;
    608         socket_core_ref *socket_ref;
     607        socket_port_t *socket_port;
     608        socket_core_t **socket_ref;
    609609
    610610        socket_port = socket_ports_find(global_sockets, port);
     
    628628 */
    629629void
    630 socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket)
    631 {
    632         socket_port_ref socket_port;
    633         socket_core_ref *socket_ref;
     630socket_port_release(socket_ports_t *global_sockets, socket_core_t *socket)
     631{
     632        socket_port_t *socket_port;
     633        socket_core_t **socket_ref;
    634634
    635635        if (!socket->port)
     
    673673 * @param[in] key       The socket key identifier.
    674674 * @param[in] key_length The socket key length.
    675  * @returns             EOK on success.
    676  * @returns             ENOENT if the port is not already used.
    677  * @returns             Other error codes as defined for the
     675 * @return              EOK on success.
     676 * @return              ENOENT if the port is not already used.
     677 * @return              Other error codes as defined for the
    678678 *                      socket_port_add_core() function.
    679679 */
    680680int
    681 socket_port_add(socket_ports_ref global_sockets, int port,
    682     socket_core_ref socket, const char *key, size_t key_length)
    683 {
    684         socket_port_ref socket_port;
     681socket_port_add(socket_ports_t *global_sockets, int port,
     682    socket_core_t *socket, const char *key, size_t key_length)
     683{
     684        socket_port_t *socket_port;
    685685        int rc;
    686686
  • uspace/lib/net/tl/tl_common.c

    rb4c9c61 rfdbc3ff  
    6464 * @param[in] addrlen   The address length.
    6565 * @param[out] port     The set port.
    66  * @returns             EOK on success.
    67  * @returns             EINVAL if the address length does not match the address
     66 * @return              EOK on success.
     67 * @return              EINVAL if the address length does not match the address
    6868 *                      family.
    69  * @returns             EAFNOSUPPORT if the address family is not supported.
     69 * @return              EAFNOSUPPORT if the address family is not supported.
    7070 */
    7171int
     
    120120int
    121121tl_get_ip_packet_dimension(int ip_phone,
    122     packet_dimensions_ref packet_dimensions, device_id_t device_id,
    123     packet_dimension_ref *packet_dimension)
     122    packet_dimensions_t *packet_dimensions, device_id_t device_id,
     123    packet_dimension_t **packet_dimension)
    124124{
    125125        int rc;
     
    158158 * @param[in] device_id The device identifier.
    159159 * @param[in] content   The new maximum content size.
    160  * @returns             EOK on success.
     160 * @return              EOK on success.
    161161 * @return              ENOENT if the packet dimension is not cached.
    162162 */
    163163int
    164 tl_update_ip_packet_dimension(packet_dimensions_ref packet_dimensions,
     164tl_update_ip_packet_dimension(packet_dimensions_t *packet_dimensions,
    165165    device_id_t device_id, size_t content)
    166166{
    167         packet_dimension_ref packet_dimension;
     167        packet_dimension_t *packet_dimension;
    168168
    169169        packet_dimension = packet_dimensions_find(packet_dimensions, device_id);
     
    196196 * @param[in] addrlen   The address length.
    197197 * @param[in] port      The port to be set.
    198  * @returns             EOK on success.
    199  * @returns             EINVAL if the address length does not match the address
     198 * @return              EOK on success.
     199 * @return              EINVAL if the address length does not match the address
    200200 *                      family.
    201  * @returns             EAFNOSUPPORT if the address family is not supported.
     201 * @return              EAFNOSUPPORT if the address family is not supported.
    202202 */
    203203int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port)
     
    244244 * @param[in] error     The packet error reporting service. Prefixes the
    245245 *                      received packet.
    246  * @returns             EOK on success.
    247  * @returns             ENOENT if no packet may be sent.
     246 * @return              EOK on success.
     247 * @return              ENOENT if no packet may be sent.
    248248 */
    249249int
     
    280280 * @param[in] addr      The destination address.
    281281 * @param[in] addrlen   The address length.
    282  * @returns             Number of bytes received.
    283  * @returns             EINVAL if the client does not send data.
    284  * @returns             ENOMEM if there is not enough memory left.
    285  * @returns             Other error codes as defined for the
     282 * @return              Number of bytes received.
     283 * @return              EINVAL if the client does not send data.
     284 * @return              ENOMEM if there is not enough memory left.
     285 * @return              Other error codes as defined for the
    286286 *                      async_data_read_finalize() function.
    287287 */
    288288int
    289 tl_socket_read_packet_data(int packet_phone, packet_ref packet, size_t prefix,
    290     const packet_dimension_ref dimension, const struct sockaddr *addr,
     289tl_socket_read_packet_data(int packet_phone, packet_t *packet, size_t prefix,
     290    const packet_dimension_t *dimension, const struct sockaddr *addr,
    291291    socklen_t addrlen)
    292292{
  • uspace/lib/packet/generic/packet_server.c

    rb4c9c61 rfdbc3ff  
    103103};
    104104
    105 int packet_translate_local(int phone, packet_ref packet, packet_id_t packet_id)
     105int packet_translate_local(int phone, packet_t *packet, packet_id_t packet_id)
    106106{
    107107        if (!packet)
     
    154154 * @param[in] max_content The maximal content length in bytes.
    155155 * @param[in] max_suffix The maximal suffix length in bytes.
    156  * @returns             The packet of dimensions at least as given.
    157  * @returns             NULL if there is not enough memory left.
     156 * @return              The packet of dimensions at least as given.
     157 * @return              NULL if there is not enough memory left.
    158158 */
    159159static packet_t
     
    278278 *
    279279 * @param[in] packet_id The first packet identifier.
    280  * @returns             EOK on success.
    281  * @returns             ENOENT if there is no such packet.
     280 * @return              EOK on success.
     281 * @return              ENOENT if there is no such packet.
    282282 */
    283283static int packet_release_wrapper(packet_id_t packet_id)
     
    303303/** Shares the packet memory block.
    304304 * @param[in] packet    The packet to be shared.
    305  * @returns             EOK on success.
    306  * @returns             EINVAL if the packet is not valid.
    307  * @returns             EINVAL if the calling module does not accept the memory.
    308  * @returns             ENOMEM if the desired and actual sizes differ.
    309  * @returns             Other error codes as defined for the
     305 * @return              EOK on success.
     306 * @return              EINVAL if the packet is not valid.
     307 * @return              EINVAL if the calling module does not accept the memory.
     308 * @return              ENOMEM if the desired and actual sizes differ.
     309 * @return              Other error codes as defined for the
    310310 *                      async_share_in_finalize() function.
    311311 */
     
    339339 * @param[out] answer_count The last parameter for the actual answer in the
    340340 *                      answer parameter.
    341  * @returns             EOK on success.
    342  * @returns             ENOMEM if there is not enough memory left.
    343  * @returns             ENOENT if there is no such packet as in the packet
     341 * @return              EOK on success.
     342 * @return              ENOMEM if there is not enough memory left.
     343 * @return              ENOENT if there is no such packet as in the packet
    344344 *                      message parameter.
    345  * @returns             ENOTSUP if the message is not known.
    346  * @returns             Other error codes as defined for the
     345 * @return              ENOTSUP if the message is not known.
     346 * @return              Other error codes as defined for the
    347347 *                      packet_release_wrapper() function.
    348348 */
  • uspace/lib/packet/include/packet_local.h

    rb4c9c61 rfdbc3ff  
    4343/*@{*/
    4444
    45 extern int packet_translate_local(int, packet_ref, packet_id_t);
     45extern int packet_translate_local(int, packet_t *, packet_id_t);
    4646extern packet_t packet_get_4_local(int, size_t, size_t, size_t, size_t);
    4747extern packet_t packet_get_1_local(int, size_t);
Note: See TracChangeset for help on using the changeset viewer.