INET Framework for OMNeT++/OMNEST
inet::tcp Namespace Reference

Classes

class  DcTcp
 Implements DCTCP. More...
 
class  DcTcpFamily
 Provides utility functions to implement DcTcp. More...
 
class  DcTcpFamilyStateVariables
 State variables for DcTcp. More...
 
class  DumbTcp
 A very-very basic TcpAlgorithm implementation, with hardcoded retransmission timeout and no other sophistication. More...
 
class  DumbTcpStateVariables
 State variables for DumbTcp. More...
 
struct  icmp_echo_hdr
 This is the standard ICMP header only that the u32_t data is splitted to two u16_t like ICMP echo needs it. More...
 
struct  in_addr
 
struct  ip_addr
 
struct  ip_addr2
 
struct  ip_hdr
 
struct  ip_pcb
 
class  LwipTcpStackIf
 Interface class between TcpLwip and LwipTcpLayer. More...
 
struct  memp
 
struct  netbuf
 
struct  netif
 Generic data structure used for all lwIP network interfaces. More...
 
struct  pbuf
 
class  Sack
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:87 by opp_msgtool. More...
 
class  SackItem
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:80 by opp_msgtool. More...
 
struct  sys_timeo
 
struct  sys_timeouts
 
class  Tcp
 Implements the Tcp protocol. More...
 
class  TcpAlgorithm
 Abstract base class for TCP algorithms which encapsulate all behaviour during data transfer state: flavour of congestion control, fast retransmit/recovery, selective acknowledgement etc. More...
 
class  TcpBaseAlg
 Includes basic TCP algorithms: adaptive retransmission, PERSIST timer, keep-alive, delayed acks – EXCLUDING congestion control. More...
 
class  TcpBaseAlgStateVariables
 State variables for TcpBaseAlg. More...
 
class  TcpConnection
 Manages a TCP connection. More...
 
class  TcpCrcInsertionHook
 
struct  tcphdr
 
class  TcpHeader
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:176 by opp_msgtool. More...
 
class  TcpHeaderSerializer
 Converts between TcpHeader and binary (network byte order) Tcp header. More...
 
struct  tcpip_msg
 
class  TcpLwip
 Module for using the LwIP TCP stack. More...
 
class  TcpLwipConnection
 Module for representing a connection in TcpLwip stack. More...
 
class  TcpLwipReceiveQueue
 TcpLwip receive queue. More...
 
class  TcpLwipSendQueue
 TcpLwip send queue. More...
 
class  TcpNewReno
 Implements TCP NewReno. More...
 
class  TcpNoCongestionControl
 TCP with no congestion control (i.e. More...
 
class  TcpOption
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:102 by opp_msgtool. More...
 
class  TcpOptionEnd
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:109 by opp_msgtool. More...
 
class  TcpOptionMaxSegmentSize
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:121 by opp_msgtool. More...
 
class  TcpOptionNop
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:115 by opp_msgtool. More...
 
class  TcpOptionSack
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:141 by opp_msgtool. More...
 
class  TcpOptionSackPermitted
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:135 by opp_msgtool. More...
 
class  TcpOptionTimestamp
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:148 by opp_msgtool. More...
 
class  TcpOptionUnknown
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:156 by opp_msgtool. More...
 
class  TcpOptionWindowScale
 Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:128 by opp_msgtool. More...
 
class  TcpReceiveQueue
 Receive queue that manages Chunks. More...
 
class  TcpReno
 Implements TCP Reno. More...
 
class  TcpSackRexmitQueue
 Retransmission data for SACK. More...
 
class  TcpSegmentTransmitInfoList
 
class  TcpSendQueue
 Send queue that manages Chunks. More...
 
class  TcpSpoof
 Sends fabricated TCP packets. More...
 
class  TcpStateVariables
 Contains state variables ("TCB") for TCP. More...
 
class  TcpTahoe
 Implements Tahoe. More...
 
class  TcpTahoeRenoFamily
 Provides utility functions to implement TcpTahoe, TcpReno and TcpNewReno. More...
 
class  TcpTahoeRenoFamilyStateVariables
 State variables for TcpTahoeRenoFamily. More...
 
class  TcpVegas
 
class  TcpVegasStateVariables
 State variables for TcpVegas. More...
 
class  TcpWestwood
 
class  TcpWestwoodStateVariables
 State variables for TcpWestwood. More...
 

Typedefs

typedef DcTcpFamilyStateVariables DcTcpStateVariables
 State variables for DcTcp. More...
 
typedef TcpTahoeRenoFamilyStateVariables TcpNewRenoStateVariables
 State variables for TcpNewReno. More...
 
typedef TcpBaseAlgStateVariables TcpNoCongestionControlStateVariables
 State variables for TcpNoCongestionControl. More...
 
typedef TcpTahoeRenoFamilyStateVariables TcpRenoStateVariables
 State variables for TcpReno. More...
 
typedef TcpTahoeRenoFamilyStateVariables TcpTahoeStateVariables
 State variables for TcpTahoe. More...
 
typedef intptr_t mem_ptr_t
 
typedef uint8_t u8_t
 
typedef uint16_t u16_t
 
typedef uint32_t u32_t
 
typedef int8_t s8_t
 
typedef int16_t s16_t
 
typedef int32_t s32_t
 
typedef void * sys_sem_t
 
typedef void * sys_mbox_t
 
typedef void * sys_thread_t
 
typedef s8_t err_t
 Define LWIP_ERR_T in cc.h if you want to use a different type for your platform (must be signed). More...
 
typedef void(* sys_timeout_handler) (void *arg)
 

Enumerations

enum  TcpState {
  TCP_S_INIT = 0, TCP_S_CLOSED = FSM_Steady(1), TCP_S_LISTEN = FSM_Steady(2), TCP_S_SYN_SENT = FSM_Steady(3),
  TCP_S_SYN_RCVD = FSM_Steady(4), TCP_S_ESTABLISHED = FSM_Steady(5), TCP_S_CLOSE_WAIT = FSM_Steady(6), TCP_S_LAST_ACK = FSM_Steady(7),
  TCP_S_FIN_WAIT_1 = FSM_Steady(8), TCP_S_FIN_WAIT_2 = FSM_Steady(9), TCP_S_CLOSING = FSM_Steady(10), TCP_S_TIME_WAIT = FSM_Steady(11)
}
 
enum  TcpEventCode {
  TCP_E_IGNORE, TCP_E_OPEN_ACTIVE, TCP_E_OPEN_PASSIVE, TCP_E_ACCEPT,
  TCP_E_SEND, TCP_E_CLOSE, TCP_E_ABORT, TCP_E_DESTROY,
  TCP_E_STATUS, TCP_E_QUEUE_BYTES_LIMIT, TCP_E_READ, TCP_E_SETOPTION,
  TCP_E_RCV_DATA, TCP_E_RCV_ACK, TCP_E_RCV_SYN, TCP_E_RCV_SYN_ACK,
  TCP_E_RCV_FIN, TCP_E_RCV_FIN_ACK, TCP_E_RCV_RST, TCP_E_RCV_UNEXP_SYN,
  TCP_E_TIMEOUT_2MSL, TCP_E_TIMEOUT_CONN_ESTAB, TCP_E_TIMEOUT_FIN_WAIT_2
}
 
enum  TcpConstants { TCP_MAX_SACK_ENTRIES = 4 }
 Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:27 by opp_msgtool. More...
 
enum  TcpOptionNumbers {
  TCPOPTION_END_OF_OPTION_LIST = 0, TCPOPTION_NO_OPERATION = 1, TCPOPTION_MAXIMUM_SEGMENT_SIZE = 2, TCPOPTION_WINDOW_SCALE = 3,
  TCPOPTION_SACK_PERMITTED = 4, TCPOPTION_SACK = 5, TCPOPTION_TIMESTAMP = 8
}
 Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:40 by opp_msgtool. More...
 
enum  icmp_dur_type {
  ICMP_DUR_NET = 0, ICMP_DUR_HOST = 1, ICMP_DUR_PROTO = 2, ICMP_DUR_PORT = 3,
  ICMP_DUR_FRAG = 4, ICMP_DUR_SR = 5
}
 
enum  icmp_te_type { ICMP_TE_TTL = 0, ICMP_TE_FRAG = 1 }
 
enum  memp_t { MEMP_MAX }
 
enum  pbuf_layer { PBUF_TRANSPORT, PBUF_IP, PBUF_LINK, PBUF_RAW }
 
enum  pbuf_type { PBUF_RAM, PBUF_ROM, PBUF_REF, PBUF_POOL }
 
enum  snmp_ifType {
  snmp_ifType_other =1, snmp_ifType_regular1822, snmp_ifType_hdh1822, snmp_ifType_ddn_x25,
  snmp_ifType_rfc877_x25, snmp_ifType_ethernet_csmacd, snmp_ifType_iso88023_csmacd, snmp_ifType_iso88024_tokenBus,
  snmp_ifType_iso88025_tokenRing, snmp_ifType_iso88026_man, snmp_ifType_starLan, snmp_ifType_proteon_10Mbit,
  snmp_ifType_proteon_80Mbit, snmp_ifType_hyperchannel, snmp_ifType_fddi, snmp_ifType_lapb,
  snmp_ifType_sdlc, snmp_ifType_ds1, snmp_ifType_e1, snmp_ifType_basicISDN,
  snmp_ifType_primaryISDN, snmp_ifType_propPointToPointSerial, snmp_ifType_ppp, snmp_ifType_softwareLoopback,
  snmp_ifType_eon, snmp_ifType_ethernet_3Mbit, snmp_ifType_nsip, snmp_ifType_slip,
  snmp_ifType_ultra, snmp_ifType_ds3, snmp_ifType_sip, snmp_ifType_frame_relay
}
 
enum  tcpip_msg_type { TCPIP_MSG_INPKT, TCPIP_MSG_CALLBACK, TCPIP_MSG_TIMEOUT, TCPIP_MSG_UNTIMEOUT }
 

Functions

 Register_Class (DcTcp)
 
 Register_Class (DumbTcp)
 
 Register_Class (TcpNewReno)
 
 Register_Class (TcpNoCongestionControl)
 
 Register_Class (TcpReno)
 
 Register_Class (TcpTahoe)
 
 Register_Class (TcpVegas)
 
 Register_Class (TcpWestwood)
 
 Define_Module (Tcp)
 
std::ostream & operator<< (std::ostream &os, const Tcp::SockPair &sp)
 
std::ostream & operator<< (std::ostream &os, const TcpConnection &conn)
 
 Define_Module (TcpConnection)
 
 Register_Class (TcpReceiveQueue)
 
 Register_Class (TcpSendQueue)
 
 Define_Module (TcpCrcInsertionHook)
 
 Register_Class (Sack)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpConstants &e)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpConstants &e)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionNumbers &e)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionNumbers &e)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const SackItem &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, SackItem &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const Sack &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, Sack &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOption &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOption &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionEnd &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionEnd &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionNop &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionNop &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionMaxSegmentSize &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionMaxSegmentSize &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionWindowScale &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionWindowScale &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionSackPermitted &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionSackPermitted &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionSack &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionSack &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionTimestamp &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionTimestamp &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpOptionUnknown &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpOptionUnknown &obj)
 
void doParsimPacking (omnetpp::cCommBuffer *b, const TcpHeader &obj)
 
void doParsimUnpacking (omnetpp::cCommBuffer *b, TcpHeader &obj)
 
 Register_Serializer (TcpHeader, TcpHeaderSerializer)
 
 Define_Module (TcpSpoof)
 
void memp_init (void)
 Initialize this module. More...
 
void * memp_malloc (memp_t type)
 Get an element from a specific pool. More...
 
