Maybe this can help you, I had to change manually ppp_status returned by
lwip_ppp_status ... it always gave me back 0 as value instead of 1

regards....


roberto



>-- Messaggio Originale --
>From: "Charles-Christophe Thomart" <[EMAIL PROTECTED]>
>To: <[email protected]>
>Date: Fri, 22 Jul 2005 17:27:28 +0200
>Subject: [lwip-users] netif.flags not set with NETIF_FLAG_UP
>Reply-To: Mailing list for lwIP users <[email protected]>
>
>
>Hello,
>
>I am using lwIP on embedded ARM with modem and ppp support.
>I have been able to establish ppp and am now trying a DNS request. The
>request is correcly received by peer. The answer is received in function
>
>ip_input.
>I user a debugger to see what was going out :
>- the "PP" netif is created whith correct IP and mask (given by peer).
>- the netif.flags is not set to NETIF_FLAG_UP
>
>What I am doing :
>- Connect PPP. The callback function is called with an error code of 0.
>- Create a socket with netconn_new(NETCONN_UDP)
>- send data to peer (dns request) :
>  netconn_connect
>  netconn_send
> I assume this is working since request is received and understood by peer.
>- wait incomming answer
>  netconn_recv
>
>This function does not return. As said above, data is received in ip_input,
>
>but is not transfered since netif.flags is not set with NETIF_FLAG_UP. It
>
>seems this should have been done by dhcp_bind: I am compiling with
>a -DLWIP_DHCP=1 flag.
>
>Does anyone have an idea on what I am doing wrong?
>
>
>
>Thanks,
>Charles-Christophe
>
>
>
>_______________________________________________
>lwip-users mailing list
>[email protected]
>http://lists.nongnu.org/mailman/listinfo/lwip-users


__________________________________________________________________
TISCALI ADSL 1.25 MEGA
Solo con Tiscali Adsl navighi senza limiti e telefoni senza canone Telecom
a partire da  19,95 Euro/mese.
Attivala entro il 28 luglio, il primo MESE รจ GRATIS! CLICCA QUI.
http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/



static void
http_thread(void *arg)
{
        struct netconn *conn;

        static char httpreq[] = "GET /default.asp?a=10 HTTP/1.0\r\n\r\n";
        struct netbuf *buf;
        struct ip_addr addr;
        char *data;
        cyg_uint16 len, i;

        while(1){
        /* Create a new connection identifier. */
        conn = netconn_new(NETCONN_TCP);

        


        IP4_ADDR(&addr,132,121,52,83); //static IP Address from local IIS



        /* Tell connection to remote host. */
        int res = netconn_connect(conn, &addr, 80);
        printf("valore di ritorno connessione: %d\n",res);
        
        netconn_write(conn, httpreq, sizeof(httpreq), NETCONN_NOCOPY);
        diag_printf("%d",conn->type);
        while((buf = netconn_recv(conn)) != NULL){
                        do {
                                diag_printf("connesso netbuf\n");
                                netbuf_data(buf,(void *)&data, &len);
                                for(i = 0; i < len; i++){
                                        diag_printf("%c",data[i]);
                                }

                        } while(netbuf_next(buf) >= 0);
                        netbuf_delete(buf);
                        cyg_thread_delay(10);
        }
        netconn_close(conn);
        diag_printf("Disconnected\n");
        netconn_delete(conn);
        }

}




void
tmain(cyg_addrword_t p)
{
  int err ;


  lwip_init();
  





        int val;
  diag_printf("post_lwipinit\n");  
  int timestamp = cyg_current_time() + 100;    
  val=lwip_ppp_start(M_PPP_USER,M_PPP_PWD);
  if(!val){

    while(timestamp > cyg_current_time() ){
                if(lwip_ppp_status() == 1){

                        diag_printf("IP-Address: %u.%u.%u.%u \n",
                                ip4_addr1(ppp_ip_addr),
                                ip4_addr2(ppp_ip_addr),
                                ip4_addr3(ppp_ip_addr),
                                ip4_addr4(ppp_ip_addr));


                        diag_printf("start http client\r\n");
                        sys_thread_new(http_thread, (void*)"http",7);
                        while(1) cyg_thread_delay(1000);
                }

        }

  }
  
}
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to