Download Diplôme 2007

Transcript
Soekirs Based MP
typedef struct sendBuffer
This data structure hold a buffer for the senderThread. It associate the
buffer, with a consumer destination address and hold the amount of byte
and captured PDU in the buffer
struct sendBuffer s*
UINT8
next
dstAddr[6]
UINT16
int
int
unsigned char
dstType
byteCount
pktCount
buffer[BUFFER LENGTH]
Pointer to the next buffer
Destination address corresponding to this
buffer
Ethertype corresponding to this buffer
Amount of databyte in buffer
Amount of PDUs stored in buffer
Local buffer to store data before send them
extern senderBuffer* bufferList;
Pointer to the first buffer.
void sender Thread(void* args)
Sender thread code. This thread build a capture header for all PDU received
from the filter thread and store the in a local buffer. Once this buffer is
full, it build a measurement frame and send it on the MArN using Ethernet
multicast to all the consumers present on the MArN.
Parameters :
void* args Its own thread descriptor
void flush(int sock, senderBuffer* sb)
Flush the given buffer sb. When a buffer is flushed, it’s data are send to
the corresponding consumer using the given socket sock.
Parameters :
int
sock
sendBuffer* sb
The socket to use for transmission.
The buffer to flush
void makeNewFrame(senderBuffer* sb)
Reset memory (set to 0x00) of the given buffer and build the Measurement
Header. Then sent its byte & packet count to zero
Parameters :
sendBuffer* sb
Antoine Zen-Ruffinen
The buffer to reset
36