This program sends files to a networked TCP/IP port.

    sffport -s server3 -p 1972 filename
    cat filo | sffport -s localhost -p 3333

Example with an endstring (-B), a long wait (-e 50) and a display of return
    sffport -s -p 40004 -d -B /Nserver -e 50
samples/getSupportedEncodings_Command.xml | cat -vet

Example for testing Multicast with a 10 sec gap between packets of 500 bytes
each, display a dot for each pkt !
    sffport -s -p 6000 -m -d -Y -b 500 -w 10000 tester.180.fip

Any data is passed through without modification unless the the -X flag is set
to add a NUL between CR and NL as telnet zap these.

Note there is an extra FipSeq, \%c for the complete size of file (including

Input Parameters are :
    -s : spider or tty output device unless 'network' or script' parameters are
stated. default: no default
    -p : port number on remote server           default: no default
    -4 : use socks4 to skip thru a proxy            default: no proxy
    -5 : use socks5 to skip thru a proxy            default: no proxy
    -A : send the user name on connect to the remote    default: do not
    -b : block size                     default: 1024
        Use this to test programs which do not handle small TCP packet sizes well.
        If you specify more than about 1450, TCP will fragment them automatically.
The Minimum is 10 bytes.
    -B : At the end, wait for this string and then stop.    default: no
    -c : Timeout for the connection for ordinary TCP connections (not multicast or
        default: 60 secs
    -d : display any text from the server       default: no
        Note that if you are looking at this on an ordinary window or terminal and
control chrs are being received, you could screw up your screen.
        Pipe via cat -ve to strip nasties.
        cat file_to_send | sffport -s serv1 -p 1818 -d | cat -ve
    -D : FipSeq to send BEFORE each pkt     default: none
    -e : At the end, wait for data from the server. Stop after X secs of no
traffic.    default: 5
    -E : At the end, wait for some data THEN wait '-e' seconds before finishing.    
default: no
    -f : extra FipHdr info for filing in the standing files (-g/-G/-k/-K)   default:
    -F : FipAgent for use with ipsvrd       default: no
    -g : FipSeq string to send BEFORE the data  default: none
    -G : FipSeq string to send AFTER the data   default: none
    -h : strip the FipHdr               default: no
    -H : local IP address for 2nd card for mbone    default: no
    -I : run Interactively ie run from a shell  default send file
    -k : filename of any standing file of FipSeq to send BEFORE the data (and
after any -g BEFORE) default: none
    -K : filename of any standing file of FipSeq to send AFTER the data ( and
before any -G AFTER) default: none
    -l : log                    default: no
    -L : use SSL layer              default: no
    -m : port is multicast              default: tcp
    -n : once - nstein, twice - squawk box      default: none
    -M : mTTL                   default: 2
    -o : name of an output file for any text from   default: no
        Normally any text is ignored (or displayed with -d)
    -O : also add any data sent to the output file  default: no
        (requires -o (filename) too of course)
    -P : alternate remote port if first refuses default: no alternative
    -r : no of connection retries           default: 5 attempts
    -R : range of port numbers to use. see below    default: just the one
    -S : alternate remote host if first refuses default: no alternative
    -T : force the wait at end to be exactly the -e     default: no
        ie -T -e 300 will wait for 300 seconds only
    -u : use UDP as the protocol            default: tcp
    -v : print version no and exit
    -w : wait in millisecs between sent packets.    default: 0
        Use this to pace a link.
    -W : interval in secs between error messages    default: every second
    -x : split string in FipSeq         default: do not split
        The data will be sent in discrete packets starting with this string
    -X : add a NUL betweeen CR NL ..        default: no
        so non-transparent telnet does not zap the NL
    -y : display data as sent           default: no
    -Y : display a dot for each packet as sent  default: no
    -z : Parameter file             default: none
        optional, resides in tables/setup
    -Z : send no data               default: contents of the file

For those switches with parameters, the parameter MUST be separated by a space.

-R allows a range of numbers to use. So if we had
    sffport -s humdrum -p 9090 -R 10
then the program will look to the first free port from 9090 to 9099

-- Imitating an HTTPS link - use -L (in this example we also use -I for
    sffportssl -s www.zinglezongle.com -p 443 -L -I
    Then type
        GET / HTTP/1.0
        Host: www.zinglezongle.com
        (2 end of lines)
    ... wait for the reply...

Other env varis can be used to define where the system is :
    SFF_HOME    where the home or top queue is.     default: /fip
            eg  setenv  SFF_HOME    /ripexpress/underware
    SFF_LOG     where the log files queue is        default: (SFF_HOME)/log
    SFF_SPOOL   where the data queues are       default: (SFF_HOME)/spool
    SFF_TMP     where the tmp data queues is        default: (SFF_HOME)/x
            ie if spools are on /data99 which is hard disk /dev/sd0, you MUST also
            have the TMP queue on the same disk/partition

NOTE that for all BUT SFF_HOME, if the parameter starts with a '/' then it is a
hard, absolute path; if not then the spool area is under SFF_HOME.
    eg  setenv  SFF_SPOOL   /data7      will look under /data7 for queues
    while   setenv  SFF_SPOOL   data7       will look under /fip/data7

The Parameter file is use only for FipAgent traffic and is found in
/fip/tables/svrd (not sfftables) :
    ; comment line
    wrapper: xml wrapper string
        eg : wrapper:DEVICE_MESSAGE
        default is FIPAGENT
    data-length: tag containing the length of data following the wrapper
        default is DATALENGTH
    action: Action of the message
        default is REPLY
    message: FipAgent Error Message
        default is MSG
    result: FipAgent result code
        default is RESULT
    device-result: result code from the host process
        default is DEVICE-RESULT
or for SSL stuff
    ssl-method: (1,2,3,23,999)
        Version number to use for TLS/SSL       default: 999 for current default (2 or 3)
    ssl-password: (password)
    ssl-passwd: (password)                default: none
        Optional password if the handshake requires a shared secret
    ssl-cert: (name of a PEM certificate file)      default: none
    ssl-root-cert: (name of a root PEM certificate file)    defaunt: none
        Optional certificates - held in tables/ssl

For Socks 4/5
    socks-host: (hostname of the socks proxy)   no default
    socks-port: (port number of the socks proxy)    default: 1080
    socks-user: (user name for the socks proxy) no default
        if nothing specified, assumed that there is none
    socks-pwd: (password for the socks proxy)   no default

Version Control
;4v16   05feb02 added mbone
    ;a-c 27jan03 added -I for Interactive stuff
    ;d-g 13feb03 added -A
    ;h 22sep03 added -T
    ;i 05mar04 fipagent restricted to 64k - not now
    ;j 05aug04 added mboneLocalAddress -H
    ;k 05feb05 added WINNT drive letter support for input data file
    ;m 15feb05 added -k/-K for included files
    ;n-p 26mar05 added \%c total filesize including fipHdr
    ;q 30jun05 added -f for extra FipHdr
    ;r-s 25nov05 ssl as -L
    ;t-v 14sep07 added -l, -g/-G (and -n) plus -B endstring is now
        ;2 ssl modette ;3 added -x splitter ;4 added -D before-pkt ;5 ssl rework ;6
-O added
        ;7 5sep14 reworked progression thru stages (whicho)
        ;8-11 29sep17 added -Q errorque and -N suffix and -Zsend no data
        ;12-15 31oct17 added socks4 and 5 ; 16 optarg

(copyright) 2024 and previous years FingerPost Ltd.