23 #include "Semaphore.h" 24 #include "NetStackMemoryManager.h" 25 #include "FileHandle.h" 26 #include "events/EventQueue.h" 27 #include "netsocket/PPP.h" 77 virtual void get_ifname(
char *name, uint8_t size)
const;
87 virtual bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack);
175 virtual void link_input(net_stack_mem_buf_t *buf);
196 bool prepare_event_queue();
198 void ppp_stream_sigio_callback();
199 void ppp_handle_modem_hangup();
200 static void ppp_link_status(
struct ppp_pcb_s *pcb,
int err_code,
void *ctx);
201 void power_up_call();
202 void link_state_call(
bool up);
215 ppp_link_input_cb_t ppp_link_input_cb;
216 ppp_link_state_change_cb_t ppp_link_state_cb;
218 struct netif *ppp_service_netif;
219 void *ppp_service_pcb;
220 nsapi_ip_stack_t ppp_service_stack;
221 const char *ppp_service_uname;
222 const char *ppp_service_password;
224 bool ppp_service_active : 1;
225 bool ppp_service_event_queued : 1;
226 bool ppp_service_terminating : 1;
227 bool ppp_link_state_up : 1;
mbed::Callback< void(net_stack_mem_buf_t *buf)> ppp_link_input_cb_t
Callback to be registered with PPP interface and to be called for received packets.
mbed::Callback< void(bool up)> ppp_link_state_change_cb_t
Callback to be registered with PPP interface and to be called for link status changes.
virtual void link_input(net_stack_mem_buf_t *buf)
Received IP packet from PPP to stack.
The Semaphore class is used to manage and protect access to a set of shared resources.
signed int nsapi_error_t
Type used to represent error codes.
virtual const nsapi_addr_t * get_dns_server(uint8_t index)
Gets DNS server address.
virtual events::EventQueue * event_queue_get()
Handle to PPP event queue.
virtual void resource_unlock()
Unlock PPP resource.
virtual void set_link_state_cb(ppp_link_state_change_cb_t state_cb)
Sets a callback that needs to be called on link status changes for given interface.
virtual uint32_t get_align_preference() const
Gets memory buffer alignment preference.
virtual void set_ip_stack(nsapi_ip_stack_t ip_stack)
Sets IP protocol versions of IP stack.
virtual void set_credentials(const char *uname, const char *password)
Sets user name and password for PPP protocol.
virtual void resource_lock()
Lock PPP resource.
The Mutex class is used to synchronize the execution of threads.
virtual const nsapi_addr_t * get_gateway()
Get the local gateway.
virtual void link_state(bool up)
Link state indication from PPP.
virtual void set_memory_manager(NetStackMemoryManager &mem_mngr)
Sets memory manager that is used to handle memory buffers.
virtual void get_ifname(char *name, uint8_t size) const
Return interface name.
virtual bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack)
Sends the packet over the link.
virtual const nsapi_addr_t * get_ip_address(nsapi_version_t version)
Gets local IP address.
virtual void set_stream(mbed::FileHandle *stream)
Sets file stream used to communicate with modem.
virtual void power_down()
Deinitializes the hardware.
IP address structure for passing IP addresses by value.
virtual const nsapi_addr_t * get_netmask()
Get the local network mask.
This interface should be used to abstract low level access to networking hardware All operations rece...
virtual bool power_up()
Initializes the hardware.
virtual uint32_t get_mtu_size()
Return maximum transmission unit.
virtual void set_link_input_cb(ppp_link_input_cb_t input_cb)
Sets a callback that needs to be called for packets received for that interface.