Changeset 46d4d9f in mainline for uspace/lib/net/generic


Ignore:
Timestamp:
2010-11-20T17:04:59Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd5046dd
Parents:
fdbc3ff
Message:

Redefine packet_t to be just a type alias for struct packet.

Location:
uspace/lib/net/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/packet_client.c

    rfdbc3ff r46d4d9f  
    5757 * @return              ENOMEM if there is not enough memory left.
    5858 */
    59 int packet_copy_data(packet_t packet, const void *data, size_t length)
     59int packet_copy_data(packet_t *packet, const void *data, size_t length)
    6060{
    6161        if (!packet_is_valid(packet))
     
    8181 * @return              NULL if there is not enough memory left.
    8282 */
    83 void *packet_prefix(packet_t packet, size_t length)
     83void *packet_prefix(packet_t *packet, size_t length)
    8484{
    8585        if ((!packet_is_valid(packet)) ||
    86             (packet->data_start - sizeof(struct packet) -
     86            (packet->data_start - sizeof(packet_t) -
    8787            2 * (packet->dest_addr - packet->src_addr) < length)) {
    8888                return NULL;
     
    102102 * @return              NULL if there is not enough memory left.
    103103 */
    104 void *packet_suffix(packet_t packet, size_t length)
     104void *packet_suffix(packet_t *packet, size_t length)
    105105{
    106106        if ((!packet_is_valid(packet)) ||
     
    124124 * @return              ENOMEM if there is not enough memory left.
    125125 */
    126 int packet_trim(packet_t packet, size_t prefix, size_t suffix)
     126int packet_trim(packet_t *packet, size_t prefix, size_t suffix)
    127127{
    128128        if (!packet_is_valid(packet))
     
    143143 * @return              Zero if the packet is not valid.
    144144 */
    145 packet_id_t packet_get_id(const packet_t packet)
     145packet_id_t packet_get_id(const packet_t *packet)
    146146{
    147147        return packet_is_valid(packet) ? packet->packet_id : 0;
     
    157157 * @return              EINVAL if the packet is not valid.
    158158 */
    159 int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)
     159int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest)
    160160{
    161161        if (!packet_is_valid(packet))
     
    177177 * @return              Zero if the packet is not valid.
    178178 */
    179 size_t packet_get_data_length(const packet_t packet)
     179size_t packet_get_data_length(const packet_t *packet)
    180180{
    181181        if (!packet_is_valid(packet))
     
    191191 * @return              NULL if the packet is not valid.
    192192 */
    193 void *packet_get_data(const packet_t packet)
     193void *packet_get_data(const packet_t *packet)
    194194{
    195195        if (!packet_is_valid(packet))
     
    210210 */
    211211int
    212 packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,
     212packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest,
    213213    size_t addr_len)
    214214{
     
    257257 * @return              NULL on error.
    258258 */
    259 packet_t packet_get_copy(int phone, packet_t packet)
    260 {
    261         packet_t copy;
     259packet_t *packet_get_copy(int phone, packet_t *packet)
     260{
     261        packet_t *copy;
    262262        uint8_t * src = NULL;
    263263        uint8_t * dest = NULL;
  • uspace/lib/net/generic/packet_remote.c

    rfdbc3ff r46d4d9f  
    6464 */
    6565static int
    66 packet_return(int phone, packet_t *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;
     
    7272        message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
    7373
    74         *packet = (packet_t) as_get_mappable_page(size);
     74        *packet = (packet_t *) as_get_mappable_page(size);
    7575        rc = async_share_in_start_0_0(phone, *packet, size);
    7676        if (rc != EOK) {
     
    107107 *                      function.
    108108 */
    109 int packet_translate_remote(int phone, packet_t *packet, packet_id_t packet_id)
     109int packet_translate_remote(int phone, packet_t **packet, packet_id_t packet_id)
    110110{
    111111        int rc;
     
    127127        }
    128128        if ((*packet)->next) {
    129                 packet_t next;
     129                packet_t *next;
    130130               
    131131                return packet_translate_remote(phone, &next, (*packet)->next);
     
    148148 * @return              NULL on error.
    149149 */
    150 packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
     150packet_t *packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
    151151    size_t max_prefix, size_t max_suffix)
    152152{
     
    161161       
    162162       
    163         packet_t packet = pm_find(packet_id);
     163        packet_t *packet = pm_find(packet_id);
    164164        if (!packet) {
    165165                rc = packet_return(phone, &packet, packet_id, size);
     
    180180 * @return              NULL on error.
    181181 */
    182 packet_t packet_get_1_remote(int phone, size_t content)
     182packet_t *packet_get_1_remote(int phone, size_t content)
    183183{
    184184        ipcarg_t packet_id;
     
    191191                return NULL;
    192192       
    193         packet_t packet = pm_find(packet_id);
     193        packet_t *packet = pm_find(packet_id);
    194194        if (!packet) {
    195195                rc = packet_return(phone, &packet, packet_id, size);
Note: See TracChangeset for help on using the changeset viewer.