NetBuf Class Reference

#include <RioNeti.h>

Public Member Functions

void GetIPAndPort (int *ip, int *port)
 GetIPAndPort retorna o ip (o campo nb_toipaddr) e a porta (o campo nb_toipport).
unsigned long long int GetTimeBetweenCredits ()
 GetTimeBetweenCredits retorna o tempo entre as atualizacoes do credito do cliente (do campo nb_timebetweencredits da classe).
int GetFragmentInfo (char **FragmentData, int *FragmentSize)
 GetFragmentInfo copia e retorna as informacoes de um fragmento do objeto NetBuf.

Private Member Functions

 NetBuf ()
 ~NetBuf ()
 DQUEUE (NetBuf) nb_tidq

Private Attributes

u16 rq_fraglist [RQ_MAXACKLIST]
NetBufnb_link
int nb_reqid
struct timeval nb_tiwhen
int rq_fragsh
int rq_fragburst
int rq_burstcnt
NetBufnb_outnext
int rq_fraglistn
int nb_sendack
int nb_hisreqid
time_t nb_frag0arrive
bool nb_unicastRequested
int rq_maxpktl
int rq_fraglen0
int rq_fraglen
int rq_fragmax
int rq_fraghav
int rq_fragDiscarded
int rq_fraghigh
int rq_fraglow
int rq_needack
int rq_fragackseq
int rq_retry
int rq_retryfrag
int rq_retrytim
char rq_bits [256]
u32 nb_result
RioNetinb_rioneti
char * nb_blockp
int nb_blockl
int nb_toipaddr
int nb_toipport
char * nb_bufp
int nb_bufl
int nb_recvl
char * nb_datap
char * nb_datalm
char * nb_sendp
int nb_sendl
char nb_buf [FRAGMENTSIZE]
void * nb_userparm
callback_t nb_usercall
cmdcallback_t nb_usercmd
void(* nb_outrtn )(NetBuf *)
void(* nb_callback )(struct NetBuf *, int type, char *pkt, int pktl)
unsigned long long int nb_timebetweencredits

Static Private Attributes

static const int RQ_BURSTSTART = 4
static const int RQ_BURSTMIN = 4
static const int RQ_BURSTMAX = 20
static const int RQ_MAXACKLIST = 10
static const int RQ_ACKEVERY = 4

Friends

class RioNeti

Detailed Description

Definition at line 842 of file RioNeti.h.


Constructor & Destructor Documentation

NetBuf::NetBuf (  )  [private]

Definition at line 6496 of file RioNeti.cpp.

06497 {
06498     #ifdef RIO_DEBUG1
06499     RioErr << "[NetBuf - Constructor] Start" << endl;
06500     #endif
06501 
06502     nb_link          = NULL;
06503     nb_reqid         = 0;
06504     rq_fragsh        = 0;
06505     rq_fragburst     = 0;
06506     rq_fragburst     = 0;
06507     nb_outnext       = NULL;
06508     rq_fraglistn     = 0;
06509     nb_sendack       = 1;
06510     nb_hisreqid      = 0;
06511     nb_frag0arrive   = 0;
06512     rq_maxpktl       = 0;
06513     rq_fraglen0      = 0;
06514     rq_fraglen       = 0;
06515     rq_fragmax       = 0;
06516     rq_fraghav       = 0;
06517     rq_fragDiscarded = 0;
06518     rq_fraghigh      = 0;
06519     rq_fraglow       = 0;
06520     rq_needack       = 0;
06521     rq_fragackseq    = 0;
06522     rq_retry         = 0;
06523     rq_retryfrag     = 0;
06524     rq_retrytim      = 0;
06525     nb_result        = 0;
06526     nb_rioneti       = NULL;
06527     nb_blockp        = NULL;
06528     nb_blockl        = 0;
06529     nb_toipaddr      = 0;
06530     nb_toipport      = 0;
06531     nb_bufp          = NULL;
06532     nb_bufl          = 0;
06533     nb_recvl         = 0;
06534     nb_datap         = NULL;
06535     nb_datalm        = NULL;
06536     nb_sendp         = NULL;
06537     nb_sendl         = 0;
06538     nb_userparm      = NULL;
06539     memset( &rq_bits, 0, sizeof( rq_bits ) );
06540     memset( &nb_buf, 0, sizeof( nb_buf ) );
06541 
06542     #ifdef RIO_DEBUG1
06543     RioErr << "[NetBuf - Constructor] Finish" << endl;
06544     #endif
06545 
06546     // Inicializa o novo campo da classe NetBuf, usado pelo controle de fluxo.
06547     nb_timebetweencredits = ~0;
06548 }

