Packet tunneling over UDP, multiple channels
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
480 B

  1. #ifndef queue_H
  2. #define queue_H
  3. #include "sockaddr.h"
  4. #include <semaphore.h>
  5. #include <pthread.h>
  6. typedef struct _QueueItem {
  7. struct _QueueItem *next;
  8. char data[];
  9. } QueueItem;
  10. typedef struct _Queue {
  11. QueueItem *head;
  12. QueueItem *last;
  13. sem_t count;
  14. pthread_mutex_t mutex;
  15. } Queue;
  16. extern void Queue_addItem(Queue *list,QueueItem *item);
  17. extern QueueItem *Queue_getItem(Queue *list);
  18. extern void Queue_initialize(Queue *list,int n,size_t size);
  19. #endif