Main Page | Class List | File List | Class Members | File Members

scheduler.h File Reference

Go to the source code of this file.

Defines

#define TCP_MAX_QUEUES   (2*TCP_MAX_CONN)
#define TCP_PACKET_TIMEOUT   5000
#define DRR_QUANTUM   365

Enumerations

enum  { QUEUE_SIZE_HI_PRI = 256, QUEUE_SIZE_TCP = 50, QUEUE_SIZE_LOW_PRI = 1024 }
enum  { QUEUE_WEIGHT_HIGH = 6, QUEUE_WEIGHT_NORMAL = 2, QUEUE_WEIGHT_LOW = 1 }

Functions

void init_sched ()
int alloc_tcp_queue (unsigned weight)
int close_tcp_queue (int queue_num)
int reset_tcp_queue (int queue_num)
void cleanup_sched ()
void mh_ack_rcvd (unsigned ack_seq, int queue_num)
int queue_tcp (Tpacket_data *pd, int queue_num)
int queue_hipri (Tpacket_data *pd)
int queue_lowpri (Tpacket_data *pd)
void scheduler (void *ptr)


Define Documentation

#define DRR_QUANTUM   365
 

Definition at line 10 of file scheduler.h.

Referenced by scheduler().

#define TCP_MAX_QUEUES   (2*TCP_MAX_CONN)
 

Definition at line 8 of file scheduler.h.

Referenced by alloc_tcp_queue(), check_dealloc_tcp_queue(), cleanup_sched(), clear_tcp_queue(), close_tcp_queue(), init_sched(), queue_packet(), queue_tcp(), reset_tcp_queue(), and scheduler().

#define TCP_PACKET_TIMEOUT   5000
 

Definition at line 9 of file scheduler.h.

Referenced by add_tcp_sent().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
QUEUE_SIZE_HI_PRI 
QUEUE_SIZE_TCP 
QUEUE_SIZE_LOW_PRI 

Definition at line 14 of file scheduler.h.

anonymous enum
 

Enumeration values:
QUEUE_WEIGHT_HIGH 
QUEUE_WEIGHT_NORMAL 
QUEUE_WEIGHT_LOW 

Definition at line 21 of file scheduler.h.


Function Documentation

int alloc_tcp_queue unsigned  weight  ) 
 

Definition at line 239 of file scheduler.c.

References DPRINT, mutex_lock(), mutex_unlock(), QUEUE_STATE_FREE, QUEUE_STATE_USED, sched_mut, packet_queue::state, TCP_MAX_QUEUES, and packet_queue::weight.

Referenced by alloc_tcp_cb().

void cleanup_sched  ) 
 

Definition at line 400 of file scheduler.c.

References clear_tcp_queue(), QUEUE_STATE_FREE, send_sem, sock, packet_queue::state, packet_queue::tab, TCP_MAX_QUEUES, and xfree().

Referenced by main().

int close_tcp_queue int  queue_num  ) 
 

Definition at line 267 of file scheduler.c.

References DPRINT, mutex_lock(), mutex_unlock(), QUEUE_STATE_CLOSED, QUEUE_STATE_USED, sched_mut, packet_queue::state, and TCP_MAX_QUEUES.

Referenced by dealloc_tcp_cb().

void init_sched  ) 
 

Definition at line 67 of file scheduler.c.

References packet_queue::dc, EPRINT, EXIT_ERR_SEM_INIT, EXIT_ERR_SOCKET, packet_queue::head, packet_queue::in_flight, packet_queue::max, QUEUE_SIZE_HI_PRI, QUEUE_SIZE_LOW_PRI, QUEUE_SIZE_TCP, QUEUE_STATE_FREE, QUEUE_STATE_USED, QUEUE_WEIGHT_NORMAL, queued_pkts, safe_exit(), sched_mut, send_sem, packet_queue::sent_hd, sock, packet_queue::state, packet_queue::tab, packet_queue::tail, tcp_in_flight, TCP_MAX_QUEUES, packet_queue::weight, and xmalloc().

Referenced by main().

void mh_ack_rcvd unsigned  ack_seq,
int  queue_num
 

Definition at line 515 of file scheduler.c.

References check_dealloc_tcp_queue(), clear_timer(), DPRINT, packet_queue::in_flight, mutex_lock(), mutex_unlock(), packet_sent::next, packet_timeout(), packet_sent::prev, sched_mut, send_sem, packet_queue::sent_hd, packet_sent::seq, seq_cmp(), packet_sent::size, tcp_in_flight, and xfree().

Referenced by handle_tcp().

int queue_hipri Tpacket_data pd  ) 
 

Definition at line 582 of file scheduler.c.

References packet_data::dir, DPRINT, PACKET_DIR_IN, PACKET_DIR_OUT, queue_packet(), send_packet(), and UNREACHABLE.

Referenced by handle_icmp(), handle_tcp(), and send_tcp_rst().

int queue_lowpri Tpacket_data pd  ) 
 

Definition at line 599 of file scheduler.c.

References packet_data::dir, DPRINT, PACKET_DIR_IN, PACKET_DIR_OUT, queue_packet(), send_packet(), and UNREACHABLE.

Referenced by handle_other().

int queue_tcp Tpacket_data pd,
int  queue_num
 

Definition at line 555 of file scheduler.c.

References packet_data::dir, DPRINT, PACKET_DIR_IN, PACKET_DIR_OUT, queue_packet(), send_packet(), TCP_MAX_QUEUES, packet_data::trans, and UNREACHABLE.

Referenced by handle_tcp().

int reset_tcp_queue int  queue_num  ) 
 

Definition at line 357 of file scheduler.c.

References clear_tcp_queue(), mutex_lock(), mutex_unlock(), QUEUE_STATE_USED, sched_mut, and TCP_MAX_QUEUES.

Referenced by handle_tcp().

void scheduler void *  ptr  ) 
 

Definition at line 620 of file scheduler.c.

References add_tcp_sent(), check_dealloc_tcp_queue(), packet_queue::dc, dequeue_packet(), DPRINT, DRR_QUANTUM, EPRINT, packet_queue::head, packet_queue::in_flight, packet_queue::max, max_tcp_in_flight, mutex_lock(), mutex_unlock(), queue_empty(), queue_size(), QUEUE_STATE_FREE, queued_pkts, request_exit, sched_mut, send_packet(), send_sem, packet_queue::state, packet_queue::tab, tcp_data_size(), tcp_in_flight, TCP_MAX_QUEUES, and packet_queue::weight.

Referenced by main().


Generated on Sun May 14 13:36:53 2006 by  doxygen 1.4.2