This directory contains the implementation of IP session tracking and
processing functions.  When the network protocol for a flow is determined
to be IP the base Stream preprocessor will delegate handling of the packets
on that flow to this module.

The StreamIp class is implemented as a subclass of Inspector and provides
functions for loading stream IP configuration and packet evaluation.  The
packet eval method is not used as the base Stream Inspector delegates
packets directly to the IP session packet processing method.

The module ip_ha.cc (and ip_ha.h) implements the per-protocol hooks into
the stream logic for HA.  IpHAManager is a static class that interfaces
to a per-packet thread instance of the class IpHA.  IpHA is sub-class
of ProtocolHA, declared in the stream/base area.  Thus each protocol
within 'stream' can have specific HA logic and interfaces.

IpHAManager::process_deletion() is called when an IP stream is being 
destroyed and indicates to the stream & flow HA logic that a flow
deletion HA message needs to be emitted for the flow in question.
Ip streams are closed due to timeout or pruning actions which lead
to the invocation of process_deletion().

IpHA::create_session() is called from the stream & flow HA logic and
handles the creation of new flow upon receiving an HA update message.

Defragmentation oversize checks and alert behavior change
=========================================================

IP fragment reassembly (frag3, in ip_defrag.cc) must ensure the reassembled
datagram, including any inner IP options carried on the offset-0 fragment,
never exceeds IP_MAXPACKET (65535).  Three code paths enforce this bound and
share the frag_exceeds_maxpacket() helper so the arithmetic cannot drift:
new_tracker() rejects an oversize first fragment before any tracker state is
committed, insert() rejects a fragment once its offset, length and the known
option length are combined, and FragRebuild() is a final safety net for the
out-of-order case where ft->ip_options_len only becomes known after the
offset-0 fragment arrives.  All three raise 123:7 (DEFRAG_ANOMALY_BADSIZE_LG).

As a result of adding the FragRebuild() safety net, a fragment that overflows
IP_MAXPACKET only at rebuild time now raises 123:7 (DEFRAG_ANOMALY_BADSIZE_LG)
instead of the previous 123:3 (DEFRAG_SHORT_FRAG).  This is an intentional
alert-behavior change: 123:7 more accurately describes an oversize datagram,
and it lets the reassembly bail out cleanly instead of silently dropping the
rebuilt packet.  Deployments that key on the specific defrag SID may observe
123:3 events for such fragments become 123:7.

Tracker purge post-condition
============================

delete_tracker() does not free the FragTracker; two callers keep using it in
place.  Defrag::expired() purges a timed-out train and lets the fragment that
triggered the timeout fall through to insert(), and Defrag::process() purges
after a rebuilt datagram drew a drop or would-drop verdict.  Both require the
purge to leave the tracker describing an empty datagram, as new_tracker()
does, which is what FragTracker::clear_fragments() provides: the fraglist and
its tail and count, the completion flags, frag_bytes, calculated_size,
frag_pkts, overlap_count and the alert record.

Only the frag_flags bits the caller names cross the purge, and delete_tracker()
names one: FRAG_DROP_FRAGMENTS is a per-key policy latch rather than fragment
accounting, so the remaining fragments of a dropped datagram keep being
dropped.  Tracker identity and configuration - engine, ip_proto, ttl,
frag_time and frag_policy - are owned by the caller and are untouched; in
particular engine must stay set, because clearing it would route the next
fragment to new_tracker() from inside the expired() path.
