コード例 #1
0
ファイル: Delta_item.cpp プロジェクト: svn2github/ncbi_tk
void CDelta_item::SetInsertion(const CIUPACna& sequence, 
                               const TSeqPos length)
{
    const TSeqPos seq_length = length ? length : (TSeqPos)sequence.Get().size();
    SetSeq().SetLiteral().SetSeq_data().SetIupacna(sequence);
    SetSeq().SetLiteral().SetLength(seq_length);
    SetAction(eAction_ins_before);
}
コード例 #2
0
void CIkev2Acquire::ConstructL(const TPfkeyMessage& aReq, const TInetAddr& aLocalAddr, 
                          TUint16 aDHGroup, TBool aImplicitSa, 
                          const TIpsecSaSpec* aSaSpec, const CIpsecSARekeyData* aRekeyData)
{
    SetIpsecProtocol(aReq.iBase.iMsg->sadb_msg_satype); 
    SetPid(aReq.iBase.iMsg->sadb_msg_pid);
    SetSeq(aReq.iBase.iMsg->sadb_msg_seq);
    iSrcSpecific = !(aReq.iSrcAddr.iAddr->IsUnspecified());

    if (!aRekeyData)
        {
        // SADB_ACQUIRE was received
        if ( aReq.iProposal.iComb->sadb_comb_flags & SADB_SAFLAGS_PFS )
            {
            iDHGroup = (TUint32)aDHGroup;
            }
    
        if ( aReq.iProposal.iComb->sadb_comb_flags & SADB_SAFLAGS_TUNNEL )
            {
            iTransport = EFalse;        
            }
        else 
            {
            iTransport = ETrue;
            }

        iHard.iAllocations = aReq.iProposal.iComb->sadb_comb_hard_allocations;
        iHard.iBytes = aReq.iProposal.iComb->sadb_comb_hard_bytes;
        iHard.iAddtime = aReq.iProposal.iComb->sadb_comb_hard_addtime;
        iHard.iUsetime = aReq.iProposal.iComb->sadb_comb_hard_usetime;
    
        iSoft.iAllocations = aReq.iProposal.iComb->sadb_comb_soft_allocations;
        iSoft.iBytes = aReq.iProposal.iComb->sadb_comb_soft_bytes;
        iSoft.iAddtime = aReq.iProposal.iComb->sadb_comb_soft_addtime;
        iSoft.iUsetime = aReq.iProposal.iComb->sadb_comb_soft_usetime;

        SetReplayWindow(aReq.iProposal.iExt->sadb_prop_replay);

        //
        //  Build SA payload (including Proposal and Transform payload)
        //  using parameters in TPfkeyMessage
        //
        if ( aImplicitSa )
            {
            aDHGroup = 0; // No D-H group used with ipmplicit SA although PFS defined   
            }
        iSA = IpsecProposal::BuildIpsecSaRequestL(aReq, aDHGroup);
    
        //
        //  Build Traffic selectors using parameters in TPfkeyMessage.
        //  For some reason the selectors are build using identity 
        //  fields.
        //  
        IpsecSelectors::BuildTrafficSelectorsL(this, aLocalAddr,
                                               aReq.iSrcIdent, aReq.iDstIdent,
                                               aReq.iDstAddr.iExt->sadb_address_proto);
        //
        //  Store identity information from TPfkeyMessage to Acquire
        //
        if ( aReq.iSrcIdent.iExt )
            {            
            iLocalId = HBufC8::NewL(aReq.iSrcIdent.iData.Length());
            iLocalId->Des().Copy(aReq.iSrcIdent.iData);
            }
        else
            {
            iLocalId = KZeroDesc().AllocL();
            }

        if ( aReq.iDstIdent.iExt )
            {            
            iRemoteId = HBufC8::NewL(aReq.iDstIdent.iData.Length());
            iRemoteId->Des().Copy(aReq.iDstIdent.iData);
            }
        else
            {
            iRemoteId = KZeroDesc().AllocL();
            }
        }
    else
        {
        // SADB_EXPIRE was received due to soft lifetime expiration
        TUint16 flags = (TUint16)(aReq.iSa.iExt->sadb_sa_flags | (aSaSpec->iTransportMode ? 0 : SADB_SAFLAGS_TUNNEL));
        if ( flags & SADB_SAFLAGS_PFS )
            {
            iDHGroup = (TUint32)aDHGroup;
            }
    
        if ( flags & SADB_SAFLAGS_TUNNEL )
            {
            iTransport = EFalse;        
            }
        else 
            {
            iTransport = ETrue;
            }
                    
        if ( aImplicitSa )
            {
            aDHGroup = 0; // No D-H group used with ipmplicit SA although PFS defined   
            } 
        
        iSA = IpsecProposal::BuildIpsecSaRequestL(iProtocol, 
                                                  aSaSpec->iEalg, aSaSpec->iEalgLen, aSaSpec->iAalg, 
                                                  flags, aDHGroup);
                                                    
        iReplayWindow = aRekeyData->ReplayWindow();
        iHard = aRekeyData->HardLifetime();
        iSoft = aRekeyData->SoftLifetime();
        
        iTS_i = aRekeyData->TsIL();
        iTS_r = aRekeyData->TsRL();

        
        iLocalId = aRekeyData->LocalId().AllocL();
        iRemoteId = aRekeyData->RemoteId().AllocL();

        iResponse = EFalse;
        }
}
コード例 #3
0
ファイル: Delta_item.cpp プロジェクト: svn2github/ncbi_tk
void CDelta_item::SetDuplication(void)
{
    SetSeq().SetThis();
    SetMultiplier() = 2;
}
コード例 #4
0
ファイル: Delta_item.cpp プロジェクト: svn2github/ncbi_tk
void CDelta_item::SetDeletion(void)
{
    SetSeq().SetThis();
    SetAction(eAction_del_at);
}