Beispiel #1
0
uint32 GAgent_Lan_Handle(pgcontext pgc, ppacket prxBuf , ppacket ptxBuf,int32 len)
{
    int i =0;
    int fd =0;
    int ret =0;
    uint16 GAgentStatus=0;
    GAgentStatus = pgc->rtinfo.GAgentStatus;

    if( (GAgentStatus&WIFI_MODE_AP) == WIFI_MODE_AP )
    {
        GAgent_DoTcpWebConfig( pgc );
    }
    else
    {
        Lan_udpDataHandle(pgc, prxBuf, ptxBuf, len);
        Lan_TcpServerHandler(pgc);
        
        for(i = 0;i < LAN_TCPCLIENT_MAX; i++)
        {
            fd = pgc->ls.tcpClient[i].fd;
            if(fd <= 0)
                continue;
            if(FD_ISSET(fd, &(pgc->rtinfo.readfd)))
            {
                ret = Lan_tcpClientDataHandle(pgc, i, prxBuf, ptxBuf, len);
                if(ret > 0)
                {
                    dealPacket(pgc, prxBuf);
                }
            }
        }
    }
    return 0;
}
Beispiel #2
0
uint32 GAgent_Lan_Handle(pgcontext pgc, ppacket prxBuf,int32 len)
{
    int i =0;
    int fd =0;
    int ret =0;
    uint16 GAgentStatus=0;
    GAgentStatus = pgc->rtinfo.GAgentStatus;
    {
        GAgent_DoTcpWebConfig( pgc );
        Lan_udpDataHandle(pgc, prxBuf, len);
        Lan_TcpServerHandler(pgc);
        GAgent3rdLan_Handle( pgc );
        for(i = 0;i < LAN_TCPCLIENT_MAX; i++)
        {
            fd = pgc->ls.tcpClient[i].fd;
            if(fd <= 0)
                continue;
            if(FD_ISSET(fd, &(pgc->rtinfo.readfd)))
            {
                ret = Lan_tcpClientDataHandle(pgc, i, prxBuf, /* ptxBuf,*/ len);
                if(ret > 0)
                {
                    dealPacket(pgc, prxBuf);
                    Lan_ClearClientAttrs(pgc, &pgc->ls.srcAttrs);
                    clearChannelAttrs(pgc);
                }
            }
        }
    }
    return 0;
}
Beispiel #3
0
uint32 GAgent_Lan_Handle(pgcontext pgc, ppacket prxBuf, ppacket ptxBuf, int32 len)
{
    int i =0;
    int fd =0;
    int ret =0;
    
    Lan_udpDataHandle(pgc, prxBuf, ptxBuf, len);
    Lan_TcpServerHandler(pgc);
    
    for(i = 0;i < LAN_TCPCLIENT_MAX; i++)
    {
        fd = pgc->ls.tcpClient[i].fd;
        if(fd <= 0)
            continue;
        if(FD_ISSET(fd, &(pgc->rtinfo.readfd)))
        {
            ret = Lan_tcpClientDataHandle(pgc, i, prxBuf, ptxBuf, len);
            if(ret > 0)
            {
                dealPacket(pgc, prxBuf);
            }
        }
    }
}