コード例 #1
0
VOS_VOID CDS_SaveIpv4FragmentInfo(const CDS_IPV4_FRAGMENT_INFO_STRU *pstSrcInfo)
{
    CDS_IPV4_FRAGMENT_BUFF_STRU     *pstIpv4FragBuff;
    CDS_IPV4_FRAGMENT_INFO_STRU     *pstDstInfo;

    CDS_ASSERT(VOS_NULL_PTR != pstSrcInfo);

    pstIpv4FragBuff = CDS_GET_IPV4_FRAGMENT_BUFF();
    pstDstInfo = &(pstIpv4FragBuff->astSegBuff[pstIpv4FragBuff->ulIndex]);
    pstIpv4FragBuff->ulIndex = TTF_MOD_ADD(pstIpv4FragBuff->ulIndex,1,CDS_IPV4_FRAGMENT_BUFF_SIZE);
    PS_MEM_CPY(pstDstInfo,pstSrcInfo,sizeof(CDS_IPV4_FRAGMENT_INFO_STRU));

    return;
}
コード例 #2
0
VOS_VOID CDS_ShowIpV4FragmentBuffInfo(VOS_VOID)
{

    VOS_UINT32                         ulCnt;
    CDS_IPV4_FRAGMENT_BUFF_STRU       *pstIpv4FragBuff;
    CDS_IPV4_FRAGMENT_INFO_STRU       *pstIpv4FragInfo;

    pstIpv4FragBuff = CDS_GET_IPV4_FRAGMENT_BUFF();
    for (ulCnt = 0; ulCnt < CDS_IPV4_FRAGMENT_BUFF_SIZE; ulCnt ++)
    {
        pstIpv4FragInfo = &(pstIpv4FragBuff->astSegBuff[ulCnt]);
        vos_printf("\n IPV4 Fragment Buffer Index : %d\n",ulCnt);
        vos_printf("EPS Bearer  ID:                 %d\n", pstIpv4FragInfo->ucEpsbID);
        vos_printf("Source IP Addr:                 ");
        CDS_PrintIpv4Addr(&(pstIpv4FragInfo->unSrcAddr));
        vos_printf("Dest   IP Addr:                 ");
        CDS_PrintIpv4Addr(&(pstIpv4FragInfo->unDstAddr));
        vos_printf("IP Fragment ID:                 %d\n", pstIpv4FragInfo->usIpIdentity);
    }

    return;
}
コード例 #3
0
VOS_UINT32 CDS_GetEpsbIDByIpv4FragInfo(VOS_UINT8 *pucEpsbID,
                                                 const CDS_IPV4_FRAGMENT_INFO_STRU *pstSrcInfo)
{
    CDS_IPV4_FRAGMENT_BUFF_STRU     *pstIpv4FragBuff;
    CDS_IPV4_FRAGMENT_INFO_STRU     *pstFragItem;
    VOS_UINT32                       ulCnt;

    CDS_ASSERT_RTN(VOS_NULL_PTR != pstSrcInfo, PS_FAIL);
    CDS_ASSERT_RTN(VOS_NULL_PTR != pucEpsbID,  PS_FAIL);

    pstIpv4FragBuff = CDS_GET_IPV4_FRAGMENT_BUFF();
    for (ulCnt = 0; ulCnt < CDS_IPV4_FRAGMENT_BUFF_SIZE; ulCnt ++)
    {
        pstFragItem = &(pstIpv4FragBuff->astSegBuff[ulCnt]);
        if (PS_TRUE == CDS_Ipv4FragmentInfoEqual(pstFragItem,pstSrcInfo))
        {
            *pucEpsbID = pstFragItem->ucEpsbID;
            return PS_SUCC;
        }
    }

    return PS_FAIL;

}