Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > ff20406d142eae55c792d2ecde94c604 > files > 35

libft-devel-0.68-7mdv2010.0.i586.rpm

<HTML
><HEAD
><TITLE
>flow-xlate</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.73
"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
><SPAN
CLASS="APPLICATION"
>flow-xlate</SPAN
></A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6"
></A
><H2
>Name</H2
><SPAN
CLASS="APPLICATION"
>flow-xlate</SPAN
>&nbsp;--&nbsp;Apply translations to selected fields of a flow.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN10"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>flow-xlate</B
>  [-hkn] [-b<TT
CLASS="REPLACEABLE"
><I
> big</I
></TT
>|<TT
CLASS="REPLACEABLE"
><I
>little</I
></TT
>] [-C<TT
CLASS="REPLACEABLE"
><I
> comment</I
></TT
>] [-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
>] [-v<TT
CLASS="REPLACEABLE"
><I
> variable binding</I
></TT
>] [-V<TT
CLASS="REPLACEABLE"
><I
> flow_version</I
></TT
>] [-x<TT
CLASS="REPLACEABLE"
><I
> xlate_fname</I
></TT
>] [-X<TT
CLASS="REPLACEABLE"
><I
> xlate_definition</I
></TT
>] [-z<TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
>]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN31"
></A
><H2
>DESCRIPTION</H2
><P
>The <B
CLASS="COMMAND"
>flow-xlate</B
> utility is used to apply translations
to flows.  Translations are defined in a configuration file and are
composed of actions and a definition to invoke action(s).  The definitions
are in the form of terms, each term can have a filter and multiple actions.</P
><P
>Words in the configuration file of the form @VAR or @{VAR:default} will be
expanded at run-time by setting variable names with the -v option.</P
><P
>Translation actions begin with the xlate-action keyword followed by
a symbolic name.  Each action has a type defined below.</P
><P
>Translation definitions begin with the xlate-definition keyword followed
by a symbolic name.  Each definition is composed of terms which are
evaluated in the order of the configuration file.  A term may invoke
a filter to conditionally invoke an action.</P
><PRE
CLASS="SCREEN"
>Action type/sub-commands                Description/Example
------------------------------------------------------------------------
ip-source-address-to-network            Zero host bits based on mask.
ip-destination-address-to-network       Zero host bits based on mask.

  (no sub-commands)

ip-source-address-to-class-network      Zero source host bits to
                                        match class.
ip-destination-address-to-class-network Zero dst host bits to
                                        match class.
                                      
  (no sub-commands)

ip-source-address-anonymize             Anonymize source address.
ip-destination-address-anonymize        Anonymize destination address.
ip-address-anonymize                    Anonymize src/dst address.


    algorithm                           Algorithm.  cryptopan-aes128 is
                                        currently supported.
                                         algorithm cryptopan-aes128

    key                                 Key.  Key is 128 bits in hex.
                                         key 0123456789ABCDEFG

    key-file                            File to load key from.  Key is
                                        128 bits in hex.
                                         key-file /mfstmp/secret-key

    key-file-refresh                    How often to check the key file.
                                        Interval is in minutes, the
                                        optional second argument is
                                        hour:min:sec to specify the
                                        first refresh.  This example
                                        will load a new key every day
                                        at 12:00:00.
                                         14400 12:00:00


ip-address-privacy-mask                 Apply a mask to the source and
                                        destination address to remove
                                        bits.

ip-port-privacy-mask                    Apply a mask to the source and
                                        destination port to remove
                                        bits.

tag-mask                                Apply mask to the source and
                                        destination tag.

    mask                                Source and Destination mask
                                        to apply.
                                         mask 0xFFFF 0xFFFF

scale                                   Scale packets and bytes.

  scale                                 Scale to apply.
                                         scale 100

replace-source-as0                      Replace source AS 0
replace-destination-as0                 Replace destination AS 0

  as                                    AS replacement value.
                                         as 3112&#13;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN39"