void memp_free (memp_t type, void *mem)
 Put an element back into its pool. More...
 
struct pbufpbuf_alloc (pbuf_layer layer, u16_t length, pbuf_type type)
 Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type). More...
 
void pbuf_realloc (struct pbuf *p, u16_t new_len)
 Shrink a pbuf chain to a desired length. More...
 
u8_t pbuf_header (struct pbuf *p, s16_t header_size_increment)
 Adjusts the payload pointer to hide or reveal headers in the payload. More...
 
u8_t pbuf_free (struct pbuf *p)
 Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain or queue. More...
 
u8_t pbuf_clen (struct pbuf *p)
 Count number of pbufs in a chain. More...
 
void pbuf_ref (struct pbuf *p)
 Increment the reference count of the pbuf. More...
 
void pbuf_cat (struct pbuf *h, struct pbuf *t)
 Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf. More...
 
void pbuf_chain (struct pbuf *h, struct pbuf *t)
 Chain two pbufs (or pbuf chains) together. More...
 
struct pbufpbuf_dechain (struct pbuf *p)
 Dechains the first pbuf from its succeeding pbufs in the chain. More...
 
err_t pbuf_copy (struct pbuf *p_to, struct pbuf *p_from)
 Create PBUF_RAM copies of pbufs. More...
 
u16_t pbuf_copy_partial (struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
 Copy (part of) the contents of a packet buffer to an application supplied buffer. More...
 
err_t pbuf_take (struct pbuf *buf, const void *dataptr, u16_t len)
 Copy application supplied data into a pbuf. More...
 
struct pbufpbuf_coalesce (struct pbuf *p, pbuf_layer layer)
 Creates a single pbuf out of a queue of pbufs. More...
 
u32_t inet_addr (const char *cp)
 
int inet_aton (const char *cp, struct in_addr *addr)
 
char * inet_ntoa (struct in_addr addr)
 
u16_t inet_chksum (void *dataptr, u16_t len)
 
u16_t inet_chksum_pbuf (struct pbuf *p)
 
u16_t inet_chksum_pseudo (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t proto, u16_t proto_len)
 
u8_t ip_addr_isbroadcast (struct ip_addr *, struct netif *)
 
struct netifip_route (struct ip_addr *dest)
 
err_t ip_input (struct pbuf *p, struct netif *inp)
 
err_t ip_output (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t tos, u8_t proto)
 
err_t ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif)
 
struct netbufnetbuf_new (void)
 
void netbuf_delete (struct netbuf *buf)
 
void * netbuf_alloc (struct netbuf *buf, u16_t size)
 
void netbuf_free (struct netbuf *buf)
 
err_t netbuf_ref (struct netbuf *buf, const void *dataptr, u16_t size)
 
void netbuf_chain (struct netbuf *head, struct netbuf *tail)
 
u16_t netbuf_len (struct netbuf *buf)
 
err_t netbuf_data (struct netbuf *buf, void **dataptr, u16_t *len)
 
s8_t netbuf_next (struct netbuf *buf)
 
void netbuf_first (struct netbuf *buf)
 
struct netifnetif_add (struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw, void *state, err_t(*init)(struct netif *netif), err_t(*input)(struct pbuf *p, struct netif *netif))
 
void netif_set_addr (struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw)
 
void netif_remove (struct netif *netif)
 
struct netifnetif_find (char *name)
 
void netif_set_default (struct netif *netif)
 
void netif_set_ipaddr (struct netif *netif, struct ip_addr *ipaddr)
 
void netif_set_netmask (struct netif *netif, struct ip_addr *netmask)
 
void netif_set_gw (struct netif *netif, struct ip_addr *gw)
 
void netif_set_up (struct netif *netif)
 
void netif_set_down (struct netif *netif)
 
u8_t netif_is_up (struct netif *netif)
 
void pbuf_ref_chain (struct pbuf *p)
 
void sys_init (void)
 
void sys_timeout (u32_t msecs, sys_timeout_handler h, void *arg)
 
void sys_untimeout (sys_timeout_handler h, void *arg)
 
struct sys_timeoutssys_arch_timeouts (void)
 
sys_sem_t sys_sem_new (u8_t count)
 
void sys_sem_signal (sys_sem_t sem)
 
u32_t sys_arch_sem_wait (sys_sem_t sem, u32_t timeout)
 
void sys_sem_free (sys_sem_t sem)
 
void sys_sem_wait (sys_sem_t sem)
 
int sys_sem_wait_timeout (sys_sem_t sem, u32_t timeout)
 
void sys_msleep (u32_t ms)
 
u32_t sys_jiffies (void)
 
sys_mbox_t sys_mbox_new (int size)
 
void sys_mbox_post (sys_mbox_t mbox, void *msg)
 
err_t sys_mbox_trypost (sys_mbox_t mbox, void *msg)
 
u32_t sys_arch_mbox_fetch (sys_mbox_t mbox, void **msg, u32_t timeout)
 
u32_t sys_arch_mbox_tryfetch (sys_mbox_t mbox, void **msg)
 
void sys_mbox_free (sys_mbox_t mbox)
 
void sys_mbox_fetch (sys_mbox_t mbox, void **msg)
 
sys_thread_t sys_thread_new (char *name, void(*thread)(void *arg), void *arg, int stacksize, int prio)
 
u32_t sys_now (void)
 Returns the current time in milliseconds. More...
 
void tcpip_init (void(*tcpip_init_done)(void *), void *arg)
 
err_t tcpip_input (struct pbuf *p, struct netif *inp)
 
err_t tcpip_callback_with_block (void(*f)(void *ctx), void *ctx, u8_t block)
 
err_t pbuf_free_callback (struct pbuf *p)
 
err_t mem_free_callback (void *m)
 
err_t tcpip_timeout (u32_t msecs, sys_timeout_handler h, void *arg)
 
err_t tcpip_untimeout (sys_timeout_handler h, void *arg)
 
err_t loopif_init (struct netif *netif)
 
err_t slipif_init (struct netif *netif)
 
void slipif_poll (struct netif *netif)
 
 Register_Class (TcpLwipSendQueue)
 
 Register_Class (TcpLwipReceiveQueue)
 
 Define_Module (TcpLwip)
 
simtime_t roundTime (const simtime_t &timeP, int secSlicesP)
 
 Define_Module (TcpLwipConnection)
 

Variables

const B TCP_MIN_HEADER_LENGTH = B(20)
 
const B TCP_MAX_HEADER_LENGTH = B(60)
 
const B TCP_OPTIONS_MAX_SIZE = B(40)
 
const B TCP_OPTION_HEAD_SIZE = B(2)
 
const B TCP_OPTION_SACK_MIN_SIZE = B(10)
 
const B TCP_OPTION_SACK_ENTRY_SIZE = B(8)
 
const B TCP_OPTION_TS_SIZE = B(12)
 
PACK_STRUCT_BEGIN struct inet::tcp::ip_addr2 PACK_STRUCT_STRUCT
 
const struct ip_addr ip_addr_any
 
const struct ip_addr ip_addr_broadcast
 
struct netifcurrent_netif
 The interface that provided the packet for the current callback invocation. More...
 
const struct ip_hdrcurrent_header
 Header of the input packet currently being processed. More...
 
struct netifnetif_list
 The list of network interfaces. More...
 
struct netifnetif_default
 The default network interface. More...
 

Typedef Documentation

◆ DcTcpStateVariables

◆ err_t

Define LWIP_ERR_T in cc.h if you want to use a different type for your platform (must be signed).

◆ mem_ptr_t

typedef intptr_t inet::tcp::mem_ptr_t

◆ s16_t

typedef int16_t inet::tcp::s16_t

◆ s32_t

typedef int32_t inet::tcp::s32_t

◆ s8_t

typedef int8_t inet::tcp::s8_t

◆ SackList

typedef std::list<Sack> inet::tcp::SackList

◆ sys_mbox_t

typedef void* inet::tcp::sys_mbox_t

◆ sys_sem_t

typedef void* inet::tcp::sys_sem_t

◆ sys_thread_t

typedef void* inet::tcp::sys_thread_t

◆ sys_timeout_handler

typedef void(* inet::tcp::sys_timeout_handler) (void *arg)

◆ TcpNewRenoStateVariables

◆ TcpNoCongestionControlStateVariables

◆ TcpRenoStateVariables

◆ TcpTahoeStateVariables

◆ u16_t

typedef uint16_t inet::tcp::u16_t

◆ u32_t

typedef uint32_t inet::tcp::u32_t

◆ u8_t

typedef uint8_t inet::tcp::u8_t

Enumeration Type Documentation

◆ icmp_dur_type

Enumerator
ICMP_DUR_NET 
ICMP_DUR_HOST 
ICMP_DUR_PROTO 
ICMP_DUR_PORT 
ICMP_DUR_FRAG 
ICMP_DUR_SR 
60  {
61  ICMP_DUR_NET = 0, /* net unreachable */
62  ICMP_DUR_HOST = 1, /* host unreachable */
63  ICMP_DUR_PROTO = 2, /* protocol unreachable */
64  ICMP_DUR_PORT = 3, /* port unreachable */
65  ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */
66  ICMP_DUR_SR = 5 /* source route failed */
67 };

◆ icmp_te_type

Enumerator
ICMP_TE_TTL 
ICMP_TE_FRAG 
69  {
70  ICMP_TE_TTL = 0, /* time to live exceeded in transit */
71  ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */
72 };

◆ memp_t

Enumerator
MEMP_MAX 
56  {
57 #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
58 #include "lwip/memp_std.h"
59  MEMP_MAX
60 } memp_t;

◆ pbuf_layer

Enumerator
PBUF_TRANSPORT 
PBUF_IP 
PBUF_LINK 
PBUF_RAW 
50  {
52  PBUF_IP,
53  PBUF_LINK,
54  PBUF_RAW
55 } pbuf_layer;

◆ pbuf_type

Enumerator
PBUF_RAM 
PBUF_ROM 
PBUF_REF 
PBUF_POOL 
57  {
58  PBUF_RAM, /* pbuf data is stored in RAM */
59  PBUF_ROM, /* pbuf data is stored in ROM */
60  PBUF_REF, /* pbuf comes from the pbuf pool */
61  PBUF_POOL /* pbuf payload refers to RAM */
62 } pbuf_type;

◆ snmp_ifType

See also
RFC1213, "MIB-II, 6. Definitions"
Enumerator
snmp_ifType_other 
snmp_ifType_regular1822 
snmp_ifType_hdh1822 
snmp_ifType_ddn_x25 
snmp_ifType_rfc877_x25 
snmp_ifType_ethernet_csmacd 
snmp_ifType_iso88023_csmacd 
snmp_ifType_iso88024_tokenBus 
snmp_ifType_iso88025_tokenRing 
snmp_ifType_iso88026_man 
snmp_ifType_starLan 
snmp_ifType_proteon_10Mbit 
snmp_ifType_proteon_80Mbit 
snmp_ifType_hyperchannel 
snmp_ifType_fddi 
snmp_ifType_lapb 
snmp_ifType_sdlc 
snmp_ifType_ds1 
snmp_ifType_e1 
snmp_ifType_basicISDN 
snmp_ifType_primaryISDN 
snmp_ifType_propPointToPointSerial 
snmp_ifType_ppp 
snmp_ifType_softwareLoopback 
snmp_ifType_eon 
snmp_ifType_ethernet_3Mbit 
snmp_ifType_nsip 
snmp_ifType_slip 
snmp_ifType_ultra 
snmp_ifType_ds3 
snmp_ifType_sip 
snmp_ifType_frame_relay 

◆ TcpConstants

Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:27 by opp_msgtool.

