24#include "NetStackMemoryManager.h"
25#include "FileHandle.h"
26#include "events/EventQueue.h"
27#include "netsocket/PPP.h"
64 void get_ifname(
char *name, uint8_t size)
const override;
66 bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack)
override;
175 bool prepare_event_queue();
177 void ppp_stream_sigio_callback();
178 void ppp_handle_modem_hangup();
179 static void ppp_link_status(
struct ppp_pcb_s *pcb,
int err_code,
void *ctx);
180 void power_up_call();
181 void link_state_call(
bool up);
197 netif *ppp_service_netif;
198 ppp_pcb_s *ppp_service_pcb =
nullptr;
199 nsapi_ip_stack_t ppp_service_stack = IPV4_STACK;
200 const char *ppp_service_uname =
nullptr;
201 const char *ppp_service_password =
nullptr;
203 bool ppp_service_active : 1;
204 bool ppp_service_event_queued : 1;
205 bool ppp_service_terminating : 1;
206 bool ppp_link_state_up : 1;
Callback class based on template specialization.
This interface should be used to abstract low level access to networking hardware All operations rece...
void resource_lock()
Lock PPP resource.
void set_link_input_cb(ppp_link_input_cb_t input_cb) override
Sets a callback that needs to be called for packets received for that interface.
bool power_up() override
Initializes the hardware.
void set_link_state_cb(ppp_link_state_change_cb_t state_cb) override
Sets a callback that needs to be called on link status changes for given interface.
void link_input(net_stack_mem_buf_t *buf)
Received IP packet from PPP to stack.
const nsapi_addr_t * get_netmask() override
Get the local network mask.
void resource_unlock()
Unlock PPP resource.
events::EventQueue * event_queue_get()
Handle to PPP event queue.
void power_down() override
Deinitializes the hardware.
uint32_t get_align_preference() const override
Gets memory buffer alignment preference.
void set_ip_stack(nsapi_ip_stack_t ip_stack) override
Sets IP protocol versions of IP stack.
bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack) override
Sends the packet over the link.
void link_state(bool up)
Link state indication from PPP.
const nsapi_addr_t * get_ip_address(nsapi_version_t version) override
Gets local IP address.
void get_ifname(char *name, uint8_t size) const override
Return interface name.
void set_memory_manager(NetStackMemoryManager &mem_mngr) override
Sets memory manager that is used to handle memory buffers.
uint32_t get_mtu_size() override
Return maximum transmission unit.
void set_stream(mbed::FileHandle *stream) override
Sets file stream used to communicate with modem.
void set_credentials(const char *uname, const char *password) override
Sets user name and password for PPP protocol.
const nsapi_addr_t * get_gateway() override
Get the local gateway.
const nsapi_addr_t * get_dns_server(uint8_t index) override
Gets DNS server address.
The Mutex class is used to synchronize the execution of threads.
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.
IP address structure for passing IP addresses by value.