Net::IMP

Inspection and Modification Protocol
Download

Net::IMP Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steffen Ullrich
  • Publisher web site:
  • http://search.cpan.org/~sullr/

Net::IMP Tags


Net::IMP Description

IMP is a protocol for inspection, modification and rejection of data between two sides (server and client) using an analyzer implementing this interface.SYNOPSIS package mySessionLog; use base 'Net::IMP::Base'; use Net::IMP; # creates factory object sub new_factory { my ($class,%args) = @_; ... create factory object ... ... $factory->new_analyzer calls later $class->new_analyzer ... } # creates new analyzer object, gets %args from factory sub new_analyzer { my ($class,%args) = @_; ... handle private %args ... my $self = $class->SUPER::new_analyzer( %args ); # prepass everything forever in both directions $self->add_results( , # for dir client->server ; # for dir server->client ); return $self; } # new data for analysis, $offset should only be set if there are gaps # (e.g. when we PASSed data with offset in the future) sub data { my ($self,$dir,$data,$offset) = @_; ... log data ... } package main; if (my @err = mySessionLog->validate_cfg(%config)) { die "@err" } my $factory = mySessionLog->new_factory(%config); # calls mySessionLog->new_analyzer my $analyzer = $factory->new_analyzer(...); $analyzer->set_callback(\&imp_cb); $analyzer->data(0,'data from dir 0'); .... will call imp_cb as soon as results are there ... $analyzer->data(0,''); # eof from dir 0 # callback for results sub imp_cb { for my $rv (@_) { my $rtype = shift(@$rv); if ( $rtype == IMP_PASS ) ... ... } }Product's homepage


Net::IMP Related Software