Rev 4192 | Rev 4582 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4192 | Rev 4505 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | #include <errno.h> |
38 | #include <errno.h> |
| 39 | #include <malloc.h> |
39 | #include <malloc.h> |
| 40 | #include <mem.h> |
40 | #include <mem.h> |
| 41 | #include <rwlock.h> |
41 | #include <rwlock.h> |
| 42 | //#include <stdio.h> |
42 | //#include <stdio.h> |
| - | 43 | #include <unistd.h> |
|
| 43 | 44 | ||
| 44 | #include <sys/mman.h> |
45 | #include <sys/mman.h> |
| 45 | 46 | ||
| 46 | #include "../../err.h" |
47 | #include "../../err.h" |
| 47 | 48 | ||
| 48 | #include "../generic_field.h" |
49 | #include "../generic_field.h" |
| 49 | 50 | ||
| 50 | #include "packet_header.h" |
- | |
| 51 | #include "packet.h" |
51 | #include "packet.h" |
| - | 52 | #include "packet_header.h" |
|
| 52 | 53 | ||
| 53 | /** Packet map page size. |
54 | /** Packet map page size. |
| 54 | */ |
55 | */ |
| 55 | #define PACKET_MAP_SIZE 100 |
56 | #define PACKET_MAP_SIZE 100 |
| 56 | 57 | ||
| Line 209... | Line 210... | ||
| 209 | }while( packet_is_valid( item )); |
210 | }while( packet_is_valid( item )); |
| 210 | } |
211 | } |
| 211 | return packet; |
212 | return packet; |
| 212 | } |
213 | } |
| 213 | 214 | ||
| - | 215 | int pq_insert_after( packet_t packet, packet_t new_packet ){ |
|
| - | 216 | packet_t item; |
|
| - | 217 | ||
| - | 218 | if( !( packet_is_valid( packet ) && packet_is_valid( new_packet ))) return EINVAL; |
|
| - | 219 | new_packet->previous = packet->packet_id; |
|
| - | 220 | new_packet->next = packet->next; |
|
| - | 221 | item = pm_find( packet->next ); |
|
| - | 222 | if( item ) item->previous = new_packet->packet_id; |
|
| - | 223 | packet->next = new_packet->packet_id; |
|
| - | 224 | return EOK; |
|
| - | 225 | } |
|
| - | 226 | ||
| 214 | packet_t pq_detach( packet_t packet ){ |
227 | packet_t pq_detach( packet_t packet ){ |
| 215 | packet_t next; |
228 | packet_t next; |
| 216 | packet_t previous; |
229 | packet_t previous; |
| 217 | 230 | ||
| 218 | if( ! packet_is_valid( packet )) return NULL; |
231 | if( ! packet_is_valid( packet )) return NULL; |