Menu

famcat: a command line tool for publishing and subscribing

Introduction

famcat is command line tool for the famouso middleware that is inspired by netcat. It allows publishing an event as well as subscribing to receive a certain number of events. The data to be published is read from stdin. Received events are written to stdout.

famcat is very useful for debugging and testing, sniffing the famouso traffic on a given subject, creating high ECH and network load, transmitting files and more. Initially, it was written to test AFP. Thus, it also supports using AFP in the Application Layer, which enables you to transmit events larger than 64KB or to use forward error correction.

Building famcat

The source code can be found at tst/approved/AFP/famcat.cc. To build famcat, switch into the right directory and run make:

~/famouso$ cd tst/approved/AFP/
~/famouso/tst/approved/AFP$ make famcat 

Running famcat

As usual for famouso apps, famcat requires a running ECH. You can find ECHs using different Network Layers in the ECHs directory.

To get help how to invoke famcat you can run it with the command line option --help or -h.

~/famouso/tst/approved/AFP$ ./famcat -h
Usage:
        famcat -s [-c CANNEL] [-n NUM] [-a [-m MTU] [-e]]
        famcat -p [-c CANNEL] [-a [-m MTU] [-e] [-r RED]]

        -s         subscribe, wait for an event and output data to stdout (default)
        -p         publish event from stdin
        -c CHANNEL specify subject to use, default: "_famcat_"
        -n NUM     subsribe for NUM events, default: 1
        -a         use AFP for application layer fragmentation
        -m MTU     specify specific MTU to use, default: 65535
        -e         echo a hexdump of fragments to stderr
        -r RED     add RED % forward error correction redundancy 

Examples how to invoke famcat

  • Subscribe for one event on channel "_famcat_"
     $ ./famcat 
    
  • Subscribe for three events on channel "distance"
     $ ./famcat -n 3 -c distance 
    
  • Publish content of file "input"
     $ ./famcat -p < input 
    
  • Subscribe for one event and write it into file "out"
     $ ./famcat > out 
    
  • Get a hexdump of the next event published on channel "12345678"
     $ ./famcat -c 12345678 | hexdump 
    
  • Publish content of file "input" while using AFP on application layer with a MTU of 1234 Bytes and 20 percent forward error correction redundancy.
     $ ./famcat -p -a -m 1234 -r 20 < input 
    
  • Subscribe invocation belongging to the previous publish. For one channel all publishers and subscribers must be in agreement on the usage of the "-a" option and the value given with the "-m" option (MTU).
     $ ./famcat -a -m 1234 > output