コード例 #1
0
/**
 * Call ppp_delete() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_delete(ppp_pcb *pcb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_delete;
  msg.msg.ppp = pcb;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #2
0
/**
 * Call ppp_set_notify_phase_callback() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
void pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_set_notify_phase_callback;
  msg.msg.ppp = pcb;
  msg.msg.msg.setnotifyphasecb.notify_phase_cb = notify_phase_cb;
  TCPIP_PPPAPI(&msg);
}
コード例 #3
0
/**
 * Call ppp_set_netif_linkcallback() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
void pppapi_set_netif_linkcallback(ppp_pcb *pcb, netif_status_callback_fn link_callback) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_set_netif_linkcallback;
  msg.msg.ppp = pcb;
  msg.msg.msg.netiflinkcallback.link_callback = link_callback;
  TCPIP_PPPAPI(&msg);
}
コード例 #4
0
/**
 * Call ppp_open() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_open(ppp_pcb *pcb, u16_t holdoff) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_open;
  msg.msg.ppp = pcb;
  msg.msg.msg.open.holdoff = holdoff;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #5
0
ファイル: pppapi.c プロジェクト: MorgothCreator/mSdk
/**
 * Call ppp_set_default() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
void
pppapi_set_default(ppp_pcb *pcb)
{
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_set_default;
  msg.msg.ppp = pcb;
  TCPIP_PPPAPI(&msg);
}
コード例 #6
0
/**
 * Call ppp_ioctl() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_ioctl(ppp_pcb *pcb, int cmd, void *arg) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_ioctl;
  msg.msg.ppp = pcb;
  msg.msg.msg.ioctl.cmd = cmd;
  msg.msg.msg.ioctl.arg = arg;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #7
0
/**
 * Call ppp_set_auth() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, char *user, char *passwd) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_set_auth;
  msg.msg.ppp = pcb;
  msg.msg.msg.setauth.authtype = authtype;
  msg.msg.msg.setauth.user = user;
  msg.msg.msg.setauth.passwd = passwd;
  TCPIP_PPPAPI(&msg);
}
コード例 #8
0
ファイル: pppapi.c プロジェクト: MorgothCreator/mSdk
/**
 * Call ppp_close() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
err_t
pppapi_close(ppp_pcb *pcb, u8_t nocarrier)
{
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_close;
  msg.msg.ppp = pcb;
  msg.msg.msg.close.nocarrier = nocarrier;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #9
0
ファイル: pppapi.c プロジェクト: MorgothCreator/mSdk
/**
 * Call ppp_listen() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
err_t
pppapi_listen(ppp_pcb *pcb, struct ppp_addrs *addrs)
{
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_listen;
  msg.msg.ppp = pcb;
  msg.msg.msg.listen.addrs = addrs;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #10
0
ファイル: pppapi.c プロジェクト: MorgothCreator/mSdk
/**
 * Call ppp_connect() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
err_t
pppapi_connect(ppp_pcb *pcb, u16_t holdoff)
{
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_connect;
  msg.msg.ppp = pcb;
  msg.msg.msg.connect.holdoff = holdoff;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #11
0
/**
 * Call ppp_over_serial_create() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_over_serial_create(ppp_pcb *pcb, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_over_serial_create;
  msg.msg.ppp = pcb;
  msg.msg.msg.serialcreate.fd = fd;
  msg.msg.msg.serialcreate.link_status_cb = link_status_cb;
  msg.msg.msg.serialcreate.ctx_cb = ctx_cb;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #12
0
ファイル: pppapi.c プロジェクト: MorgothCreator/mSdk
/**
 * Call pppos_create() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
ppp_pcb*
pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb,
               ppp_link_status_cb_fn link_status_cb, void *ctx_cb)
{
  struct pppapi_msg msg;
  msg.function = pppapi_do_pppos_create;
  msg.msg.msg.serialcreate.pppif = pppif;
  msg.msg.msg.serialcreate.output_cb = output_cb;
  msg.msg.msg.serialcreate.link_status_cb = link_status_cb;
  msg.msg.msg.serialcreate.ctx_cb = ctx_cb;
  TCPIP_PPPAPI(&msg);
  return msg.msg.ppp;
}
コード例 #13
0
/**
 * Call ppp_over_ethernet_create() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_over_ethernet_create(ppp_pcb *pcb, struct netif *ethif, const char *service_name,
		const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
		void *ctx_cb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_over_ethernet_create;
  msg.msg.ppp = pcb;
  msg.msg.msg.ethernetcreate.ethif = ethif;
  msg.msg.msg.ethernetcreate.service_name = service_name;
  msg.msg.msg.ethernetcreate.concentrator_name = concentrator_name;
  msg.msg.msg.ethernetcreate.link_status_cb = link_status_cb;
  msg.msg.msg.ethernetcreate.ctx_cb = ctx_cb;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #14
0
/**
 * Call ppp_over_l2tp_create() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
int pppapi_over_l2tp_create(ppp_pcb *pcb, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
		u8_t *secret, u8_t secret_len,
                ppp_link_status_cb_fn link_status_cb, void *ctx_cb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_over_l2tp_create;
  msg.msg.ppp = pcb;
  msg.msg.msg.l2tpcreate.netif = netif;
  msg.msg.msg.l2tpcreate.ipaddr = ipaddr;
  msg.msg.msg.l2tpcreate.port = port;
#if PPPOL2TP_AUTH_SUPPORT
  msg.msg.msg.l2tpcreate.secret = secret;
  msg.msg.msg.l2tpcreate.secret_len = secret_len;
#endif /* PPPOL2TP_AUTH_SUPPORT */
  msg.msg.msg.l2tpcreate.link_status_cb = link_status_cb;
  msg.msg.msg.l2tpcreate.ctx_cb = ctx_cb;
  TCPIP_PPPAPI(&msg);
  return msg.msg.err;
}
コード例 #15
0
ファイル: pppapi.c プロジェクト: Ga-vin/libsylixos
/**
 * Call pppol2tp_create_ip6() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
ppp_pcb*
pppapi_pppol2tp_create_ip6(struct netif *pppif, struct netif *netif, ip6_addr_t *ip6addr, u16_t port,
                           u8_t *secret, u8_t secret_len,
                           ppp_link_status_cb_fn link_status_cb, void *ctx_cb)
{
    struct pppapi_msg msg;
    msg.function = pppapi_do_pppol2tp_create_ip6;
    msg.msg.msg.l2tpcreateip6.pppif = pppif;
    msg.msg.msg.l2tpcreateip6.netif = netif;
    msg.msg.msg.l2tpcreateip6.ip6addr = ip6addr;
    msg.msg.msg.l2tpcreateip6.port = port;
#if PPPOL2TP_AUTH_SUPPORT
    msg.msg.msg.l2tpcreateip6.secret = secret;
    msg.msg.msg.l2tpcreateip6.secret_len = secret_len;
#endif /* PPPOL2TP_AUTH_SUPPORT */
    msg.msg.msg.l2tpcreateip6.link_status_cb = link_status_cb;
    msg.msg.msg.l2tpcreateip6.ctx_cb = ctx_cb;
    TCPIP_PPPAPI(&msg);
    return msg.msg.ppp;
}
コード例 #16
0
/**
 * Call ppp_new() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
ppp_pcb *pppapi_new(void) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_new;
  TCPIP_PPPAPI(&msg);
  return msg.msg.ppp;
}
コード例 #17
0
/**
 * Call ppp_sighup() in a thread-safe way by running that function inside the
 * tcpip_thread context.
 */
void pppapi_sighup(ppp_pcb *pcb) {
  struct pppapi_msg msg;
  msg.function = pppapi_do_ppp_sighup;
  msg.msg.ppp = pcb;
  TCPIP_PPPAPI(&msg);
}