enum TcpConstants
{
    // maximum allowed sack entry number, if no other options are used
    TCP_MAX_SACK_ENTRIES = 4;
}
Enumerator
TCP_MAX_SACK_ENTRIES 
83  {
85 };

◆ TcpEventCode

Enumerator
TCP_E_IGNORE 
TCP_E_OPEN_ACTIVE 
TCP_E_OPEN_PASSIVE 
TCP_E_ACCEPT 
TCP_E_SEND 
TCP_E_CLOSE 
TCP_E_ABORT 
TCP_E_DESTROY 
TCP_E_STATUS 
TCP_E_QUEUE_BYTES_LIMIT 
TCP_E_READ 
TCP_E_SETOPTION 
TCP_E_RCV_DATA 
TCP_E_RCV_ACK 
TCP_E_RCV_SYN 
TCP_E_RCV_SYN_ACK 
TCP_E_RCV_FIN 
TCP_E_RCV_FIN_ACK 
TCP_E_RCV_RST 
TCP_E_RCV_UNEXP_SYN 
TCP_E_TIMEOUT_2MSL 
TCP_E_TIMEOUT_CONN_ESTAB 
TCP_E_TIMEOUT_FIN_WAIT_2 
65  {
67 
68  // app commands
69  // (Note: no RECEIVE command, data are automatically passed up)
73  TCP_E_SEND,
79  TCP_E_READ,
81 
82  // TPDU types
89  TCP_E_RCV_RST, // covers RST+ACK too
90 
91  TCP_E_RCV_UNEXP_SYN, // unexpected SYN
92 
93  // timers
94  TCP_E_TIMEOUT_2MSL, // RFC 793, a.k.a. TIME-WAIT timer
97 
98  // All other timers (REXMT, PERSIST, DELAYED-ACK, KEEP-ALIVE, etc.),
99  // are handled in TcpAlgorithm.
100 };

◆ tcpip_msg_type

Enumerator
TCPIP_MSG_INPKT 
TCPIP_MSG_CALLBACK 
TCPIP_MSG_TIMEOUT 
TCPIP_MSG_UNTIMEOUT 
100  {
101 #if LWIP_NETCONN
102  TCPIP_MSG_API,
103 #endif /* LWIP_NETCONN */
105 #if LWIP_NETIF_API
106  TCPIP_MSG_NETIFAPI,
107 #endif /* LWIP_NETIF_API */
111 };

◆ TcpOptionNumbers

Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:40 by opp_msgtool.

//
// TCP Option Numbers
// Reference: http://www.iana.org/assignments/tcp-parameters/
// Date: 2011-07-02
//
// Note: Options not yet implemented should stay commented out
//
enum TcpOptionNumbers
{
    TCPOPTION_END_OF_OPTION_LIST = 0;                   // RFC 793, LENGTH: 1 Byte
    TCPOPTION_NO_OPERATION = 1;                         // RFC 793, LENGTH: 1 Byte
    TCPOPTION_MAXIMUM_SEGMENT_SIZE = 2;                 // RFC 793, LENGTH: 4 Bytes
    TCPOPTION_WINDOW_SCALE = 3;                         // RFC 1323, LENGTH: 3 Bytes
    TCPOPTION_SACK_PERMITTED = 4;                       // RFC 2018, LENGTH: 2 Bytes
    TCPOPTION_SACK = 5;                                 // RFC 2018, LENGTH: N (max. N = 4) 8 * n + 2 Bytes  => 32 + 2 + 2 * NOP = 36 Bytes; If TIMESTAMP option is used with SACK: max. n = 3 => 12 Bytes (for Timestamp) + 28 Bytes (for SACK) = 40 Bytes
    //    TCPOPTION_ECHO = 6;                               // (obsoleted by option 8) RFC 1072 & RFC 6247, LENGTH: 6 Bytes
    //    TCPOPTION_ECHO_REPLY = 7;                         // (obsoleted by option 8) RFC 1072 & RFC 6247, LENGTH: 6 Bytes
    TCPOPTION_TIMESTAMP = 8;                            // RFC 1323, LENGTH: 10 Bytes
}
Enumerator
TCPOPTION_END_OF_OPTION_LIST 
TCPOPTION_NO_OPERATION 
TCPOPTION_MAXIMUM_SEGMENT_SIZE 
TCPOPTION_WINDOW_SCALE 
TCPOPTION_SACK_PERMITTED 
TCPOPTION_SACK 
TCPOPTION_TIMESTAMP 

◆ TcpState

Enumerator
TCP_S_INIT 
TCP_S_CLOSED 
TCP_S_LISTEN 
TCP_S_SYN_SENT 
TCP_S_SYN_RCVD 
TCP_S_ESTABLISHED 
TCP_S_CLOSE_WAIT 
TCP_S_LAST_ACK 
TCP_S_FIN_WAIT_1 
TCP_S_FIN_WAIT_2 
TCP_S_CLOSING 
TCP_S_TIME_WAIT 
46  {
47  TCP_S_INIT = 0,
48  TCP_S_CLOSED = FSM_Steady(1),
49  TCP_S_LISTEN = FSM_Steady(2),
50  TCP_S_SYN_SENT = FSM_Steady(3),
51  TCP_S_SYN_RCVD = FSM_Steady(4),
52  TCP_S_ESTABLISHED = FSM_Steady(5),
53  TCP_S_CLOSE_WAIT = FSM_Steady(6),
54  TCP_S_LAST_ACK = FSM_Steady(7),
55  TCP_S_FIN_WAIT_1 = FSM_Steady(8),
56  TCP_S_FIN_WAIT_2 = FSM_Steady(9),
57  TCP_S_CLOSING = FSM_Steady(10),
58  TCP_S_TIME_WAIT = FSM_Steady(11)
59 };

Function Documentation

◆ Define_Module() [1/6]

inet::tcp::Define_Module ( Tcp  )

◆ Define_Module() [2/6]

inet::tcp::Define_Module ( TcpConnection  )

◆ Define_Module() [3/6]

inet::tcp::Define_Module ( TcpCrcInsertionHook  )

◆ Define_Module() [4/6]

inet::tcp::Define_Module ( TcpLwip  )

◆ Define_Module() [5/6]

inet::tcp::Define_Module ( TcpLwipConnection  )

◆ Define_Module() [6/6]

inet::tcp::Define_Module ( TcpSpoof  )

◆ doParsimPacking() [1/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const Sack obj 
)
inline
209 {obj.parsimPack(b);}

◆ doParsimPacking() [2/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const SackItem obj 
)
inline
169 {obj.parsimPack(b);}

◆ doParsimPacking() [3/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpConstants e 
)
inline
87 { b->pack(static_cast<int>(e)); }

◆ doParsimPacking() [4/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpHeader obj 
)
inline
759 {obj.parsimPack(b);}

◆ doParsimPacking() [5/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOption obj 
)
inline
252 {obj.parsimPack(b);}

◆ doParsimPacking() [6/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionEnd obj 
)
inline
285 {obj.parsimPack(b);}

◆ doParsimPacking() [7/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionMaxSegmentSize obj 
)
inline
356 {obj.parsimPack(b);}

◆ doParsimPacking() [8/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionNop obj 
)
inline
318 {obj.parsimPack(b);}

◆ doParsimPacking() [9/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionNumbers e 
)
inline
124 { b->pack(static_cast<int>(e)); }

◆ doParsimPacking() [10/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionSack obj 
)
inline
473 {obj.parsimPack(b);}

◆ doParsimPacking() [11/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionSackPermitted obj 
)
inline
427 {obj.parsimPack(b);}

◆ doParsimPacking() [12/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionTimestamp obj 
)
inline
516 {obj.parsimPack(b);}

◆ doParsimPacking() [13/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionUnknown obj 
)
inline
560 {obj.parsimPack(b);}

◆ doParsimPacking() [14/14]

void inet::tcp::doParsimPacking ( omnetpp::cCommBuffer *  b,
const TcpOptionWindowScale obj 
)
inline
394 {obj.parsimPack(b);}

◆ doParsimUnpacking() [1/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
Sack obj 
)
inline
210 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [2/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
SackItem obj 
)
inline
170 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [3/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpConstants e 
)
inline
88 { int n; b->unpack(n); e = static_cast<TcpConstants>(n); }

◆ doParsimUnpacking() [4/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpHeader obj 
)
inline
760 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [5/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOption obj 
)
inline
253 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [6/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionEnd obj 
)
inline
286 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [7/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionMaxSegmentSize obj 
)
inline
357 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [8/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionNop obj 
)
inline
319 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [9/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionNumbers e 
)
inline
125 { int n; b->unpack(n); e = static_cast<TcpOptionNumbers>(n); }

◆ doParsimUnpacking() [10/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionSack obj 
)
inline
474 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [11/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionSackPermitted obj 
)
inline
428 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [12/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionTimestamp obj 
)
inline
517 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [13/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionUnknown obj 
)
inline
561 {obj.parsimUnpack(b);}

◆ doParsimUnpacking() [14/14]

void inet::tcp::doParsimUnpacking ( omnetpp::cCommBuffer *  b,
TcpOptionWindowScale obj 
)
inline
395 {obj.parsimUnpack(b);}

◆ inet_addr()

u32_t inet::tcp::inet_addr ( const char *  cp)

◆ inet_aton()

int inet::tcp::inet_aton ( const char *  cp,
struct in_addr addr 
)

◆ inet_chksum()

u16_t inet::tcp::inet_chksum ( void *  dataptr,
u16_t  len 
)

◆ inet_chksum_pbuf()

u16_t inet::tcp::inet_chksum_pbuf ( struct pbuf p)

◆ inet_chksum_pseudo()

u16_t inet::tcp::inet_chksum_pseudo ( struct pbuf p,
struct ip_addr src,
struct ip_addr dest,
u8_t  proto,
u16_t  proto_len 
)

◆ inet_ntoa()

char* inet::tcp::inet_ntoa ( struct in_addr  addr)

◆ ip_addr_isbroadcast()

u8_t inet::tcp::LwipTcpLayer::ip_addr_isbroadcast ( struct ip_addr addr,
struct netif interf 
)
98 {
99  // TODO implementing this if need
100  return 0;
101 }

◆ ip_input()

err_t inet::tcp::ip_input ( struct pbuf p,
struct netif inp 
)

◆ ip_output()

err_t inet::tcp::ip_output ( struct pbuf p,
struct ip_addr src,
struct ip_addr dest,
u8_t  ttl,
u8_t  tos,
u8_t  proto 
)

◆ ip_output_if()

err_t inet::tcp::ip_output_if ( struct pbuf p,
struct ip_addr src,
struct ip_addr dest,
u8_t  ttl,
u8_t  tos,
u8_t  proto,
struct netif netif 
)

◆ ip_route()

struct netif* inet::tcp::ip_route ( struct ip_addr dest)

◆ loopif_init()

err_t inet::tcp::loopif_init ( struct netif netif)

◆ mem_free_callback()

err_t inet::tcp::mem_free_callback ( void *  m)

◆ memp_free()

void inet::tcp::LwipTcpLayer::memp_free ( memp_t  type,
void *  mem 
)

Put an element back into its pool.

Parameters
typethe pool where to put mem
memthe memp element to free
357 {
358  struct memp *memp;
359  SYS_ARCH_DECL_PROTECT(old_level);
360 
361  if (mem == nullptr) {
362  return;
363  }
364  LWIP_ASSERT("memp_free: mem properly aligned",
365  ((mem_ptr_t)mem % MEM_ALIGNMENT) == 0);
366 
367  memp = (struct memp *)((u8_t*)mem - MEMP_SIZE);
368 
369  SYS_ARCH_PROTECT(old_level);
370 #if MEMP_OVERFLOW_CHECK
371 #if MEMP_OVERFLOW_CHECK >= 2
372  memp_overflow_check_all();
373 #else
374  memp_overflow_check_element(memp, memp_sizes[type]);
375 #endif /* MEMP_OVERFLOW_CHECK >= 2 */
376 #endif /* MEMP_OVERFLOW_CHECK */
377 
378  MEMP_STATS_DEC(used, type);
379 
380  memp->next = memp_tab[type];
381  memp_tab[type] = memp;
382 
383 #if MEMP_SANITY_CHECK
384  LWIP_ASSERT("memp sanity", memp_sanity());
385 #endif /* MEMP_SANITY_CHECK */
386 
387  SYS_ARCH_UNPROTECT(old_level);
388 }