></A
><H2
>OPTIONS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-b<TT
CLASS="REPLACEABLE"
><I
> big</I
></TT
>|<TT
CLASS="REPLACEABLE"
><I
>little</I
></TT
></DT
><DD
><P
>Byte order of output.</P
></DD
><DT
>-C<TT
CLASS="REPLACEABLE"
><I
> Comment</I
></TT
></DT
><DD
><P
>Add a comment.</P
></DD
><DT
>-d<TT
CLASS="REPLACEABLE"
><I
> debug_level</I
></TT
></DT
><DD
><P
>Enable debugging.</P
></DD
><DT
>-h</DT
><DD
><P
>Display help.</P
></DD
><DT
>-k</DT
><DD
><P
>Keep time from input.</P
></DD
><DT
>-n</DT
><DD
><P
>Don't load configuration file.  Useful only with -V</P
></DD
><DT
>-v<TT
CLASS="REPLACEABLE"
><I
> variable binding</I
></TT
></DT
><DD
><P
>Set a variable FOO=bar.   </P
></DD
><DT
>-V<TT
CLASS="REPLACEABLE"
><I
> pdu_version</I
></TT
></DT
><DD
><P
>Use <TT
CLASS="REPLACEABLE"
><I
>pdu_version</I
></TT
> format output.
<P
CLASS="LITERALLAYOUT"
>&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;NetFlow&nbsp;version&nbsp;1&nbsp;(No&nbsp;sequence&nbsp;numbers,&nbsp;AS,&nbsp;or&nbsp;mask)<br>
&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;NetFlow&nbsp;version&nbsp;5<br>
&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;NetFlow&nbsp;version&nbsp;6&nbsp;(5+&nbsp;Encapsulation&nbsp;size)<br>
&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;NetFlow&nbsp;version&nbsp;7&nbsp;(Catalyst&nbsp;switches)<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.1&nbsp;&nbsp;NetFlow&nbsp;AS&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.2&nbsp;&nbsp;NetFlow&nbsp;Proto&nbsp;Port&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.3&nbsp;&nbsp;NetFlow&nbsp;Source&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.4&nbsp;&nbsp;NetFlow&nbsp;Destination&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.5&nbsp;&nbsp;NetFlow&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.6&nbsp;&nbsp;NetFlow&nbsp;Destination&nbsp;(Catalyst&nbsp;switches)<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.7&nbsp;&nbsp;NetFlow&nbsp;Source&nbsp;Destination&nbsp;(Catalyst&nbsp;switches)<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.8&nbsp;&nbsp;NetFlow&nbsp;Full&nbsp;Flow&nbsp;(Catalyst&nbsp;switches)<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.9&nbsp;&nbsp;NetFlow&nbsp;ToS&nbsp;AS&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.10&nbsp;NetFlow&nbsp;ToS&nbsp;Proto&nbsp;Port&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.11&nbsp;NetFlow&nbsp;ToS&nbsp;Source&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.12&nbsp;NetFlow&nbsp;ToS&nbsp;Destination&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.13&nbsp;NetFlow&nbsp;ToS&nbsp;Prefix&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;8.14&nbsp;NetFlow&nbsp;ToS&nbsp;Prefix&nbsp;Port&nbsp;Aggregation<br>
&nbsp;&nbsp;&nbsp;&nbsp;1005&nbsp;Flow-Tools&nbsp;tagged&nbsp;version&nbsp;5</P
></P
></DD
><DT
>-x<TT
CLASS="REPLACEABLE"
><I
> xlate_fname</I
></TT
></DT
><DD
><P
>Translation config file name.  Defaults to <TT
CLASS="FILENAME"
>/etc/ft/cfg/xlate.cfg</TT
></P
></DD
><DT
>-X<TT
CLASS="REPLACEABLE"
><I
> xlate_definition</I
></TT
></DT
><DD
><P
>Translation definition.  Defaults to default.</P
></DD
><DT
>-z<TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
></DT
><DD
><P
>Configure compression level to <TT
CLASS="REPLACEABLE"
><I
> z_level</I
></TT
>.  0 is
disabled (no compression), 9 is highest compression.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN99"
></A
><H2
>EXAMPLES</H2
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN101"
></A
><P
></P
><P
>Convert the version 7 flows in <TT
CLASS="FILENAME"
>flows.v7</TT
> to version 5,
storing the result in <TT
CLASS="FILENAME"
>flows.v5</TT
>.</P
><P
>  <B
CLASS="COMMAND"
>flow-xlate -V5 &lt; flows.v7 &gt; flows.v5</B
></P
><P
></P
></DIV
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN107"
></A
><P
></P
><P
>Set the low 11 bits in the IP addresses to zero unless the address
is multicast or it belongs to the 192.88.99/24 network.

