10_7_Queuing

10_7_Queuing - call gives the memory that was used previously so the processor can use it again memory leak memory disappears and no one knows why

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
http://en.wikipedia.org/wiki/Ip_(struct) struct ip { unsigned int ip_hl : 4 ; /* both fields are 4 bits */ like a 4 bit field, allocate 4 bits unsigned int ip_v : 4 ; uint8_t ip_tos ; uint16_t ip_len ; uint16_t ip_id ; uint16_t ip_off ; uint8_t ip_ttl ; uint8_t ip_p ; uint16_t ip_sum ; struct in_addr ip_src ; struct in_addr ip_dst ; } ; Ip packet header Stored this way malloc( ); memory allocation malloc(20); 20 bytes worth returns a pointer of the location of memory chart *ptr; malloc return 0 if cannot allocate free(ptr) // opposite of malloc, frees memeory, done with the memory, supposed to call a free
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: call, gives the memory that was used previously so the processor can use it again memory leak- memory disappears and no one knows why malloc( sizeof(ip) ) ptr to that structure ip *pt; ptr = (ip*) ptr ip_tos skb buffer- standard linux holds packets union almost like a structure, allocate space for one of many types how to implement a queue-Need to store -Using physics to store packets, fiber optics--------| | | | | -------O-----Queue servers Queue of pointers...
View Full Document

This note was uploaded on 11/02/2011 for the course ECE 158a taught by Professor Cruz during the Spring '11 term at UCSD.

Ask a homework question - tutors are online