hi all ,
i hope you can help me with the following :
in types.h :
/* Structure of input buffer for each switch */
typedef struct InputBuffer *InputBufferPtr;
typedef struct {
struct List **fifo; /* Input fifos: one per output. */
void *traffic; /* Placeholder for traffic stats for this input */
int (*trafficModel)(); /* Traffic generating function */
Stat bufferStats; /* Aggregate occupancy statistics for this input. */
struct Histogram bufferHistogram; /* Agg occupancy statistics for this input. */
int numOverflows; /* Total number of cells dropped at this input. */
struct List **mcastFifo; /* Multicast queue for this input. */
// #ifdef use_gbvoq
struct List *inputPriorityList ; /* IPL queue for this input. */
// #endif
} InputBuffer;
in create.c :
#ifdef use_gbvoq
inputBuffer->inputPriorityList = (struct List *)malloc( sizeof(struct List)) ;
if( inputBuffer->inputPriorityList == NULL ) FatalError("createInputBuffer(): Malloc failed.\n") ;
assert( inputBuffer->inputPriorityList != NULL ) ;
inputBuffer->inputPriorityList = createList(inputBufferName) ;
#endif
but, i am going to make use of the linked list inputPriorityList in defaultInputAction.c :
assert( aSwitch->inputBuffer[input]->inputPriorityList != NULL ) ;
/* Add cell to IPL. */
if( aSwitch->inputBuffer[input]->fifo[pri]->number == 1 ) /* Cell has already been added to a VOQ. = empty VOQ. */
addElementAtHead(aSwitch->inputBuffer[input]->inputPriorityList, anElement) ;
the assert fails and if i remove it, i get a bus error in
addElementAtHead fuction
Basically, the aSwitch->inputBuffer[input]->inputPriorityList is NULL and i do NOT know WHY ...
i would be thankful if you help me overcome this problem
thanx