Referenced by pbuf_free(), and inet::tcp::TcpLwipConnection::~TcpLwipConnection().

◆ memp_init()

void inet::tcp::memp_init ( void  )

Initialize this module.

Carves out memp_memory into linked lists for each pool-type.

265 {
266  struct memp *memp;
267  u16_t i, j;
268 
269  for (i = 0; i < MEMP_MAX; ++i) {
270  MEMP_STATS_AVAIL(used, i, 0);
271  MEMP_STATS_AVAIL(max, i, 0);
272  MEMP_STATS_AVAIL(err, i, 0);
273  MEMP_STATS_AVAIL(avail, i, memp_num[i]);
274  }
275 
276  memp = LWIP_MEM_ALIGN(memp_memory);
277  /* for every pool: */
278  for (i = 0; i < MEMP_MAX; ++i) {
279  memp_tab[i] = nullptr;
280  /* create a linked list of memp elements */
281  for (j = 0; j < memp_num[i]; ++j) {
282  memp->next = memp_tab[i];
283  memp_tab[i] = memp;
284  memp = (struct memp *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
285 #if MEMP_OVERFLOW_CHECK
286  + MEMP_SANITY_REGION_AFTER_ALIGNED
287 #endif
288  );
289  }
290  }
291 #if MEMP_OVERFLOW_CHECK
292  memp_overflow_init();
293  /* check everything a first time to see if it worked */
294  memp_overflow_check_all();
295 #endif /* MEMP_OVERFLOW_CHECK */
296 }

◆ memp_malloc()

void * inet::tcp::memp_malloc ( memp_t  type)

Get an element from a specific pool.

Parameters
typethe pool to get an element from

the debug version has two more parameters:

Parameters
filefile name calling this function
linenumber of line where this function is called
Returns
a pointer to the allocated memory or a nullptr pointer on error
315 {
316  struct memp *memp;
317  SYS_ARCH_DECL_PROTECT(old_level);
318 
319  LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return nullptr;);
320 
321  SYS_ARCH_PROTECT(old_level);
322 #if MEMP_OVERFLOW_CHECK >= 2
323  memp_overflow_check_all();
324 #endif /* MEMP_OVERFLOW_CHECK >= 2 */
325 
326  memp = memp_tab[type];
327 
328  if (memp != nullptr) {
329  memp_tab[type] = memp->next;
330 #if MEMP_OVERFLOW_CHECK
331  memp->next = nullptr;
332  memp->file = file;
333  memp->line = line;
334 #endif /* MEMP_OVERFLOW_CHECK */
335  MEMP_STATS_INC_USED(used, type);
336  LWIP_ASSERT("memp_malloc: memp properly aligned",
337  ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0);
338  memp = (struct memp*)((u8_t*)memp + MEMP_SIZE);
339  } else {
340  LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", memp_desc[type]));
341  MEMP_STATS_INC(err, type);
342  }
343 
344  SYS_ARCH_UNPROTECT(old_level);
345 
346  return memp;
347 }

Referenced by pbuf_alloc().

◆ netbuf_alloc()

void* inet::tcp::netbuf_alloc ( struct netbuf buf,
u16_t  size 
)

◆ netbuf_chain()

void inet::tcp::netbuf_chain ( struct netbuf head,
struct netbuf tail 
)

◆ netbuf_data()

err_t inet::tcp::netbuf_data ( struct netbuf buf,
void **  dataptr,
u16_t len 
)

◆ netbuf_delete()

void inet::tcp::netbuf_delete ( struct netbuf buf)

◆ netbuf_first()

void inet::tcp::netbuf_first ( struct netbuf buf)

◆ netbuf_free()

void inet::tcp::netbuf_free ( struct netbuf buf)

◆ netbuf_len()

u16_t inet::tcp::netbuf_len ( struct netbuf buf)

◆ netbuf_new()

struct netbuf* inet::tcp::netbuf_new ( void  )

◆ netbuf_next()

s8_t inet::tcp::netbuf_next ( struct netbuf buf)

◆ netbuf_ref()

err_t inet::tcp::netbuf_ref ( struct netbuf buf,
const void *  dataptr,
u16_t  size 
)

◆ netif_add()

struct netif* inet::tcp::netif_add ( struct netif netif,
struct ip_addr ipaddr,
struct ip_addr netmask,
struct ip_addr gw,
void *  state,
err_t(*)(struct netif *netif init,
err_t(*)(struct pbuf *p, struct netif *netif input 
)

◆ netif_find()

struct netif* inet::tcp::netif_find ( char *  name)

◆ netif_is_up()

u8_t inet::tcp::netif_is_up ( struct netif netif)

◆ netif_remove()

void inet::tcp::netif_remove ( struct netif netif)

◆ netif_set_addr()

void inet::tcp::netif_set_addr ( struct netif netif,
struct ip_addr ipaddr,
struct ip_addr netmask,
struct ip_addr gw 
)

◆ netif_set_default()

void inet::tcp::netif_set_default ( struct netif netif)

◆ netif_set_down()

void inet::tcp::netif_set_down ( struct netif netif)

◆ netif_set_gw()

void inet::tcp::netif_set_gw ( struct netif netif,
struct ip_addr gw 
)

◆ netif_set_ipaddr()

void inet::tcp::netif_set_ipaddr ( struct netif netif,
struct ip_addr ipaddr 
)

◆ netif_set_netmask()

void inet::tcp::netif_set_netmask ( struct netif netif,
struct ip_addr netmask 
)

◆ netif_set_up()

void inet::tcp::netif_set_up ( struct netif netif)

◆ operator<<() [1/2]

std::ostream& inet::tcp::operator<< ( std::ostream &  os,
const Tcp::SockPair sp 
)
539 {
540  os << "locSocket=" << sp.localAddr << ":" << sp.localPort << " "
541  << "remSocket=" << sp.remoteAddr << ":" << sp.remotePort;
542  return os;
543 }

◆ operator<<() [2/2]

std::ostream& inet::tcp::operator<< ( std::ostream &  os,
const TcpConnection conn 
)
546 {
547  os << "socketId=" << conn.socketId << " ";
548  os << "fsmState=" << TcpConnection::stateName(conn.getFsmState()) << " ";
549  os << "connection=" << (conn.getState() == nullptr ? "<empty>" : conn.getState()->str()) << " ";
550  os << "ttl=" << (conn.ttl == -1 ? "<default>" : std::to_string(conn.ttl)) << " ";
551  return os;
552 }

◆ pbuf_alloc()

struct pbuf * inet::tcp::pbuf_alloc ( pbuf_layer  layer,
u16_t  length,
pbuf_type  type 
)

Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).

The actual memory allocated for the pbuf is determined by the layer at which the pbuf is allocated and the requested size (from the size parameter).

Parameters
layerflag to define header size
lengthsize of the pbuf's payload
typethis parameter decides how and where the pbuf should be allocated as follows:
  • PBUF_RAM: buffer memory for pbuf is allocated as one large chunk. This includes protocol headers as well.
  • PBUF_ROM: no buffer memory is allocated for the pbuf, even for protocol headers. Additional headers must be prepended by allocating another pbuf and chain in to the front of the ROM pbuf. It is assumed that the memory used is really similar to ROM in that it is immutable and will not be changed. Memory which is dynamic should generally not be attached to PBUF_ROM pbufs. Use PBUF_REF instead.
  • PBUF_REF: no buffer memory is allocated for the pbuf, even for protocol headers. It is assumed that the pbuf is only being used in a single thread. If the pbuf gets queued, then pbuf_take should be called to copy the buffer.
  • PBUF_POOL: the pbuf is allocated as a pbuf chain, with pbufs from the pbuf pool that is allocated during pbuf_init().
Returns
the allocated pbuf. If multiple pbufs where allocated, this is the first pbuf of a pbuf chain.
211 {
212  struct pbuf *p, *q, *r;
213  u16_t offset;
214  s32_t rem_len; /* remaining length */
215  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%" U16_F ")\n", length));
216 
217  /* determine header offset */
218  offset = 0;
219  switch (layer) {
220  case PBUF_TRANSPORT:
221  /* add room for transport (often TCP) layer header */
222  offset += PBUF_TRANSPORT_HLEN;
223  /* FALLTHROUGH */
224  case PBUF_IP:
225  /* add room for IP layer header */
226  offset += PBUF_IP_HLEN;
227  /* FALLTHROUGH */
228  case PBUF_LINK:
229  /* add room for link layer header */
230  offset += PBUF_LINK_HLEN;
231  break;
232  case PBUF_RAW:
233  break;
234  default:
235  LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0);
236  return nullptr;
237  }
238 
239  switch (type) {
240  case PBUF_POOL:
241  /* allocate head of pbuf chain into p */
242  p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
243  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
244  if (p == nullptr) {
246  return nullptr;
247  }
248  p->type = type;
249  p->next = nullptr;
250 
251  /* make the payload pointer point 'offset' bytes into pbuf data memory */
252  p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
253  LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
254  ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
255  /* the total length of the pbuf chain is the requested size */
256  p->tot_len = length;
257  /* set the length of the first pbuf in the chain */
258  p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
259  LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
260  ((u8_t*)p->payload + p->len <=
262  LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
264  /* set reference count (needed here in case we fail) */
265  p->ref = 1;
266 
267  /* now allocate the tail of the pbuf chain */
268 
269  /* remember first pbuf for linkage in next iteration */
270  r = p;
271  /* remaining length to be allocated */
272  rem_len = length - p->len;
273  /* any remaining pbufs to be allocated? */
274  while (rem_len > 0) {
275  q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
276  if (q == nullptr) {
278  /* free chain so far allocated */
279  pbuf_free(p);
280  /* bail out unsuccesfully */
281  return nullptr;
282  }
283  q->type = type;
284  q->flags = 0;
285  q->next = nullptr;
286  /* make previous pbuf point to this pbuf */
287  r->next = q;
288  /* set total length of this pbuf and next in chain */
289  LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
290  q->tot_len = (u16_t)rem_len;
291  /* this pbuf length is pool size, unless smaller sized tail */
292  q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
293  q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
294  LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
295  ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
296  LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
297  ((u8_t*)p->payload + p->len <=
299  q->ref = 1;
300  /* calculate remaining length to be allocated */
301  rem_len -= q->len;
302  /* remember this pbuf for linkage in next iteration */
303  r = q;
304  }
305  /* end of chain */
306  /*r->next = nullptr;*/
307 
308  break;
309  case PBUF_RAM:
310  /* If pbuf is to be allocated in RAM, allocate memory for it. */
311  p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
312  if (p == nullptr) {
313  return nullptr;
314  }
315  /* Set up internal structure of the pbuf. */
316  p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
317  p->len = p->tot_len = length;
318  p->next = nullptr;
319  p->type = type;
320 
321  LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned",
322  ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
323  break;
324  /* pbuf references existing (non-volatile static constant) ROM payload? */
325  case PBUF_ROM:
326  /* pbuf references existing (externally allocated) RAM payload? */
327  case PBUF_REF:
328  /* only allocate memory for the pbuf structure */
329  p = (struct pbuf *)memp_malloc(MEMP_PBUF);
330  if (p == nullptr) {
332  ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n",
333  (type == PBUF_ROM) ? "ROM" : "REF"));
334  return nullptr;
335  }
336  /* caller must set this field properly, afterwards */
337  p->payload = nullptr;
338  p->len = p->tot_len = length;
339  p->next = nullptr;
340  p->type = type;
341  break;
342  default:
343  LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
344  return nullptr;
345  }
346  /* set reference count */
347  p->ref = 1;
348  /* set flags */
349  p->flags = 0;
350  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%" U16_F ") == %p\n", length, (void *)p));
351  return p;
352 }

