作业/作业5/nack-oriented-reliable-multicast-master/norm-1.5r6/protolib/include/manetMsg.h
static unsigned int GetMinLength(UINT8 semantics)
        {
            unsigned int minLength = 2;                     // "type" and "semantics" field
            minLength += (0 != (semantics & EXTENDED_TYPE)) ? 1 : 0;  // opt. "type-ext" field
            minLength +=  (0 != (semantics & SINGLE_INDEX) )?   // opt. "index" fields
                          1 :
                          ((0 != (semantics & MULTI_INDEX)) ? 2 : 0);
            minLength += (0 != (semantics & HAS_VALUE)) ?    // opt. "length" field
                         ((0 != (semantics & EXTENDED_LENGTH)) ? 2 : 1) :
                                 0;
            return minLength;
        }
// Helper method used to in TLV build/parse initialization
Helper method used to in TLV build/parse initialization
Helper method used to in TLV build / parse initialization
static unsigned int GetMinLength(UINT8 semantics)
        {
            unsigned int minLength = 2;                     
            minLength += (0 != (semantics & EXTENDED_TYPE)) ? 1 : 0;  
            minLength +=  (0 != (semantics & SINGLE_INDEX) )?   
                          1 :
                          ((0 != (semantics & MULTI_INDEX)) ? 2 : 0);
            minLength += (0 != (semantics & HAS_VALUE)) ?    
                         ((0 != (semantics & EXTENDED_LENGTH)) ? 2 : 1) :
                                 0;
            return minLength;
        }
static unsigned int GetMinLength ( UINT8 semantics ) { unsigned int minLength = 2 ; minLength += ( 0 != ( semantics & EXTENDED_TYPE ) ) ? 1 : 0 ; minLength += ( 0 != ( semantics & SINGLE_INDEX ) ) ? 1 : ( ( 0 != ( semantics & MULTI_INDEX ) ) ? 2 : 0 ) ; minLength += ( 0 != ( semantics & HAS_VALUE ) ) ? ( ( 0 != ( semantics & EXTENDED_LENGTH ) ) ? 2 : 1 ) : 0 ; return minLength ; }
Helper method used to in TLV build/parse initialization
Helper method used to in TLV build / parse initialization
// "type" and "semantics" field // opt. "type-ext" field // opt. "index" fields // opt. "length" field