psh_tcp(3)

SYNOPSIS:

popen tcp id src-addr src-port dst-addr dst-port[ipversion]

pclose tcp id

pinit tcp pkt [maxlength [length]]

pfree pkt

pget tcp pkt field-name

pset tcp pkt field-name value

pset tcp pkt cksum

plist pkt tcp

id.send pkt

id.recv pkt [timeout]

DESCRIPTION

popen tcp id src-addr src-port dst-addr dst-port[ipversion]
    Prepare to communicate through id to the indicated IP addresses src-addr dst-addr and TCP ports src-port dst-port. ipversion (if present) defines the IP version of created endpoint. The valid values of the parameter are the following: ipv4, ipv6.

pclose tcp id
    End a communication session specified by id.

pget tcp pkt field-name
    Get the indicated field from the TCP header. Most quantities are returned as integers, except flags. The flags are returned symbollicly such as: SYN|ACK.

    The valid fields are the following: dport, sport, seq, ack, flags, win, sum, urp, off.

    Refer to RFC793 for an explanation of the fields.

pset tcp pkt field-name value
    Set the indicated field field-name from the indicated packet pkt to the value value. Similar to the above.

pget tcp pkt cksum
    Set the TCP checksum value. Note that the value computed includes the psuedo-header, if the packet includes an IP or IPv6 header encapsulation.

plist pkt tcp
    Print a summary of the TCP header.

id.send pkt
    Send the indicated TCP packet pkt. Assumes the packet variable pkt begins with a TCP header.

id.recv pkt
    Receive the next TCP packet on the end-point id. If the timeout parameter is present, it will wait only timeout milliseconds for a packet to be received. This command returns either the string "packet" if a packet was received, or "timeout" if a timeout occurred before a packet was received.

FILES

/opt/psh/lib/tcp
    Dynamically linked library protocol for TCP.

SEE ALSO
xpsh(1), psh(1), protolib(3).