Referenced by pbuf_coalesce().

◆ pbuf_cat()

void inet::tcp::pbuf_cat ( struct pbuf h,
struct pbuf t 
)

Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf.

Note
The caller MAY NOT reference the tail pbuf afterwards. Use pbuf_chain() for that purpose.
See also
pbuf_chain()
677 {
678  struct pbuf *p;
679 
680  LWIP_ERROR("(h != nullptr) && (t != nullptr) (programmer violates API)",
681  ((h != nullptr) && (t != nullptr)), return;);
682 
683  /* proceed to last pbuf of chain */
684  for (p = h; p->next != nullptr; p = p->next) {
685  /* add total length of second chain to all totals of first chain */
686  p->tot_len += t->tot_len;
687  }
688  /* { p is last pbuf of first h chain, p->next == nullptr } */
689  LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
690  LWIP_ASSERT("p->next == nullptr", p->next == nullptr);
691  /* add total length of second chain to last pbuf total of first chain */
692  p->tot_len += t->tot_len;
693  /* chain last pbuf of head (p) with first of tail (t) */
694  p->next = t;
695  /* p->next now references t, but the caller will drop its reference to t,
696  * so netto there is no change to the reference count of t.
697  */
698 }

Referenced by pbuf_chain().

◆ pbuf_chain()

void inet::tcp::pbuf_chain ( struct pbuf h,
struct pbuf t 
)

Chain two pbufs (or pbuf chains) together.

The caller MUST call pbuf_free(t) once it has stopped using it. Use pbuf_cat() instead if you no longer use t.

Parameters
hhead pbuf (chain)
ttail pbuf (chain)
Note
The pbufs MUST belong to the same packet.
MAY NOT be called on a packet queue.

The ->tot_len fields of all pbufs of the head chain are adjusted. The ->next field of the last pbuf of the head chain is adjusted. The ->ref field of the first pbuf of the tail chain is adjusted.

718 {
719  pbuf_cat(h, t);
720  /* t is now referenced by h */
721  pbuf_ref(t);
722  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t));
723 }

◆ pbuf_clen()

u8_t inet::tcp::pbuf_clen ( struct pbuf p)

Count number of pbufs in a chain.

Parameters
pfirst pbuf of chain
Returns
the number of pbufs in a chain
636 {
637  u8_t len;
638 
639  len = 0;
640  while (p != nullptr) {
641  ++len;
642  p = p->next;
643  }
644  return len;
645 }

◆ pbuf_coalesce()

struct pbuf * inet::tcp::pbuf_coalesce ( struct pbuf p,
pbuf_layer  layer 
)

Creates a single pbuf out of a queue of pbufs.

Remarks
: The source pbuf 'p' is not freed by this function because that can be illegal in some places!
Parameters
pthe source pbuf
layerpbuf_layer of the new pbuf
Returns
a new, single pbuf (p->next is nullptr) or the old pbuf if allocation fails
942 {
943  struct pbuf *q;
944  err_t err;
945  if (p->next == nullptr) {
946  return p;
947  }
948  q = pbuf_alloc(layer, p->tot_len, PBUF_RAM);
949  if (q == nullptr) {
950  /* @todo: what do we do now? */
951  return p;
952  }
953  err = pbuf_copy(q, p);
954  LWIP_ASSERT("pbuf_copy failed", err == ERR_OK);
955  pbuf_free(p);
956  return q;
957 }

◆ pbuf_copy()

err_t inet::tcp::pbuf_copy ( struct pbuf p_to,
struct pbuf p_from 
)

Create PBUF_RAM copies of pbufs.

Used to queue packets on behalf of the lwIP stack, such as ARP based queueing.

Note
You MUST explicitly use p = pbuf_take(p);
Only one packet is copied, no packet queue!
Parameters
p_topbuf destination of the copy
p_frompbuf source of the copy
Returns
ERR_OK if pbuf was copied ERR_ARG if one of the pbufs is nullptr or p_to is not big enough to hold p_from
784 {
785  u16_t offset_to=0, offset_from=0, len;
786 
787  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n",
788  (void*)p_to, (void*)p_from));
789 
790  /* is the target big enough to hold the source? */
791  LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != nullptr) &&
792  (p_from != nullptr) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
793 
794  /* iterate through pbuf chain */
795  do
796  {
797  LWIP_ASSERT("p_to != nullptr", p_to != nullptr);
798  /* copy one part of the original chain */
799  if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
800  /* complete current p_from fits into current p_to */
801  len = p_from->len - offset_from;
802  } else {
803  /* current p_from does not fit into current p_to */
804  len = p_to->len - offset_to;
805  }
806  MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
807  offset_to += len;
808  offset_from += len;
809  LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
810  if (offset_to == p_to->len) {
811  /* on to next p_to (if any) */
812  offset_to = 0;
813  p_to = p_to->next;
814  }
815  LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
816  if (offset_from >= p_from->len) {
817  /* on to next p_from (if any) */
818  offset_from = 0;
819  p_from = p_from->next;
820  }
821 
822  if((p_from != nullptr) && (p_from->len == p_from->tot_len)) {
823  /* don't copy more than one packet! */
824  LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
825  (p_from->next == nullptr), return ERR_VAL;);
826  }
827  if((p_to != nullptr) && (p_to->len == p_to->tot_len)) {
828  /* don't copy more than one packet! */
829  LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
830  (p_to->next == nullptr), return ERR_VAL;);
831  }
832  } while (p_from);
833  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
834  return ERR_OK;
835 }

Referenced by pbuf_coalesce().

◆ pbuf_copy_partial()

u16_t inet::tcp::pbuf_copy_partial ( struct pbuf buf,
void *  dataptr,
u16_t  len,
u16_t  offset 
)

Copy (part of) the contents of a packet buffer to an application supplied buffer.

Parameters
bufthe pbuf from which to copy data
dataptrthe application supplied buffer
lenlength of data to copy (dataptr must be big enough). No more than buf->tot_len will be copied, irrespective of len
offsetoffset into the packet buffer from where to begin copying len bytes
Returns
the number of bytes copied, or 0 on failure
850 {
851  struct pbuf *p;
852  u16_t left;
853  u16_t buf_copy_len;
854  u16_t copied_total = 0;
855 
856  LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != nullptr), return 0;);
857  LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != nullptr), return 0;);
858 
859  left = 0;
860 
861  if((buf == nullptr) || (dataptr == nullptr)) {
862  return 0;
863  }
864 
865  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
866  for(p = buf; len != 0 && p != nullptr; p = p->next) {
867  if ((offset != 0) && (offset >= p->len)) {
868  /* don't copy from this buffer -> on to the next */
869  offset -= p->len;
870  } else {
871  /* copy from this buffer. maybe only partially. */
872  buf_copy_len = p->len - offset;
873  if (buf_copy_len > len)
874  buf_copy_len = len;
875  /* copy the necessary parts of the buffer */
876  MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
877  copied_total += buf_copy_len;
878  left += buf_copy_len;
879  len -= buf_copy_len;
880  offset = 0;
881  }
882  }
883  return copied_total;
884 }

◆ pbuf_dechain()

struct pbuf * inet::tcp::pbuf_dechain ( struct pbuf p)

Dechains the first pbuf from its succeeding pbufs in the chain.

Makes p->tot_len field equal to p->len.

Parameters
ppbuf to dechain
Returns
remainder of the pbuf chain, or nullptr if it was de-allocated.
Note
May not be called on a packet queue.
735 {
736  struct pbuf *q;
737  u8_t tail_gone = 1;
738  /* tail */
739  q = p->next;
740  /* pbuf has successor in chain? */
741  if (q != nullptr) {
742  /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
743  LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len);
744  /* enforce invariant if assertion is disabled */
745  q->tot_len = p->tot_len - p->len;
746  /* decouple pbuf from remainder */
747  p->next = nullptr;
748  /* total length of pbuf p is its own length only */
749  p->tot_len = p->len;
750  /* q is no longer referenced by p, free it */
751  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_dechain: unreferencing %p\n", (void *)q));
752  tail_gone = pbuf_free(q);
753  if (tail_gone > 0) {
755  ("pbuf_dechain: deallocated %p (as it is no longer referenced)\n", (void *)q));
756  }
757  /* return remaining tail or nullptr if deallocated */
758  }
759  /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
760  LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len);
761  return ((tail_gone > 0) ? nullptr : q);
762 }

◆ pbuf_free()

u8_t inet::tcp::pbuf_free ( struct pbuf p)

Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain or queue.

Decrements the pbuf reference count. If it reaches zero, the pbuf is deallocated.

For a pbuf chain, this is repeated for each pbuf in the chain, up to the first pbuf which has a non-zero reference count after decrementing. So, when all reference counts are one, the whole chain is free'd.

Parameters
pThe pbuf (chain) to be dereferenced.
Returns
the number of pbufs that were de-allocated from the head of the chain.
Note
MUST NOT be called on a packet queue (Not verified to work yet).
the reference counter of a pbuf equals the number of pointers that refer to the pbuf (or into the pbuf).
560 {
561  u16_t type;
562  struct pbuf *q;
563  u8_t count;
564 
565  if (p == nullptr) {
566  LWIP_ASSERT("p != nullptr", p != nullptr);
567  /* if assertions are disabled, proceed with debug output */
569  ("pbuf_free(p == nullptr) was called.\n"));
570  return 0;
571  }
572  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free(%p)\n", (void *)p));
573 
574  PERF_START;
575 
576  LWIP_ASSERT("pbuf_free: sane type",
577  p->type == PBUF_RAM || p->type == PBUF_ROM ||
578  p->type == PBUF_REF || p->type == PBUF_POOL);
579 
580  count = 0;
581  /* de-allocate all consecutive pbufs from the head of the chain that
582  * obtain a zero reference count after decrementing*/
583  while (p != nullptr) {
584  u16_t ref;
585  SYS_ARCH_DECL_PROTECT(old_level);
586  /* Since decrementing ref cannot be guaranteed to be a single machine operation
587  * we must protect it. We put the new ref into a local variable to prevent
588  * further protection. */
589  SYS_ARCH_PROTECT(old_level);
590  /* all pbufs in a chain are referenced at least once */
591  LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
592  /* decrease reference count (number of pointers to pbuf) */
593  ref = --(p->ref);
594  SYS_ARCH_UNPROTECT(old_level);
595  /* this pbuf is no longer referenced to? */
596  if (ref == 0) {
597  /* remember next pbuf in chain for next iteration */
598  q = p->next;
599  LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
600  type = p->type;
601  /* is this a pbuf from the pool? */
602  if (type == PBUF_POOL) {
603  memp_free(MEMP_PBUF_POOL, p);
604  /* is this a ROM or RAM referencing pbuf? */
605  } else if (type == PBUF_ROM || type == PBUF_REF) {
606  memp_free(MEMP_PBUF, p);
607  /* type == PBUF_RAM */
608  } else {
609  mem_free(p);
610  }
611  count++;
612  /* proceed to next pbuf */
613  p = q;
614  /* p->ref > 0, this pbuf is still referenced to */
615  /* (and so the remaining pbufs in chain as well) */
616  } else {
617  LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %" U16_F ", ending here.\n", (void *)p, ref));
618  /* stop walking through the chain */
619  p = nullptr;
620  }
621  }
622  PERF_STOP("pbuf_free");
623  /* return number of de-allocated pbufs */
624  return count;
625 }

