Changeset 849ed54 in mainline for uspace/lib/socket/include/packet


Ignore:
Timestamp:
2010-03-30T18:39:04Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7553689
Parents:
7d6fe4db
Message:

Networking work:
Split the networking stack into end-user library (libsocket) and two helper libraries (libnet and libnetif).
Don't use over-the-hand compiling and linking, but rather separation of conserns.
There might be still some issues and the non-modular networking architecture is currently broken, but this will be fixed soon.

Location:
uspace/lib/socket/include/packet
Files:
5 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/socket/include/packet/packet.h

    r7d6fe4db r849ed54  
    8989 *  @returns NULL if the mapping does not exist.
    9090 */
    91 packet_t pm_find(packet_id_t packet_id);
     91extern packet_t pm_find(packet_id_t packet_id);
    9292
    9393/** Adds the packet mapping.
     
    9898 *  @returns ENOMEM if there is not enough memory left.
    9999 */
    100 int pm_add(packet_t packet);
     100extern int pm_add(packet_t packet);
    101101
    102102/** Initializes the packet map.
     
    104104 *  @returns ENOMEM if there is not enough memory left.
    105105 */
    106 int pm_init(void);
     106extern int pm_init(void);
    107107
    108108/** Releases the packet map.
    109109 */
    110 void pm_destroy(void);
     110extern void pm_destroy(void);
    111111
    112112/** Add packet to the sorted queue.
     
    121121 *  @returns EINVAL if the packet is not valid.
    122122 */
    123 int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric);
     123extern int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric);
    124124
    125125/** Finds the packet with the given order.
     
    130130 *  @returns NULL if the packet is not found.
    131131 */
    132 packet_t pq_find(packet_t first, size_t order);
     132extern packet_t pq_find(packet_t first, size_t order);
    133133
    134134/** Inserts packet after the given one.
     
    138138 *  @returns EINVAL if etiher of the packets is invalid.
    139139 */
    140 int pq_insert_after(packet_t packet, packet_t new_packet);
     140extern int pq_insert_after(packet_t packet, packet_t new_packet);
    141141
    142142/** Detach the packet from the queue.
     
    146146 *  @returns NULL if the packet is not valid.
    147147 */
    148 packet_t pq_detach(packet_t packet);
     148extern packet_t pq_detach(packet_t packet);
    149149
    150150/** Sets the packet order and metric attributes.
     
    155155 *  @returns EINVAL if the packet is invalid..
    156156 */
    157 int pq_set_order(packet_t packet, size_t order, size_t metric);
     157extern int pq_set_order(packet_t packet, size_t order, size_t metric);
    158158
    159159/** Sets the packet order and metric attributes.
     
    164164 *  @returns EINVAL if the packet is invalid..
    165165 */
    166 int pq_get_order(packet_t packet, size_t * order, size_t * metric);
     166extern int pq_get_order(packet_t packet, size_t * order, size_t * metric);
    167167
    168168/** Releases the whole queue.
     
    171171 *  @param[in] packet_release The releasing function called for each of the packets after its detachment.
    172172 */
    173 void pq_destroy(packet_t first, void (*packet_release)(packet_t packet));
     173extern void pq_destroy(packet_t first, void (*packet_release)(packet_t packet));
    174174
    175175/** Returns the next packet in the queue.
     
    179179 *  @returns NULL if the packet is not valid.
    180180 */
    181 packet_t pq_next(packet_t packet);
     181extern packet_t pq_next(packet_t packet);
    182182
    183183/** Returns the previous packet in the queue.
     
    187187 *  @returns NULL if the packet is not valid.
    188188 */
    189 packet_t pq_previous(packet_t packet);
     189extern packet_t pq_previous(packet_t packet);
    190190
    191191/*@}*/
  • uspace/lib/socket/include/packet/packet_client.h

    r7d6fe4db r849ed54  
    8888 *  @returns NULL if there is not enough memory left.
    8989 */
    90 void * packet_prefix(packet_t packet, size_t length);
     90extern void * packet_prefix(packet_t packet, size_t length);
    9191
    9292/** Allocates the specified space right after the actual packet content and returns its pointer.
     
    9696 *  @returns NULL if there is not enough memory left.
    9797 */
    98 void * packet_suffix(packet_t packet, size_t length);
     98extern void * packet_suffix(packet_t packet, size_t length);
    9999
    100100/** Trims the actual packet content by the specified prefix and suffix lengths.
     
    106106 *  @returns ENOMEM if there is not enough memory left.
    107107 */
    108 int packet_trim(packet_t packet, size_t prefix, size_t suffix);
     108extern int packet_trim(packet_t packet, size_t prefix, size_t suffix);
    109109
    110110/** Copies the specified data to the beginning of the actual packet content.
     
    117117 *  @returns ENOMEM if there is not enough memory left.
    118118 */
    119 int packet_copy_data(packet_t packet, const void * data, size_t length);
     119extern int packet_copy_data(packet_t packet, const void * data, size_t length);
    120120
    121121/** Returns the packet identifier.
     
    124124 *  @returns Zero (0) if the packet is not valid.
    125125 */
    126 packet_id_t packet_get_id(const packet_t packet);
     126extern packet_id_t packet_get_id(const packet_t packet);
    127127
    128128/** Returns the packet content length.
     
    131131 *  @returns Zero (0) if the packet is not valid.
    132132 */
    133 size_t packet_get_data_length(const packet_t packet);
     133extern size_t packet_get_data_length(const packet_t packet);
    134134
    135135/** Returns the pointer to the beginning of the packet content.
     
    138138 *  @returns NULL if the packet is not valid.
    139139 */
    140 void * packet_get_data(const packet_t packet);
     140extern void * packet_get_data(const packet_t packet);
    141141
    142142/** Returns the stored packet addresses and their length.
     
    148148 *  @returns EINVAL if the packet is not valid.
    149149 */
    150 int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest);
     150extern int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest);
    151151
    152152/** Sets the packet addresses.
     
    159159 *  @returns ENOMEM if there is not enough memory left.
    160160 */
    161 int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);
     161extern int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);
    162162
    163163/** Translates the packet identifier to the packet reference.
     
    172172 *  @returns Other error codes as defined for the packet_return() function.
    173173 */
    174 int packet_translate(int phone, packet_ref packet, packet_id_t packet_id);
     174extern int packet_translate(int phone, packet_ref packet, packet_id_t packet_id);
    175175
    176176/** Obtains the packet of the given dimensions.
     
    184184 *  @returns NULL on error.
    185185 */
    186 packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
     186extern packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
    187187
    188188/** Obtains the packet of the given content size.
     
    193193 *  @returns NULL on error.
    194194 */
    195 packet_t packet_get_1(int phone, size_t content);
     195extern packet_t packet_get_1(int phone, size_t content);
    196196
    197197/** Releases the packet queue.
     
    202202 *  @param[in] packet_id The packet identifier.
    203203 */
    204 void pq_release(int phone, packet_id_t packet_id);
     204extern void pq_release(int phone, packet_id_t packet_id);
    205205
    206206/** Returns the packet copy.
     
    212212 *  @returns NULL on error.
    213213 */
    214 packet_t packet_get_copy(int phone, packet_t packet);
     214extern packet_t packet_get_copy(int phone, packet_t packet);
    215215
    216216/*@}*/
  • uspace/lib/socket/include/packet/packet_header.h

    r7d6fe4db r849ed54  
    3838#define __NET_PACKET_HEADER_H__
    3939
    40 #include "packet.h"
     40#include <packet/packet.h>
    4141
    4242/** Returns the actual packet data length.
  • uspace/lib/socket/include/packet/packet_messages.h

    r7d6fe4db r849ed54  
    4040#include <ipc/ipc.h>
    4141
    42 #include "../../messages.h"
     42#include <net_messages.h>
    4343
    4444/** Packet server module messages.
  • uspace/lib/socket/include/packet/packet_server.h

    r7d6fe4db r849ed54  
    5656 *  @returns Other error codes as defined for the packet_release_wrapper() function.
    5757 */
    58 int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     58extern int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    5959
    6060#endif
Note: See TracChangeset for help on using the changeset viewer.