# tcpip.c File Reference

`#include <ubixos/exec.h>`
`#include <lib/kmalloc.h>`
`#include "net/debug.h"`
`#include "net/opt.h"`
`#include "net/sys.h"`
`#include "net/memp.h"`
`#include "net/pbuf.h"`
`#include "net/ipv4/ip.h"`
`#include "net/udp.h"`
`#include "net/tcp.h"`
`#include "net/tcpip.h"`

Go to the source code of this file.

## Functions

void | tcpip_apimsg (struct api_msg *apimsg)
void | tcpip_init (void(*initfunc)(void *), void *arg)
err_t | tcpip_input (struct pbuf *p, struct netif *inp)
static void | tcpip_tcp_timer (void *arg)
static void | tcpip_thread (void *arg)

## Variables

static sys_mbox_t | mbox
static void(*) | tcpip_init_done (void *arg) = NULL
static void * | tcpip_init_done_arg

## Function Documentation

void tcpip_apimsg | ( | struct api_msg * | apimsg | ) |

Definition at line 121 of file tcpip.c.

References tcpip_msg::apimsg, mbox, memp_free(), memp_mallocp(), MEMP_TCPIP_MSG, tcpip_msg::msg, NULL, sys_mbox_post(), and TCPIP_MSG_API.

Referenced by api_msg_post().

void tcpip_init | ( | void(*)(void *) | initfunc,
|  | void * | arg |
| ) |  |  |

Definition at line 135 of file tcpip.c.

References mbox, NULL, sys_mbox_new(), sys_thread_new(), tcpip_init_done, tcpip_init_done_arg, and tcpip_thread().

Referenced by netMainThread().

err_t tcpip_input | ( | struct pbuf * | p,
|  | struct netif * | inp |
| ) |  |  |

Definition at line 101 of file tcpip.c.

References ERR_MEM, ERR_OK, tcpip_msg::inp, mbox, memp_mallocp(), MEMP_TCPIP_MSG, tcpip_msg::msg, NULL, tcpip_msg::p, pbuf_free(), sys_mbox_post(), and TCPIP_MSG_INPUT.

Referenced by netMainThread().

static void tcpip_tcp_timer | ( | void * | arg | ) | `[static]`

Definition at line 60 of file tcpip.c.

References NULL, sys_timeout(), tcp_tmr(), and TCP_TMR_INTERVAL.

Referenced by tcpip_thread().

static void tcpip_thread | ( | void * | arg | ) | `[static]`

Definition at line 68 of file tcpip.c.

References api_msg_input(), ip_init(), ip_input(), mbox, memp_freep(), MEMP_TCPIP_MSG, tcpip_msg::msg, NULL, sys_mbox_fetch(), sys_timeout(), tcp_init(), TCP_TMR_INTERVAL, tcpip_init_done, tcpip_init_done_arg, TCPIP_MSG_API, TCPIP_MSG_INPUT, tcpip_tcp_timer(), and udp_init().

Referenced by tcpip_init().

## Variable Documentation

sys_mbox_t mbox `[static]`

Definition at line 56 of file tcpip.c.

Referenced by accept_function(), mpi_createMbox(), mpi_destroyMbox(), mpi_fetchMessage(), mpi_findMbox(), mpi_postMessage(), mpi_spam(), sys_arch_mbox_fetch(), sys_mbox_free(), sys_mbox_new(), sys_mbox_post(), tcpip_apimsg(), tcpip_init(), tcpip_input(), and tcpip_thread().

void(* ) tcpip_init_done(void *arg) = NULL`[static]`

Definition at line 54 of file tcpip.c.

Referenced by netMainThread(), tcpip_init(), and tcpip_thread().

void* tcpip_init_done_arg `[static]`

Definition at line 55 of file tcpip.c.

Referenced by tcpip_init(), and tcpip_thread().