TCP/IP Packet Templates

This section describes the pre-built packet templates for TCP/IP which can be directly used inside the binary transmit pane.

import "TcpIp.jnc"

// structs

struct ArpFrame;
struct EthernetFrame;
struct IcmpFrame;
struct IpFrame;
struct TcpFrame;
struct UdpFrame;

// global functions

void initializeEthernetIpHdr(
    io.EthernetHdr* ethernetHdr,
    io.IpHdr* ipHdr,
    io.IpProtocol protocol

uint_t calcChecksum16(
    void const* p0,
    size_t size

bigendian unsigned short adjustIpChecksum(uint_t checksum);
bigendian unsigned short calcIpHdrChecksum(io.IpHdr const* ipHdr);

bigendian unsigned short calcTcpUdpChecksum(
    io.IpHdr const* ipHdr,
    void const* p,
    size_t size