# Package net.i2p.router.message

Garlic message creation, parsing, and source routing for I2P communications.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  GarlicMessageReceiver.CloveReceiver | Interface for handling decrypted garlic cloves.

- Class Summary
  Class | Description
  --- | ---
  CloveSet | Wrap up the data contained in a GarlicMessage after being decrypted
  GarlicConfig | Define the contents of a garlic chunk that contains 1 or more sub garlics.
  GarlicMessageBuilder | Build garlic messages based on a GarlicConfig
  GarlicMessageHandler | Builds jobs to process garlic messages received outside tunnels.
  GarlicMessageParser | Read a GarlicMessage, decrypt it, and return the resulting CloveSet.
  GarlicMessageReceiver | Handles the reception and decryption of GarlicMessages.
  HandleGarlicMessageJob | Job to handle an inbound GarlicMessage received outside of a tunnel.
  OutboundCache | Helper cache manager for outbound message optimization in OCMOSJ.
  OutboundCache.HashPair | Composite key for caches, combining source and destination Hashes.
  OutboundClientMessageJobHelper | Static methods to create a Garlic Message with one or more cloves, as follows:
  OutboundClientMessageOneShotJob | Send a client message out an outbound tunnel and into an inbound tunnel on the target leaseSet.
  PayloadGarlicConfig | Garlic config for a single clove, containing an I2NP message and no sub-cloves.
  SendMessageDirectJob | Send a message directly to another router, i.e.

## Package net.i2p.router.message Description

Garlic message creation, parsing, and source routing for I2P communications.

This package provides the core functionality for creating, parsing, and managing garlic messages, which are the fundamental building blocks of I2P's anonymous communication system. Garlic messages allow for the encryption and routing of multiple messages together, providing both anonymity and message bundling capabilities.

Key Components:

- GarlicMessageBuilder - Constructs garlic messages with multiple cloves
- GarlicMessageParser - Parses and validates incoming garlic messages
- GarlicMessageHandler - Processes and routes garlic messages
- GarlicMessageReceiver - Receives and handles garlic message delivery
- GarlicConfig - Configuration for garlic message creation
- PayloadGarlicConfig - Configuration for payload-specific garlic messages
- OutboundClientMessageJobHelper - Manages outbound client message jobs
- OutboundClientMessageOneShotJob - Single-shot outbound message handling
- SendMessageDirectJob - Direct message sending functionality
- HandleGarlicMessageJob - Job for processing garlic messages
- OutboundCache - Caching for outbound message optimization

Main Functionality:

- Garlic message construction and encryption
- Source routing for anonymous message delivery
- Message parsing and validation
- Outbound message job management
- Direct message sending capabilities
- Message caching and optimization
- Clove management and processing

Usage Notes:

- Essential for I2P's anonymous routing system
- Provides the foundation for end-to-end encryption
- Supports both client and router message types
- Integrates with the router's job queue system