Referenced by pbuf_alloc(), pbuf_coalesce(), pbuf_dechain(), pbuf_realloc(), and inet::tcp::TcpLwip::tcp_event_recv().

◆ pbuf_free_callback()

err_t inet::tcp::pbuf_free_callback ( struct pbuf p)

◆ pbuf_header()

u8_t inet::tcp::pbuf_header ( struct pbuf p,
s16_t  header_size_increment 
)

Adjusts the payload pointer to hide or reveal headers in the payload.

Adjusts the ->payload pointer so that space for a header (dis)appears in the pbuf payload.

The ->payload, ->tot_len and ->len fields are adjusted.

Parameters
ppbuf to change the header size.
header_size_incrementNumber of bytes to increment header size which increases the size of the pbuf. New space is on the front. (Using a negative value decreases the header size.) If hdr_size_inc is 0, this function does nothing and returns succesful.

PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer.

Returns
non-zero on failure, zero on success.
453 {
454  u16_t type;
455  void *payload;
456  u16_t increment_magnitude;
457 
458  LWIP_ASSERT("p != nullptr", p != nullptr);
459  if ((header_size_increment == 0) || (p == nullptr))
460  return 0;
461 
462  if (header_size_increment < 0){
463  increment_magnitude = -header_size_increment;
464  /* Check that we aren't going to move off the end of the pbuf */
465  LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
466  } else {
467  increment_magnitude = header_size_increment;
468 #if 0
469  /* Can't assert these as some callers speculatively call
470  pbuf_header() to see if it's OK. Will return 1 below instead. */
471  /* Check that we've got the correct type of pbuf to work with */
472  LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL",
473  p->type == PBUF_RAM || p->type == PBUF_POOL);
474  /* Check that we aren't going to move off the beginning of the pbuf */
475  LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF",
476  (u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF);
477 #endif
478  }
479 
480  type = p->type;
481  /* remember current payload pointer */
482  payload = p->payload;
483 
484  /* pbuf types containing payloads? */
485  if (type == PBUF_RAM || type == PBUF_POOL) {
486  /* set new payload pointer */
487  p->payload = (u8_t *)p->payload - header_size_increment;
488  /* boundary check fails? */
489  if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) {
491  ("pbuf_header: failed as %p < %p (not enough space for new header size)\n",
492  (void *)p->payload, (void *)(p + 1)));
493  /* restore old payload pointer */
494  p->payload = payload;
495  /* bail out unsuccesfully */
496  return 1;
497  }
498  /* pbuf types refering to external payloads? */
499  } else if (type == PBUF_REF || type == PBUF_ROM) {
500  /* hide a header in the payload? */
501  if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
502  /* increase payload pointer */
503  p->payload = (u8_t *)p->payload - header_size_increment;
504  } else {
505  /* cannot expand payload to front (yet!)
506  * bail out unsuccesfully */
507  return 1;
508  }
509  }
510  else {
511  /* Unknown type */
512  LWIP_ASSERT("bad pbuf type", 0);
513  return 1;
514  }
515  /* modify pbuf length fields */
516  p->len += header_size_increment;
517  p->tot_len += header_size_increment;
518 
519  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%" S16_F ")\n",
520  (void *)payload, (void *)p->payload, header_size_increment));
521 
522  return 0;
523 }

◆ pbuf_realloc()

void inet::tcp::pbuf_realloc ( struct pbuf p,
u16_t  new_len 
)

Shrink a pbuf chain to a desired length.

Parameters
ppbuf to shrink.
new_lendesired new length of pbuf chain

Depending on the desired length, the first few pbufs in a chain might be skipped and left unchanged. The new last pbuf in the chain will be resized, and any remaining pbufs will be freed.

Note
If the pbuf is ROM/REF, only the ->tot_len and ->len fields are adjusted.
May not be called on a packet queue.
Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain).
372 {
373  struct pbuf *q;
374  u16_t rem_len; /* remaining length */
375  s32_t grow;
376 
377  LWIP_ASSERT("pbuf_realloc: p != nullptr", p != nullptr);
378  LWIP_ASSERT("pbuf_realloc: sane p->type", p->type == PBUF_POOL ||
379  p->type == PBUF_ROM ||
380  p->type == PBUF_RAM ||
381  p->type == PBUF_REF);
382 
383  /* desired length larger than current length? */
384  if (new_len >= p->tot_len) {
385  /* enlarging not yet supported */
386  return;
387  }
388 
389  /* the pbuf chain grows by (new_len - p->tot_len) bytes
390  * (which may be negative in case of shrinking) */
391  grow = new_len - p->tot_len;
392 
393  /* first, step over any pbufs that should remain in the chain */
394  rem_len = new_len;
395  q = p;
396  /* should this pbuf be kept? */
397  while (rem_len > q->len) {
398  /* decrease remaining length by pbuf length */
399  rem_len -= q->len;
400  /* decrease total length indicator */
401  LWIP_ASSERT("grow < max_u16_t", grow < 0xffff);
402  q->tot_len += (u16_t)grow;
403  /* proceed to next pbuf in chain */
404  q = q->next;
405  LWIP_ASSERT("pbuf_realloc: q != nullptr", q != nullptr);
406  }
407  /* we have now reached the new last pbuf (in q) */
408  /* rem_len == desired length for pbuf q */
409 
410  /* shrink allocated memory for PBUF_RAM */
411  /* (other types merely adjust their length fields */
412  if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
413  /* reallocate and adjust the length of the pbuf that will be split */
414  q = (struct pbuf *)mem_realloc(q, (u8_t *)q->payload - (u8_t *)q + rem_len);
415  LWIP_ASSERT("mem_realloc give q == nullptr", q != nullptr);
416  }
417  /* adjust length fields for new last pbuf */
418  q->len = rem_len;
419  q->tot_len = q->len;
420 
421  /* any remaining pbufs in chain? */
422  if (q->next != nullptr) {
423  /* free remaining pbufs in chain */
424  pbuf_free(q->next);
425  }
426  /* q is last packet in chain */
427  q->next = nullptr;
428 
429 }

◆ pbuf_ref()

void inet::tcp::pbuf_ref ( struct pbuf p)

Increment the reference count of the pbuf.

Parameters
ppbuf to increase reference counter of
655 {
656  SYS_ARCH_DECL_PROTECT(old_level);
657  /* pbuf given? */
658  if (p != nullptr) {
659  SYS_ARCH_PROTECT(old_level);
660  ++(p->ref);
661  SYS_ARCH_UNPROTECT(old_level);
662  }
663 }

Referenced by pbuf_chain().

◆ pbuf_ref_chain()

void inet::tcp::pbuf_ref_chain ( struct pbuf p)

◆ pbuf_take()

err_t inet::tcp::pbuf_take ( struct pbuf buf,
const void *  dataptr,
u16_t  len 
)

Copy application supplied data into a pbuf.

This function can only be used to copy the equivalent of buf->tot_len data.

Parameters
bufpbuf to fill with data
dataptrapplication supplied data buffer
lenlength of the application supplied data buffer
Returns
ERR_OK if successful, ERR_MEM if the pbuf is not big enough
898 {
899  struct pbuf *p;
900  u16_t buf_copy_len;
901  u16_t total_copy_len = len;
902  u16_t copied_total = 0;
903 
904  LWIP_ERROR("pbuf_take: invalid buf", (buf != nullptr), return 0;);
905  LWIP_ERROR("pbuf_take: invalid dataptr", (dataptr != nullptr), return 0;);
906 
907  if ((buf == nullptr) || (dataptr == nullptr) || (buf->tot_len < len)) {
908  return ERR_ARG;
909  }
910 
911  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
912  for(p = buf; total_copy_len != 0; p = p->next) {
913  LWIP_ASSERT("pbuf_take: invalid pbuf", p != nullptr);
914  buf_copy_len = total_copy_len;
915  if (buf_copy_len > p->len) {
916  /* this pbuf cannot hold all remaining data */
917  buf_copy_len = p->len;
918  }
919  /* copy the necessary parts of the buffer */
920  MEMCPY(p->payload, &((char*)dataptr)[copied_total], buf_copy_len);
921  total_copy_len -= buf_copy_len;
922  copied_total += buf_copy_len;
923  }
924  LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len);
925  return ERR_OK;
926 }

◆ Register_Class() [1/13]

inet::tcp::Register_Class ( DcTcp  )

◆ Register_Class() [2/13]

inet::tcp::Register_Class ( DumbTcp  )

◆ Register_Class() [3/13]

inet::tcp::Register_Class ( Sack  )

◆ Register_Class() [4/13]

inet::tcp::Register_Class ( TcpLwipReceiveQueue  )

◆ Register_Class() [5/13]

inet::tcp::Register_Class ( TcpLwipSendQueue  )

◆ Register_Class() [6/13]

inet::tcp::Register_Class ( TcpNewReno  )

◆ Register_Class() [7/13]

inet::tcp::Register_Class ( TcpNoCongestionControl  )

◆ Register_Class() [8/13]

inet::tcp::Register_Class ( TcpReceiveQueue  )

◆ Register_Class() [9/13]

inet::tcp::Register_Class ( TcpReno  )

◆ Register_Class() [10/13]

inet::tcp::Register_Class ( TcpSendQueue  )

◆ Register_Class() [11/13]

inet::tcp::Register_Class ( TcpTahoe  )

◆ Register_Class() [12/13]

inet::tcp::Register_Class ( TcpVegas  )

◆ Register_Class() [13/13]

inet::tcp::Register_Class ( TcpWestwood  )

◆ Register_Serializer()

inet::tcp::Register_Serializer ( TcpHeader  ,
TcpHeaderSerializer   
)

◆ roundTime()

simtime_t inet::tcp::roundTime ( const simtime_t &  timeP,
int  secSlicesP 
)
419 {
420  int64_t scale = timeP.getScale() / secSlicesP;
421  simtime_t ret = timeP;
422  ret /= scale;
423  ret *= scale;
424  return ret;
425 }

Referenced by inet::tcp::TcpLwip::handleMessage().

◆ seqGE()

◆ seqGreater()

◆ seqLE()

◆ seqLess()

◆ seqMax()

uint32_t inet::tcp::seqMax ( uint32_t  a,
uint32_t  b 
)
inline
26 { return ((a - b) < (1UL << 31)) ? a : b; }

Referenced by inet::tcp::TcpReceiveQueue::insertBytesFromSegment().

◆ seqMin()

uint32_t inet::tcp::seqMin ( uint32_t  a,
uint32_t  b 
)
inline
25 { return ((b - a) < (1UL << 31)) ? a : b; }

Referenced by inet::tcp::TcpReceiveQueue::getFirstSeqNo(), and inet::tcp::TcpReceiveQueue::insertBytesFromSegment().

◆ slipif_init()

err_t inet::tcp::slipif_init ( struct netif netif)

◆ slipif_poll()

void inet::tcp::slipif_poll ( struct netif netif)

◆ sys_arch_mbox_fetch()

u32_t inet::tcp::sys_arch_mbox_fetch ( sys_mbox_t  mbox,
void **  msg,
u32_t  timeout 
)

◆ sys_arch_mbox_tryfetch()

u32_t inet::tcp::sys_arch_mbox_tryfetch ( sys_mbox_t  mbox,
void **  msg 
)

◆ sys_arch_sem_wait()

u32_t inet::tcp::sys_arch_sem_wait ( sys_sem_t  sem,
u32_t  timeout 
)

◆ sys_arch_timeouts()

struct sys_timeouts* inet::tcp::sys_arch_timeouts ( void  )