NetBuf::~NetBuf (  )  [inline, private]

Definition at line 922 of file RioNeti.h.

00922 {};


Member Function Documentation

NetBuf::DQUEUE ( NetBuf   )  [private]
int NetBuf::GetFragmentInfo ( char **  FragmentData,
int *  FragmentSize 
)

GetFragmentInfo copia e retorna as informacoes de um fragmento do objeto NetBuf.

Parameters:
FragmentData ponteiro para um ponteiro que armazenara uma copia dos dados a serem enviados.
FragmentSize ponteiro que armazenara o tamanho dos dados a serem enviados
Returns:
valor diferente de 0 se ocorrer erro de alocacao de memoria.

Definition at line 6565 of file RioNeti.cpp.

06566 {
06567     *FragmentData = new char[ nb_sendl ];
06568     if( *FragmentData == NULL )
06569         return ERROR_RIONETI + ERROR_MEMORY;
06570     memcpy( *FragmentData, nb_sendp, nb_sendl );
06571     *FragmentSize = nb_sendl;
06572     return S_OK;
06573 }

void NetBuf::GetIPAndPort ( int *  ip,
int *  port 
)

GetIPAndPort retorna o ip (o campo nb_toipaddr) e a porta (o campo nb_toipport).

Parameters:
ip ponteiro para o inteiro que armazenara o endereco IP.
port ponteiro para o inteiro que armazenara a porta.

Definition at line 6554 of file RioNeti.cpp.

06555 {
06556     *ip = nb_toipaddr;
06557     *port = nb_toipport;
06558 }

unsigned long long int NetBuf::GetTimeBetweenCredits (  ) 

GetTimeBetweenCredits retorna o tempo entre as atualizacoes do credito do cliente (do campo nb_timebetweencredits da classe).

Returns:
tempo entre as atualizacoes de credito.

Definition at line 6560 of file RioNeti.cpp.

06561 {
06562     return nb_timebetweencredits;
06563 } 


Friends And Related Function Documentation

friend class RioNeti [friend]

Definition at line 972 of file RioNeti.h.


Field Documentation

int NetBuf::nb_blockl [private]

Definition at line 907 of file RioNeti.h.

char* NetBuf::nb_blockp [private]

Definition at line 906 of file RioNeti.h.

char NetBuf::nb_buf[FRAGMENTSIZE] [private]

Definition at line 917 of file RioNeti.h.

int NetBuf::nb_bufl [private]

Definition at line 911 of file RioNeti.h.

char* NetBuf::nb_bufp [private]

Definition at line 910 of file RioNeti.h.

void(* NetBuf::nb_callback)(struct NetBuf *, int type, char *pkt, int pktl) [private]

Definition at line 933 of file RioNeti.h.

char* NetBuf::nb_datalm [private]

Definition at line 914 of file RioNeti.h.

char* NetBuf::nb_datap [private]

Definition at line 913 of file RioNeti.h.

time_t NetBuf::nb_frag0arrive [private]

Definition at line 885 of file RioNeti.h.

int NetBuf::nb_hisreqid [private]

Definition at line 884 of file RioNeti.h.

