Changeset 4245

Show
Ignore:
Timestamp:
08/06/08 17:21:53 (6 years ago)
Author:
soohyunc
Message:

o now, ackvec build funcion is moved to TfwcRcvr? correctly

Location:
vic/branches/cc
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/cc/tfwc_rcvr.cpp

    r4243 r4245  
    4949{} 
    5050 
    51 void TfwcRcvr::set_received_seqno(u_int16_t seqno)  
     51void TfwcRcvr::set_received_seqno(u_int16_t seqno, u_int16_t lastseq)  
    5252{ 
    5353        seqno_ = seqno; 
     54        lastseq_ = lastseq; 
    5455    debug_msg("received seqno:  %d\n", seqno_); 
     56 
     57        ackvec_manager(seqno_, lastseq_); 
    5558} 
    5659 
     60void TfwcRcvr::ackvec_manager(u_int16_t seqno, u_int16_t lastseq) 
     61{ 
     62        // set next ackvec bit vector 
     63        for (int i = lastseq+1; i <= seqno; i++) { 
     64                SET_BIT_VEC (tfwcAV, 1); 
     65        } 
     66 
     67        // printing tfwcAV 
     68        bool isThere; 
     69        debug_msg("XXX received ackvec:"); 
     70        for (int i = lastseq+1; i <= seqno; i++) { 
     71                isThere = SEE_BIT_VEC (tfwcAV, i, seqno); 
     72                printf(" %d... %s ", seqno, isThere ? "Ok" : "Nok"); 
     73        } 
     74        printf("\n"); 
     75        //lastseq_ = seqno; 
     76} 
  • vic/branches/cc/cc/tfwc_rcvr.h

    r4243 r4245  
    4848public: 
    4949        TfwcRcvr(); 
    50         void set_received_seqno(u_int16_t seqno); 
     50        void set_received_seqno(u_int16_t seqno, u_int16_t lastseq); 
    5151 
    5252protected: 
    53         u_int16_t seqno_; 
     53        inline u_int32_t get_ackvec() { return tfwcAV; } 
     54        u_int32_t tfwcAV;       // AckVec (bit vector) 
     55        u_int16_t seqno_;       // received RTP packet seqno 
     56        u_int16_t lastseq_;     // last RTP packet seqno 
    5457private: 
     58        void ackvec_manager(u_int16_t seqno, u_int16_t latseq); 
    5559}; 
    5660 
  • vic/branches/cc/rtp/session.cpp

    r4244 r4245  
    646646                xr = (rtcp_xr*)(rh + 1);        // extended report 
    647647                xr->xr_begin_seq = lastseq_;// this will be used for ackofack 
    648                 xr->xr_end_seq = seqno_ + 1; 
    649                 xr->xr_ackvec = ackvec_;        // ackvec 
     648                xr->xr_end_seq = seqno_ + 1;// as defined in RFC3611 section 4.1 
     649                xr->xr_ackvec = get_ackvec();   // ackvec 
    650650        } 
    651651 
     
    798798        rtphdr* rh = (rtphdr*)pb->data; 
    799799        seqno_ = ntohs(rh->rh_seqno);   // get received packet seqno 
    800         set_received_seqno(seqno_);     // set received seqno in TfwcRcvr 
    801800 
    802801    // Ignore loopback packets 
     
    811810        } // now, loopback packets ignored (if disabled) 
    812811 
    813 /* 
    814         // set bit vector 
    815         for (int i = lastseq_+1; i <= seqno_; i++) { 
    816                         SET_BIT_VEC (ackvec_, 1); 
    817         } 
    818  
    819         // printing bit vector 
    820         bool isThere; 
    821         debug_msg("XXX received ackvec:"); 
    822         for (int i = lastseq_+1; i <= seqno_; i++) { 
    823                 isThere = SEE_BIT_VEC (ackvec_, i, seqno_); 
    824                 printf(" %d... %s ", seqno_, isThere ? "Ok" : "NOk"); 
    825         } 
    826         printf("\n"); 
    827         lastseq_ = seqno_; 
    828 */ 
     812        // set received seqno - passing seqno to TfwcRcvr 
     813        set_received_seqno(seqno_, lastseq_); 
     814        lastseq_ = seqno_;      // set last seqno 
     815 
    829816        int version = pb->data[0] >> 6; 
    830817        //int version = *(u_char*)rh >> 6; 
  • vic/branches/cc/rtp/session.h

    r4244 r4245  
    195195 
    196196        SourceManager *sm_; 
     197        TfwcRcvr *tfwc_rcvr_; 
    197198 
    198199        // RTP packet sequence number (for the use of AckVec)