netif_ppp.h 962 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _NETIF_PPP_H_
  2. #define _NETIF_PPP_H_
  3. //#include "sockets.h"
  4. #include "netif/ppp/pppos.h"
  5. #include "cfw.h"
  6. #include "at_command.h"
  7. #include "at_engine.h"
  8. #include "at_response.h"
  9. #include "cfw_errorcode.h"
  10. #ifdef CONFIG_NET_LWIP_PPP_ON
  11. typedef enum
  12. {
  13. PPP_DETACHED,
  14. PPP_ATTCHING,
  15. PPP_ATTACHED,
  16. PPP_DEACTIVED,
  17. PPP_ACTIVING,
  18. PPP_ACTIVED,
  19. } gprs_state_t;
  20. typedef struct __ctx_cb
  21. {
  22. ppp_pcb *nPppPcb;
  23. //struct atCmdEngine *engine;
  24. struct netif *gprs_netif;
  25. u8_t nCid;
  26. u8_t nSimId;
  27. u8_t nDlc;
  28. u8_t nUti;
  29. gprs_state_t gprsState;
  30. } ctx_cb_t;
  31. void ppp_ip_output(struct pbuf *p, void *ctx);
  32. bool ppp_ip_input(struct pbuf *p, struct netif *gprs_netif, uint8_t nDLCI);
  33. void ppp_StartGprs(uint8_t *usrname, uint8_t *usrpwd, void *ctx);
  34. err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip4_addr_t *ipaddr);
  35. void AT_PppProcess(atCommand_t *PARA, uint8_t nSim, uint8_t nCid);
  36. #endif
  37. #endif