[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NIST
Hi All
Please help me to confirm these problem:
The fucntion "cn_send()" in file "abrconnection3.c" has some problem like
this:
1. The assignment " Number_of_Cells=
(int)(pval(cn,cn_burst_length)->u.i);" is it right ?
2. This loop is not exact !?
for (j=0;j<Number_of_Cells;j++)
{
ev_enqueue(MY_SENDCELL,(Component *)cn,
(Component *)cn,
ev_now(),
abrconnection3_action,
(Cell *)NULL,NULL,
(caddr_t)NULL);
cn->cn_num_sent++;
}
Send some Cells nearly at the same time! I think that the function call
ev_enqueue(, , ,ev_now(), , , , ,) must be
ev_enqueue(, , ,ev_now() + "interval to send 424 bits of a cell", , , , ,)
Thanks you very much
Luan
This is function cn_send()
static caddr_t
cn_send(cn)
register BATCHConnectiont *cn;
{
VPI vpi=cn->cn_vpi;
register Cell *cell[1000];
tick_t interval,increment;
int i,j,time_now;
int Number_of_Cells,length;
tick_t time;
Neighbor *n;
if (USECS_TO_TICKS(pval(cn, cn_start_time)->u.i) <= ev_now() )
{
if (cn->cn_num_sent < (pval(cn,cn_trans_size)->u.d*1000000/424))
{
cn->cn_cbr_vbr=1;
/* if the # of cells sent is less than transmission size,
increment the # of cells sent and send a cell to the
bte */
Number_of_Cells= (int)(pval(cn,cn_burst_length)->u.i);
if (cn->cn_simple_connection == 0)
{
for (j=0;j<Number_of_Cells;j++)
{
ev_enqueue(MY_SENDCELL,(Component *)cn,
(Component *)cn,
ev_now(),
abrconnection3_action,
(Cell *)NULL,NULL,
(caddr_t)NULL);
cn->cn_num_sent++;
}
}
/* Then schedule an EV_SENDCELL for the next cycle */
ev_enqueue(EV_DONE_ON, (Component *)cn, (Component *)cn,
ev_now()+2*j, abrconnection3_action, (Cell *)NULL,
NULL, (caddr_t)NULL);
}
}
else {
interval = USECS_TO_TICKS(pval(cn, cn_start_time)->u.i);
ev_enqueue(EV_START, (Component *)cn, (Component *)cn,
ev_now()+
interval, cbrconnection_action, (Cell *)NULL, NULL,
(caddr_t)NULL);
}
return ((caddr_t)cn)
}