<P
CLASS="LITERALLAYOUT"
>#&nbsp;xlate.cfg<br>
include-filter&nbsp;filter.cfg<br>
<br>
xlate-action&nbsp;MULTICAST-PRIVACY<br>
&nbsp;&nbsp;type&nbsp;ip-address-privacy-mask<br>
&nbsp;&nbsp;mask&nbsp;0xFFFFFFFF&nbsp;0xFFFFFFFF&nbsp;&nbsp;<br>
&nbsp;&nbsp;<br>
xlate-action&nbsp;UNICAST-PRIVACY<br>
&nbsp;&nbsp;type&nbsp;ip-address-privacy-mask<br>
&nbsp;&nbsp;mask&nbsp;0xFFFFFF00&nbsp;0xFFFFF800<br>
<br>
xlate-definition&nbsp;abilene_privacy<br>
&nbsp;&nbsp;term<br>
&nbsp;&nbsp;&nbsp;&nbsp;filter&nbsp;mcast<br>
&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;MULTICAST-PRIVACY<br>
&nbsp;&nbsp;&nbsp;&nbsp;stop<br>
&nbsp;&nbsp;term<br>
&nbsp;&nbsp;&nbsp;&nbsp;filter&nbsp;ucast<br>
&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;UNICAST-PRIVACY<br>&#13;</P
>

<P
CLASS="LITERALLAYOUT"
>#&nbsp;filter.cfg<br>
filter-primitive&nbsp;MCAST<br>
&nbsp;&nbsp;type&nbsp;ip-address-mask<br>
&nbsp;&nbsp;permit&nbsp;224.0.0.0&nbsp;240.0.0.0<br>
<br>
filter-primitive&nbsp;UCAST<br>
&nbsp;&nbsp;type&nbsp;ip-address-mask<br>
&nbsp;&nbsp;deny&nbsp;224.0.0.0&nbsp;240.0.0.0<br>
&nbsp;&nbsp;default&nbsp;permit<br>
<br>
filter-primitive&nbsp;SKIP<br>
&nbsp;&nbsp;type&nbsp;ip-address-mask<br>
&nbsp;&nbsp;deny&nbsp;192.88.99.0&nbsp;255.255.255.0<br>
&nbsp;&nbsp;default&nbsp;permit<br>
<br>
filter-definition&nbsp;mcast<br>
&nbsp;&nbsp;match&nbsp;ip-destination-address&nbsp;MCAST<br>
<br>
filter-definition&nbsp;ucast<br>
&nbsp;&nbsp;match&nbsp;ip-destination-address&nbsp;UCAST<br>
&nbsp;&nbsp;match&nbsp;ip-destination-address&nbsp;SKIP<br>
&nbsp;&nbsp;match&nbsp;ip-source-address&nbsp;SKIP</P
>

<B
CLASS="COMMAND"
>flow-cat <TT
CLASS="FILENAME"
>flows</TT
> | flow-xlate -xxlate.cfg -Xabilene_privacy | flow-print</B
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN113"
></A
><H2
>FILES</H2
><P
>  Configuration files:
    Symbols - <TT
CLASS="FILENAME"
>/etc/ft/sym/*</TT
>.
    Filter - <TT
CLASS="FILENAME"
>/etc/ft/cfg/filter.cfg</TT
>.
    Xlate - <TT
CLASS="FILENAME"
>/etc/ft/cfg/xlate.cfg</TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN119"
></A
><H2
>BUGS</H2
><P
>The scale option can overflow the 32 bit flow counters.  This could be
solved by detecting this condition and splitting the flow in two.</P
><P
>Translation between aggregated and non aggregated formats is not supported.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN123"
></A
><H2
>AUTHOR</H2
><P
>Mark Fullmer
<TT
CLASS="EMAIL"
>&#60;<A
HREF="mailto:maf@splintered.net"
>maf@splintered.net</A
>&#62;</TT
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN130"
></A
><H2
>SEE ALSO</H2
><P
><SPAN
CLASS="APPLICATION"
>flow-tools</SPAN
>(1)</P
></DIV
></BODY
></HTML
>