◆ sys_init()

void inet::tcp::sys_init ( void  )

◆ sys_jiffies()

u32_t inet::tcp::sys_jiffies ( void  )

◆ sys_mbox_fetch()

void inet::tcp::sys_mbox_fetch ( sys_mbox_t  mbox,
void **  msg 
)

◆ sys_mbox_free()

void inet::tcp::sys_mbox_free ( sys_mbox_t  mbox)

◆ sys_mbox_new()

sys_mbox_t inet::tcp::sys_mbox_new ( int  size)

◆ sys_mbox_post()

void inet::tcp::sys_mbox_post ( sys_mbox_t  mbox,
void *  msg 
)

◆ sys_mbox_trypost()

err_t inet::tcp::sys_mbox_trypost ( sys_mbox_t  mbox,
void *  msg 
)

◆ sys_msleep()

void inet::tcp::sys_msleep ( u32_t  ms)

◆ sys_now()

u32_t inet::tcp::sys_now ( void  )

Returns the current time in milliseconds.

◆ sys_sem_free()

void inet::tcp::sys_sem_free ( sys_sem_t  sem)

◆ sys_sem_new()

sys_sem_t inet::tcp::sys_sem_new ( u8_t  count)

◆ sys_sem_signal()

void inet::tcp::sys_sem_signal ( sys_sem_t  sem)

◆ sys_sem_wait()

void inet::tcp::sys_sem_wait ( sys_sem_t  sem)

◆ sys_sem_wait_timeout()

int inet::tcp::sys_sem_wait_timeout ( sys_sem_t  sem,
u32_t  timeout 
)

◆ sys_thread_new()

sys_thread_t inet::tcp::sys_thread_new ( char *  name,
void(*)(void *arg)  thread,
void *  arg,
int  stacksize,
int  prio 
)

◆ sys_timeout()

void inet::tcp::sys_timeout ( u32_t  msecs,
sys_timeout_handler  h,
void *  arg 
)

◆ sys_untimeout()

void inet::tcp::sys_untimeout ( sys_timeout_handler  h,
void *  arg 
)

◆ tcpip_callback_with_block()

err_t inet::tcp::tcpip_callback_with_block ( void(*)(void *ctx)  f,
void *  ctx,
u8_t  block 
)

◆ tcpip_init()

void inet::tcp::tcpip_init ( void(*)(void *)  tcpip_init_done,
void *  arg 
)

◆ tcpip_input()

err_t inet::tcp::tcpip_input ( struct pbuf p,
struct netif inp 
)

◆ tcpip_timeout()

err_t inet::tcp::tcpip_timeout ( u32_t  msecs,
sys_timeout_handler  h,
void *  arg 
)

◆ tcpip_untimeout()

err_t inet::tcp::tcpip_untimeout ( sys_timeout_handler  h,
void *  arg 
)

Variable Documentation

◆ current_header

const struct ip_hdr* inet::tcp::current_header

Header of the input packet currently being processed.

◆ current_netif

struct netif* inet::tcp::current_netif

The interface that provided the packet for the current callback invocation.

◆ ip_addr_any

const struct ip_addr inet::tcp::ip_addr_any

◆ ip_addr_broadcast

const struct ip_addr inet::tcp::ip_addr_broadcast

◆ netif_default

struct netif* inet::tcp::netif_default

The default network interface.

◆ netif_list

struct netif* inet::tcp::netif_list

The list of network interfaces.

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct inet::tcp::icmp_echo_hdr inet::tcp::PACK_STRUCT_STRUCT

◆ TCP_MAX_HEADER_LENGTH

const B inet::tcp::TCP_MAX_HEADER_LENGTH = B(60)

◆ TCP_MIN_HEADER_LENGTH

◆ TCP_OPTION_HEAD_SIZE

const B inet::tcp::TCP_OPTION_HEAD_SIZE = B(2)

◆ TCP_OPTION_SACK_ENTRY_SIZE

const B inet::tcp::TCP_OPTION_SACK_ENTRY_SIZE = B(8)

◆ TCP_OPTION_SACK_MIN_SIZE

const B inet::tcp::TCP_OPTION_SACK_MIN_SIZE = B(10)

◆ TCP_OPTION_TS_SIZE

const B inet::tcp::TCP_OPTION_TS_SIZE = B(12)

◆ TCP_OPTIONS_MAX_SIZE

