Changeset 849ed54 in mainline for uspace/lib/socket/include/packet
- Timestamp:
- 2010-03-30T18:39:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7553689
- Parents:
- 7d6fe4db
- Location:
- uspace/lib/socket/include/packet
- Files:
-
- 5 moved
-
packet.h (moved) (moved from uspace/srv/net/structures/packet/packet.h ) (12 diffs)
-
packet_client.h (moved) (moved from uspace/srv/net/structures/packet/packet_client.h ) (14 diffs)
-
packet_header.h (moved) (moved from uspace/srv/net/structures/packet/packet_header.h ) (1 diff)
-
packet_messages.h (moved) (moved from uspace/srv/net/structures/packet/packet_messages.h ) (1 diff)
-
packet_server.h (moved) (moved from uspace/srv/net/structures/packet/packet_server.h ) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/socket/include/packet/packet.h
r7d6fe4db r849ed54 89 89 * @returns NULL if the mapping does not exist. 90 90 */ 91 packet_t pm_find(packet_id_t packet_id);91 extern packet_t pm_find(packet_id_t packet_id); 92 92 93 93 /** Adds the packet mapping. … … 98 98 * @returns ENOMEM if there is not enough memory left. 99 99 */ 100 int pm_add(packet_t packet);100 extern int pm_add(packet_t packet); 101 101 102 102 /** Initializes the packet map. … … 104 104 * @returns ENOMEM if there is not enough memory left. 105 105 */ 106 int pm_init(void);106 extern int pm_init(void); 107 107 108 108 /** Releases the packet map. 109 109 */ 110 void pm_destroy(void);110 extern void pm_destroy(void); 111 111 112 112 /** Add packet to the sorted queue. … … 121 121 * @returns EINVAL if the packet is not valid. 122 122 */ 123 int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric);123 extern int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric); 124 124 125 125 /** Finds the packet with the given order. … … 130 130 * @returns NULL if the packet is not found. 131 131 */ 132 packet_t pq_find(packet_t first, size_t order);132 extern packet_t pq_find(packet_t first, size_t order); 133 133 134 134 /** Inserts packet after the given one. … … 138 138 * @returns EINVAL if etiher of the packets is invalid. 139 139 */ 140 int pq_insert_after(packet_t packet, packet_t new_packet);140 extern int pq_insert_after(packet_t packet, packet_t new_packet); 141 141 142 142 /** Detach the packet from the queue. … … 146 146 * @returns NULL if the packet is not valid. 147 147 */ 148 packet_t pq_detach(packet_t packet);148 extern packet_t pq_detach(packet_t packet); 149 149 150 150 /** Sets the packet order and metric attributes. … … 155 155 * @returns EINVAL if the packet is invalid.. 156 156 */ 157 int pq_set_order(packet_t packet, size_t order, size_t metric);157 extern int pq_set_order(packet_t packet, size_t order, size_t metric); 158 158 159 159 /** Sets the packet order and metric attributes. … … 164 164 * @returns EINVAL if the packet is invalid.. 165 165 */ 166 int pq_get_order(packet_t packet, size_t * order, size_t * metric);166 extern int pq_get_order(packet_t packet, size_t * order, size_t * metric); 167 167 168 168 /** Releases the whole queue. … … 171 171 * @param[in] packet_release The releasing function called for each of the packets after its detachment. 172 172 */ 173 void pq_destroy(packet_t first, void (*packet_release)(packet_t packet));173 extern void pq_destroy(packet_t first, void (*packet_release)(packet_t packet)); 174 174 175 175 /** Returns the next packet in the queue. … … 179 179 * @returns NULL if the packet is not valid. 180 180 */ 181 packet_t pq_next(packet_t packet);181 extern packet_t pq_next(packet_t packet); 182 182 183 183 /** Returns the previous packet in the queue. … … 187 187 * @returns NULL if the packet is not valid. 188 188 */ 189 packet_t pq_previous(packet_t packet);189 extern packet_t pq_previous(packet_t packet); 190 190 191 191 /*@}*/ -
uspace/lib/socket/include/packet/packet_client.h
r7d6fe4db r849ed54 88 88 * @returns NULL if there is not enough memory left. 89 89 */ 90 void * packet_prefix(packet_t packet, size_t length);90 extern void * packet_prefix(packet_t packet, size_t length); 91 91 92 92 /** Allocates the specified space right after the actual packet content and returns its pointer. … … 96 96 * @returns NULL if there is not enough memory left. 97 97 */ 98 void * packet_suffix(packet_t packet, size_t length);98 extern void * packet_suffix(packet_t packet, size_t length); 99 99 100 100 /** Trims the actual packet content by the specified prefix and suffix lengths. … … 106 106 * @returns ENOMEM if there is not enough memory left. 107 107 */ 108 int packet_trim(packet_t packet, size_t prefix, size_t suffix);108 extern int packet_trim(packet_t packet, size_t prefix, size_t suffix); 109 109 110 110 /** Copies the specified data to the beginning of the actual packet content. … … 117 117 * @returns ENOMEM if there is not enough memory left. 118 118 */ 119 int packet_copy_data(packet_t packet, const void * data, size_t length);119 extern int packet_copy_data(packet_t packet, const void * data, size_t length); 120 120 121 121 /** Returns the packet identifier. … … 124 124 * @returns Zero (0) if the packet is not valid. 125 125 */ 126 packet_id_t packet_get_id(const packet_t packet);126 extern packet_id_t packet_get_id(const packet_t packet); 127 127 128 128 /** Returns the packet content length. … … 131 131 * @returns Zero (0) if the packet is not valid. 132 132 */ 133 size_t packet_get_data_length(const packet_t packet);133 extern size_t packet_get_data_length(const packet_t packet); 134 134 135 135 /** Returns the pointer to the beginning of the packet content. … … 138 138 * @returns NULL if the packet is not valid. 139 139 */ 140 void * packet_get_data(const packet_t packet);140 extern void * packet_get_data(const packet_t packet); 141 141 142 142 /** Returns the stored packet addresses and their length. … … 148 148 * @returns EINVAL if the packet is not valid. 149 149 */ 150 int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest);150 extern int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest); 151 151 152 152 /** Sets the packet addresses. … … 159 159 * @returns ENOMEM if there is not enough memory left. 160 160 */ 161 int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);161 extern int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len); 162 162 163 163 /** Translates the packet identifier to the packet reference. … … 172 172 * @returns Other error codes as defined for the packet_return() function. 173 173 */ 174 int packet_translate(int phone, packet_ref packet, packet_id_t packet_id);174 extern int packet_translate(int phone, packet_ref packet, packet_id_t packet_id); 175 175 176 176 /** Obtains the packet of the given dimensions. … … 184 184 * @returns NULL on error. 185 185 */ 186 packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);186 extern packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix); 187 187 188 188 /** Obtains the packet of the given content size. … … 193 193 * @returns NULL on error. 194 194 */ 195 packet_t packet_get_1(int phone, size_t content);195 extern packet_t packet_get_1(int phone, size_t content); 196 196 197 197 /** Releases the packet queue. … … 202 202 * @param[in] packet_id The packet identifier. 203 203 */ 204 void pq_release(int phone, packet_id_t packet_id);204 extern void pq_release(int phone, packet_id_t packet_id); 205 205 206 206 /** Returns the packet copy. … … 212 212 * @returns NULL on error. 213 213 */ 214 packet_t packet_get_copy(int phone, packet_t packet);214 extern packet_t packet_get_copy(int phone, packet_t packet); 215 215 216 216 /*@}*/ -
uspace/lib/socket/include/packet/packet_header.h
r7d6fe4db r849ed54 38 38 #define __NET_PACKET_HEADER_H__ 39 39 40 #include "packet.h"40 #include <packet/packet.h> 41 41 42 42 /** Returns the actual packet data length. -
uspace/lib/socket/include/packet/packet_messages.h
r7d6fe4db r849ed54 40 40 #include <ipc/ipc.h> 41 41 42 #include "../../messages.h"42 #include <net_messages.h> 43 43 44 44 /** Packet server module messages. -
uspace/lib/socket/include/packet/packet_server.h
r7d6fe4db r849ed54 56 56 * @returns Other error codes as defined for the packet_release_wrapper() function. 57 57 */ 58 int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);58 extern int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 59 59 60 60 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