NetBuf* NetBuf::nb_link [private]

Definition at line 872 of file RioNeti.h.

Definition at line 879 of file RioNeti.h.

void( * NetBuf::nb_outrtn)(NetBuf *) [private]

Definition at line 924 of file RioNeti.h.

int NetBuf::nb_recvl [private]

Definition at line 912 of file RioNeti.h.

int NetBuf::nb_reqid [private]

Definition at line 873 of file RioNeti.h.

Definition at line 904 of file RioNeti.h.

Definition at line 905 of file RioNeti.h.

int NetBuf::nb_sendack [private]

Definition at line 883 of file RioNeti.h.

int NetBuf::nb_sendl [private]

Definition at line 916 of file RioNeti.h.

char* NetBuf::nb_sendp [private]

Definition at line 915 of file RioNeti.h.

unsigned long long int NetBuf::nb_timebetweencredits [private]

Definition at line 936 of file RioNeti.h.

struct timeval NetBuf::nb_tiwhen [private]

Definition at line 874 of file RioNeti.h.

int NetBuf::nb_toipaddr [private]

Definition at line 908 of file RioNeti.h.

int NetBuf::nb_toipport [private]

Definition at line 909 of file RioNeti.h.

Definition at line 886 of file RioNeti.h.

Definition at line 919 of file RioNeti.h.

Definition at line 920 of file RioNeti.h.

void* NetBuf::nb_userparm [private]

Definition at line 918 of file RioNeti.h.

const int NetBuf::RQ_ACKEVERY = 4 [static, private]

Definition at line 868 of file RioNeti.h.

char NetBuf::rq_bits[256] [private]

Definition at line 903 of file RioNeti.h.

int NetBuf::rq_burstcnt [private]

Definition at line 878 of file RioNeti.h.

const int NetBuf::RQ_BURSTMAX = 20 [static, private]

Definition at line 866 of file RioNeti.h.

const int NetBuf::RQ_BURSTMIN = 4 [static, private]

Definition at line 865 of file RioNeti.h.

const int NetBuf::RQ_BURSTSTART = 4 [static, private]

Definition at line 864 of file RioNeti.h.

int NetBuf::rq_fragackseq [private]

Definition at line 899 of file RioNeti.h.

int NetBuf::rq_fragburst [private]

Definition at line 877 of file RioNeti.h.

int NetBuf::rq_fragDiscarded [private]

Definition at line 895 of file RioNeti.h.

int NetBuf::rq_fraghav [private]

Definition at line 894 of file RioNeti.h.

int NetBuf::rq_fraghigh [private]

Definition at line 896 of file RioNeti.h.

int NetBuf::rq_fraglen [private]

Definition at line 892 of file RioNeti.h.

int NetBuf::rq_fraglen0 [private]

Definition at line 891 of file RioNeti.h.

Definition at line 869 of file RioNeti.h.

int NetBuf::rq_fraglistn [private]

Definition at line 880 of file RioNeti.h.

int NetBuf::rq_fraglow [private]

Definition at line 897 of file RioNeti.h.

int NetBuf::rq_fragmax [private]

Definition at line 893 of file RioNeti.h.

int NetBuf::rq_fragsh [private]

Definition at line 876 of file RioNeti.h.

const int NetBuf::RQ_MAXACKLIST = 10 [static, private]

Definition at line 867 of file RioNeti.h.

int NetBuf::rq_maxpktl [private]

Definition at line 889 of file RioNeti.h.

int NetBuf::rq_needack [private]

Definition at line 898 of file RioNeti.h.

int NetBuf::rq_retry [private]

Definition at line 900 of file RioNeti.h.

int NetBuf::rq_retryfrag [private]

Definition at line 901 of file RioNeti.h.

int NetBuf::rq_retrytim [private]

Definition at line 902 of file RioNeti.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 4 16:03:35 2012 for RIO by  doxygen 1.6.3