const B inet::tcp::TCP_OPTIONS_MAX_SIZE = B(40)
inet::tcp::pbuf_layer
pbuf_layer
Definition: pbuf.h:50
inet::tcp::TCP_E_SETOPTION
@ TCP_E_SETOPTION
Definition: TcpConnection.h:80
inet::tcp::TCP_E_TIMEOUT_CONN_ESTAB
@ TCP_E_TIMEOUT_CONN_ESTAB
Definition: TcpConnection.h:95
inet::tcp::TCPIP_MSG_TIMEOUT
@ TCPIP_MSG_TIMEOUT
Definition: tcpip.h:109
SIZEOF_STRUCT_PBUF
#define SIZEOF_STRUCT_PBUF
Definition: pbuf.cc:93
PERF_STOP
#define PERF_STOP(x)
Definition: perf.h:4
ERR_VAL
#define ERR_VAL
Definition: err.h:69
inet::tcp::snmp_ifType_basicISDN
@ snmp_ifType_basicISDN
Definition: snmp.h:71
inet::tcp::TCPIP_MSG_INPKT
@ TCPIP_MSG_INPKT
Definition: tcpip.h:104
inet::tcp::TCP_E_RCV_SYN_ACK
@ TCP_E_RCV_SYN_ACK
Definition: TcpConnection.h:86
LWIP_ASSERT
#define LWIP_ASSERT(message, assertion)
Definition: debug.h:69
mem_realloc
void * mem_realloc(void *mem, mem_size_t size)
inet::tcp::TCP_E_RCV_FIN_ACK
@ TCP_E_RCV_FIN_ACK
Definition: TcpConnection.h:88
inet::tcp::snmp_ifType_regular1822
@ snmp_ifType_regular1822
Definition: snmp.h:53
SYS_ARCH_UNPROTECT
#define SYS_ARCH_UNPROTECT(lev)
Definition: sys.h:212
inet::tcp::PBUF_RAM
@ PBUF_RAM
Definition: pbuf.h:58
inet::tcp::snmp_ifType_ethernet_csmacd
@ snmp_ifType_ethernet_csmacd
Definition: snmp.h:57
PERF_START
#define PERF_START
Definition: perf.h:3
inet::tcp::ICMP_DUR_PROTO
@ ICMP_DUR_PROTO
Definition: lwip_icmp.h:63
inet::tcp::memp_free
void memp_free(memp_t type, void *mem)
Put an element back into its pool.
Definition: memp.cc:356
inet::count
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
inet::tcp::mem_ptr_t
intptr_t mem_ptr_t
Definition: cc.h:27
inet::tcp::err_t
s8_t err_t
Define LWIP_ERR_T in cc.h if you want to use a different type for your platform (must be signed).
Definition: err.h:51
inet::tcp::snmp_ifType_frame_relay
@ snmp_ifType_frame_relay
Definition: snmp.h:83
inet::units::constants::e
const value< double, units::C > e(1.602176487e-19)
inet::tcp::TCP_E_IGNORE
@ TCP_E_IGNORE
Definition: TcpConnection.h:66
MEMP_STATS_INC_USED
#define MEMP_STATS_INC_USED(x, i)
Definition: stats.h:252
inet::tcp::snmp_ifType_sdlc
@ snmp_ifType_sdlc
Definition: snmp.h:68
inet::tcp::snmp_ifType_nsip
@ snmp_ifType_nsip
Definition: snmp.h:78
inet::tcp::s32_t
int32_t s32_t
Definition: cc.h:52
inet::tcp::snmp_ifType_rfc877_x25
@ snmp_ifType_rfc877_x25
Definition: snmp.h:56
inet::tcp::TCPOPTION_SACK_PERMITTED
@ TCPOPTION_SACK_PERMITTED
Definition: TcpHeader_m.h:119
PBUF_TRANSPORT_HLEN
#define PBUF_TRANSPORT_HLEN
Definition: pbuf.h:47
inet::tcp::PBUF_POOL
@ PBUF_POOL
Definition: pbuf.h:61
inet::tcp::pbuf_copy
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
Create PBUF_RAM copies of pbufs.
Definition: pbuf.cc:783
inet::tcp::TCP_E_RCV_ACK
@ TCP_E_RCV_ACK
Definition: TcpConnection.h:84
inet::tcp::snmp_ifType_proteon_10Mbit
@ snmp_ifType_proteon_10Mbit
Definition: snmp.h:63
inet::tcp::TCP_S_INIT
@ TCP_S_INIT
Definition: TcpConnection.h:47
PBUF_LINK_HLEN
#define PBUF_LINK_HLEN
PBUF_LINK_HLEN: the number of bytes that should be allocated for a link level header.
Definition: opt.h:897
mem_free
void mem_free(void *mem)
inet::tcp::PBUF_ROM
@ PBUF_ROM
Definition: pbuf.h:59
inet::tcp::TCP_E_TIMEOUT_2MSL
@ TCP_E_TIMEOUT_2MSL
Definition: TcpConnection.h:94
inet::tcp::TCP_S_FIN_WAIT_1
@ TCP_S_FIN_WAIT_1
Definition: TcpConnection.h:55
LWIP_MIN
#define LWIP_MIN(x, y)
Definition: def.h:43
inet::tcp::TCP_E_DESTROY
@ TCP_E_DESTROY
Definition: TcpConnection.h:76
PBUF_DEBUG
#define PBUF_DEBUG
PBUF_DEBUG: Enable debugging in pbuf.c.
Definition: opt.h:1630
MEMP_STATS_AVAIL
#define MEMP_STATS_AVAIL(x, i, y)
Definition: stats.h:249
inet::tcp::snmp_ifType_e1
@ snmp_ifType_e1
Definition: snmp.h:70
inet::tcp::snmp_ifType_ds3
@ snmp_ifType_ds3
Definition: snmp.h:81
inet::tcp::ICMP_TE_FRAG
@ ICMP_TE_FRAG
Definition: lwip_icmp.h:71
inet::tcp::snmp_ifType_eon
@ snmp_ifType_eon
Definition: snmp.h:76
inet::tcp::TCP_MAX_SACK_ENTRIES
@ TCP_MAX_SACK_ENTRIES
Definition: TcpHeader_m.h:84
inet::tcp::TCP_E_RCV_UNEXP_SYN
@ TCP_E_RCV_UNEXP_SYN
Definition: TcpConnection.h:91
inet::tcp::memp::next
struct memp * next
Definition: memp.cc:66
inet::tcp::pbuf_ref
void pbuf_ref(struct pbuf *p)
Increment the reference count of the pbuf.
Definition: pbuf.cc:654
inet::tcp::PBUF_REF
@ PBUF_REF
Definition: pbuf.h:60
inet::tcp::snmp_ifType_ethernet_3Mbit
@ snmp_ifType_ethernet_3Mbit
Definition: snmp.h:77
inet::tcp::snmp_ifType_iso88024_tokenBus
@ snmp_ifType_iso88024_tokenBus
Definition: snmp.h:59
LWIP_ERROR
#define LWIP_ERROR(message, expression, handler)
if "expression" isn't true, then print "message" and execute "handler" expression
Definition: debug.h:77
inet::tcp::memp_t
memp_t
Definition: memp.h:56
inet::tcp::snmp_ifType_iso88026_man
@ snmp_ifType_iso88026_man
Definition: snmp.h:61
inet::tcp::snmp_ifType_primaryISDN
@ snmp_ifType_primaryISDN
Definition: snmp.h:72
inet::tcp::TCP_E_OPEN_ACTIVE
@ TCP_E_OPEN_ACTIVE
Definition: TcpConnection.h:70
MEMP_DEBUG
#define MEMP_DEBUG
MEMP_DEBUG: Enable debugging in memp.c.
Definition: opt.h:1707
inet::tcp::PBUF_RAW
@ PBUF_RAW
Definition: pbuf.h:54
inet::tcp::PBUF_IP
@ PBUF_IP
Definition: pbuf.h:52
inet::tcp::TCPOPTION_WINDOW_SCALE
@ TCPOPTION_WINDOW_SCALE
Definition: TcpHeader_m.h:118
inet::tcp::TCP_S_LISTEN
@ TCP_S_LISTEN
Definition: TcpConnection.h:49
inet::tcp::TCP_E_RCV_SYN
@ TCP_E_RCV_SYN
Definition: TcpConnection.h:85
inet::tcp::ICMP_DUR_SR
@ ICMP_DUR_SR
Definition: lwip_icmp.h:66
PBUF_IP_HLEN
#define PBUF_IP_HLEN
Definition: pbuf.h:48
if
if(cwndVector) cwndVector -> record(state->snd_cwnd)
inet::tcp::snmp_ifType_hyperchannel
@ snmp_ifType_hyperchannel
Definition: snmp.h:65
inet::tcp::TCP_S_CLOSED
@ TCP_S_CLOSED
Definition: TcpConnection.h:48
inet::tcp::TCP_S_ESTABLISHED
@ TCP_S_ESTABLISHED
Definition: TcpConnection.h:52
inet::tcp::TCP_S_SYN_RCVD
@ TCP_S_SYN_RCVD
Definition: TcpConnection.h:51
inet::tcp::snmp_ifType_slip
@ snmp_ifType_slip
Definition: snmp.h:79
ERR_ARG
#define ERR_ARG
Definition: err.h:71
inet::tcp::TCP_E_SEND
@ TCP_E_SEND
Definition: TcpConnection.h:73
type
removed type
Definition: IUdp-gates.txt:7
inet::tcp::TcpOptionNumbers
TcpOptionNumbers
Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:40 by opp_msgtool.
Definition: TcpHeader_m.h:114
inet::tcp::TCP_E_STATUS
@ TCP_E_STATUS
Definition: TcpConnection.h:77
inet::tcp::TCP_S_CLOSE_WAIT
@ TCP_S_CLOSE_WAIT
Definition: TcpConnection.h:53
inet::tcp::memp_malloc
void * memp_malloc(memp_t type)
Get an element from a specific pool.
Definition: memp.cc:311
inet::tcp::TCP_S_TIME_WAIT
@ TCP_S_TIME_WAIT
Definition: TcpConnection.h:58
SYS_ARCH_DECL_PROTECT
#define SYS_ARCH_DECL_PROTECT(lev)
SYS_LIGHTWEIGHT_PROT define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection for ...
Definition: sys.h:210
SYS_ARCH_PROTECT
#define SYS_ARCH_PROTECT(lev)
Definition: sys.h:211
inet::tcp::snmp_ifType_sip
@ snmp_ifType_sip
Definition: snmp.h:82
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::tcp::ICMP_DUR_HOST
@ ICMP_DUR_HOST
Definition: lwip_icmp.h:62
LWIP_MEM_ALIGN_SIZE
#define LWIP_MEM_ALIGN_SIZE(size)
Definition: mem.h:100
inet::tcp::TcpConstants
TcpConstants
Enum generated from inet/transportlayer/tcp_common/TcpHeader.msg:27 by opp_msgtool.
Definition: TcpHeader_m.h:83
inet::tcp::snmp_ifType_softwareLoopback
@ snmp_ifType_softwareLoopback
Definition: snmp.h:75
inet::tcp::snmp_ifType_proteon_80Mbit
@ snmp_ifType_proteon_80Mbit
Definition: snmp.h:64
inet::tcp::snmp_ifType_iso88023_csmacd
@ snmp_ifType_iso88023_csmacd
Definition: snmp.h:58
inet::sctp::max
double max(const double a, const double b)
Returns the maximum of a and b.
Definition: SctpAssociation.h:266
inet::tcp::TCPOPTION_MAXIMUM_SEGMENT_SIZE
@ TCPOPTION_MAXIMUM_SEGMENT_SIZE
Definition: TcpHeader_m.h:117
inet::tcp::snmp_ifType_ddn_x25
@ snmp_ifType_ddn_x25
Definition: snmp.h:55
memp_std.h
LWIP_DBG_LEVEL_SERIOUS
#define LWIP_DBG_LEVEL_SERIOUS
Definition: debug.h:50
inet::tcp::snmp_ifType_hdh1822
@ snmp_ifType_hdh1822
Definition: snmp.h:54
MEM_ALIGNMENT
#define MEM_ALIGNMENT
MEM_ALIGNMENT: should be set to the alignment of the CPU 4 byte alignment -> #define MEM_ALIGNMENT 4 ...
Definition: opt.h:120
inet::tcp::snmp_ifType_fddi
@ snmp_ifType_fddi
Definition: snmp.h:66
inet::tcp::TCPOPTION_TIMESTAMP
@ TCPOPTION_TIMESTAMP
Definition: TcpHeader_m.h:121
inet::tcp::TCPIP_MSG_UNTIMEOUT
@ TCPIP_MSG_UNTIMEOUT
Definition: tcpip.h:110
inet::tcp::snmp_ifType_iso88025_tokenRing
@ snmp_ifType_iso88025_tokenRing
Definition: snmp.h:60
inet::tcp::snmp_ifType_ppp
@ snmp_ifType_ppp
Definition: snmp.h:74
inet::tcp::pbuf_cat
void pbuf_cat(struct pbuf *h, struct pbuf *t)
Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbu...
Definition: pbuf.cc:676
inet::tcp::ICMP_TE_TTL
@ ICMP_TE_TTL
Definition: lwip_icmp.h:70
mem_malloc
void * mem_malloc(mem_size_t size)
inet::tcp::snmp_ifType_starLan
@ snmp_ifType_starLan
Definition: snmp.h:62
MEMP_STATS_DEC
#define MEMP_STATS_DEC(x, i)
Definition: stats.h:251
LWIP_MEM_ALIGN
#define LWIP_MEM_ALIGN(addr)
Definition: mem.h:104
MEMCPY
#define MEMCPY(dst, src, len)
MEMCPY: override this if you have a faster implementation at hand than the one included in your C lib...
Definition: opt.h:80
PBUF_POOL_BUFSIZE_ALIGNED
#define PBUF_POOL_BUFSIZE_ALIGNED
Definition: pbuf.cc:96
inet::tcp::ICMP_DUR_FRAG
@ ICMP_DUR_FRAG
Definition: lwip_icmp.h:65
inet::tcp::TCP_E_ABORT
@ TCP_E_ABORT
Definition: TcpConnection.h:75
layer
IP layer
Definition: lwip_tcp.txt:3
inet::tcp::u16_t
uint16_t u16_t
Definition: cc.h:34
inet::tcp::TCP_E_ACCEPT
@ TCP_E_ACCEPT
Definition: TcpConnection.h:72
MEMP_SIZE
#define MEMP_SIZE
Definition: memp.cc:109
inet::tcp::u8_t
uint8_t u8_t
Definition: cc.h:30
inet::tcp::TCPOPTION_END_OF_OPTION_LIST
@ TCPOPTION_END_OF_OPTION_LIST
Definition: TcpHeader_m.h:115
inet::tcp::snmp_ifType_propPointToPointSerial
@ snmp_ifType_propPointToPointSerial
Definition: snmp.h:73
inet::tcp::ICMP_DUR_PORT
@ ICMP_DUR_PORT
Definition: lwip_icmp.h:64
inet::tcp::TCP_E_CLOSE
@ TCP_E_CLOSE
Definition: TcpConnection.h:74
inet::tcp::TCP_E_RCV_FIN
@ TCP_E_RCV_FIN
Definition: TcpConnection.h:87
inet::tcp::TCPIP_MSG_CALLBACK
@ TCPIP_MSG_CALLBACK
Definition: tcpip.h:108
inet::tcp::TCP_E_READ
@ TCP_E_READ
Definition: TcpConnection.h:79
inet::tcp::TCPOPTION_SACK
@ TCPOPTION_SACK
Definition: TcpHeader_m.h:120
inet::tcp::snmp_ifType_ds1
@ snmp_ifType_ds1
Definition: snmp.h:69
inet::tcp::TCP_S_LAST_ACK
@ TCP_S_LAST_ACK
Definition: TcpConnection.h:54
inet::tcp::TCP_E_RCV_DATA
@ TCP_E_RCV_DATA
Definition: TcpConnection.h:83
inet::tcp::TCP_E_TIMEOUT_FIN_WAIT_2
@ TCP_E_TIMEOUT_FIN_WAIT_2
Definition: TcpConnection.h:96
inet::tcp::pbuf_type
pbuf_type
Definition: pbuf.h:57
inet::tcp::TCP_S_CLOSING
@ TCP_S_CLOSING
Definition: TcpConnection.h:57
inet::tcp::TCP_E_QUEUE_BYTES_LIMIT
@ TCP_E_QUEUE_BYTES_LIMIT
Definition: TcpConnection.h:78
S16_F
#define S16_F
Definition: cc.h:57
inet::tcp::TCP_S_SYN_SENT
@ TCP_S_SYN_SENT
Definition: TcpConnection.h:50
inet::tcp::snmp_ifType_lapb
@ snmp_ifType_lapb
Definition: snmp.h:67
LWIP_DEBUGF
#define LWIP_DEBUGF(debug, message)
Definition: debug.h:112
inet::tcp::PBUF_TRANSPORT
@ PBUF_TRANSPORT
Definition: pbuf.h:51
inet::tcp::snmp_ifType_other
@ snmp_ifType_other
Definition: snmp.h:52
U16_F
#define U16_F
Definition: cc.h:55
inet::tcp::MEMP_MAX
@ MEMP_MAX
Definition: memp.h:59
inet::tcp::pbuf_free
u8_t pbuf_free(struct pbuf *p)
Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain o...
Definition: pbuf.cc:559
LWIP_DBG_TRACE
#define LWIP_DBG_TRACE
flag for LWIP_DEBUGF indicating a tracing message (to follow program flow)
Definition: debug.h:60
inet::tcp::ICMP_DUR_NET
@ ICMP_DUR_NET
Definition: lwip_icmp.h:61
inet::tcp::snmp_ifType_ultra
@ snmp_ifType_ultra
Definition: snmp.h:80
inet::tcp::TCPOPTION_NO_OPERATION
@ TCPOPTION_NO_OPERATION
Definition: TcpHeader_m.h:116
inet::units::constants::h
const value< double, compose< units::J, units::s > > h(6.62606896e-34)
inet::tcp::pbuf_alloc
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).
Definition: pbuf.cc:210
ERR_OK
#define ERR_OK
Definition: err.h:56
inet::tcp::PBUF_LINK
@ PBUF_LINK
Definition: pbuf.h:53
inet::tcp::TCP_E_RCV_RST
@ TCP_E_RCV_RST
Definition: TcpConnection.h:89
inet::tcp::TCP_S_FIN_WAIT_2
@ TCP_S_FIN_WAIT_2
Definition: TcpConnection.h:56
inet::tcp::TCP_E_OPEN_PASSIVE
@ TCP_E_OPEN_PASSIVE
Definition: TcpConnection.h:71
MEMP_STATS_INC
#define MEMP_STATS_INC(x, i)
Definition: stats.h:250
PBUF_POOL_IS_EMPTY
#define PBUF_POOL_IS_EMPTY()
Definition: pbuf.cc:99