Which compiler are you using? If you send me your project I'll try to get it a look.
Regards Alle 15:08, giovedì 8 febbraio 2007, Kai Klein ha scritto: > Hello, > > i have new problems, > > in version uip0.9 in the file uip.h ** $Id: uip.h,v 1.36.2.7 > 2003/10/07 13:47:51 adam Exp $* > there is the struct for the uip_conn in Version 1.0 is the appstate > field changed. ** $Id: uipopt.h,v 1.4 2006/06/12 08:00:31 adam Exp $* > and i cant compile without error at this point. > > in the documentation there is always this: > > struct example2_state *s; > s = (struct example2_state *)uip_conn->appstate; > > has it any impact for these to lines ? > my compiler says:* cannot convert to a pointer type* > > > *Version uip0.9* > struct uip_conn { > u16_t ripaddr[2]; /**< The IP address of the remote host. */ > > u16_t lport; /**< The local TCP port, in network byte order. */ > u16_t rport; /**< The local remote TCP port, in network byte > order. */ > > u8_t rcv_nxt[4]; /**< The sequence number that we expect to > receive next. */ > u8_t snd_nxt[4]; /**< The sequence number that was last sent by > us. */ > u16_t len; /**< Length of the data that was previously sent. */ > u16_t mss; /**< Current maximum segment size for the > connection. */ > u16_t initialmss; /**< Initial maximum segment size for the > connection. */ > u8_t sa; /**< Retransmission time-out calculation state > variable. */ > u8_t sv; /**< Retransmission time-out calculation state > variable. */ > u8_t rto; /**< Retransmission time-out. */ > u8_t tcpstateflags; /**< TCP state and flags. */ > u8_t timer; /**< The retransmission timer. */ > u8_t nrtx; /**< The number of retransmissions for the last > segment sent. */ > > /** The application state. */ > u8_t appstate[UIP_APPSTATE_SIZE]; > }; > * > Version uip1.0* > struct uip_conn { > uip_ipaddr_t ripaddr; /**< The IP address of the remote host. */ > > u16_t lport; /**< The local TCP port, in network byte order. */ > u16_t rport; /**< The local remote TCP port, in network byte > order. */ > > u8_t rcv_nxt[4]; /**< The sequence number that we expect to > receive next. */ > u8_t snd_nxt[4]; /**< The sequence number that was last sent by > us. */ > u16_t len; /**< Length of the data that was previously sent. */ > u16_t mss; /**< Current maximum segment size for the > connection. */ > u16_t initialmss; /**< Initial maximum segment size for the > connection. */ > u8_t sa; /**< Retransmission time-out calculation state > variable. */ > u8_t sv; /**< Retransmission time-out calculation state > variable. */ > u8_t rto; /**< Retransmission time-out. */ > u8_t tcpstateflags; /**< TCP state and flags. */ > u8_t timer; /**< The retransmission timer. */ > u8_t nrtx; /**< The number of retransmissions for the last > segment sent. */ > > /** The application state. */ > uip_tcp_appstate_t appstate; > }; > > Kai Klein schrieb: > > hi all, > > > > i like to use a multi application scenario, > > i tried to implement the example from the application documentation. > > > > but i get an error if i compile it. and my knowledge of c is quit low. > > so maybe is only a c knowledge problem . > > > > hope somone can help. > > > > regards > > kai > > > > here my header file of the switch application who shell be called from > > the stack. > > > > #ifndef __UIP_APP_ROUTER_H__ > > #define __UIP_APP_ROUTER_H__ > > > > #include <uip/uipopt.h> > > > > //struct uip_router_state { > > // u8_t state; > > //}; > > > > struct uip_router_state { > > enum {WELCOME_SENT, WELCOME_ACKED} state; > > }; > > ^ "empty declaration" <<<<<<<<<< error is here <<<<<<<<<<<<<< > > > > //typedef struct uip_router_state uip_tcp_appstate_t; > > > > #ifndef UIP_APPCALL > > #define UIP_APPCALL uip_router_appcall > > #endif > > > > /* Finally we define the application function to be called by uIP. */ > > void uip_router_appcall(void); > > void uip_router_init(void); > > #endif /* __TELNETD_H__ */ > > > > and here the c file: > > > > #include <global.h> > > #include <uip/uip.h> > > > > void uip_router_init(void){ > > telnetd_init(); > > cmd_server_init(); > > } > > > > void uip_router_appcall(void){ > > > > struct uip_router_state *s; > > s = (struct uip_router_state *)uip_conn->appstate; > > // struct uip_router_state *s = &(uip_conn->appstate); > > > > switch(uip_conn->lport) { > > // case HTONS(23): > > // telnetd_appcall(); > > // break; > > // case HTONS(86): > > // cmd_server_appcall(); > > // break; > > } > > } -- Fabio Giovagnini Aurion s.r.l. via degli orti 11, 40050 Funo di Argelato (BO) Tel. +39.335.8350919 Fax +39.051.8659009 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini