Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.23 KB

README.md

File metadata and controls

37 lines (30 loc) · 1.23 KB

Introduction

This project provides support for receiving NetFlow data from network devices using Netty. Currently only NetFlow v9 is supported. There are plans to support NetFlow v5 in a future release.

Usage

Pipeline Configuration

Bootstrap b = new Bootstrap();
b.group(bossGroup)
    .channel(NioDatagramChannel.class)
    .handler(new ChannelInitializer<DatagramChannel>() {
      @Override
      protected void initChannel(DatagramChannel datagramChannel) throws Exception {
        ChannelPipeline channelPipeline = datagramChannel.pipeline();
        channelPipeline.addLast(
            new LoggingHandler("NetFlow", LogLevel.TRACE),
            new NetFlowV9Decoder(),
            new NetFlowV9RequestHandler()
        );
      }
    });

NetFlow Message Processing

class NetFlowV9RequestHandler extends SimpleChannelInboundHandler<NetFlowV9Decoder.NetFlowMessage> {
  @Override
  protected void channelRead0(ChannelHandlerContext channelHandlerContext, NetFlowV9Decoder.NetFlowMessage netFlowMessage) throws Exception {

  }
}