protoparse

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2019 License: BSD-2-Clause Imports: 1 Imported by: 0

README

[protoparse]

 [general]
 a library to parse various protocols to protocol buffers
 current protocols:
 - MRT (BGP4MP)
 - BGP
 - RIB

 The main interface in protoparse is PbVal and the types that implement it
 are structures that usually have a buf []byte buffer that as the messages are
 parsed it is advanced and a a dest protocol buffer pointer that the data is stored.
 The functions of the interface is Parse() (PbVal, error) and String() string
 once an of type PbVal is created with an underlying buffer buf upon calling Parse() on 
 it another object that satisfies the PbVal interface is returned. this we way we can 
 recurse in the container formats while populating the internal protocol buffer messages.

[commands]
 recordfilegen: generated go code to store and retrieve generic records based on the type
                that the user provides as arguments

[usage]
  run make. the gobgpdump binary should be under cmd/. Running it on an MRT file produces 
  bgpdump like output. 
  make test will fetch a sample file from the http://bgpmon.io archive , store it under /tmp
  and run the gobgpdump command on it.
  (for more info on the archive see: http://bgpmon.io/archive/help)

[TODO]
 - more protocols
 - godoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BGP4MPHeaderer

type BGP4MPHeaderer interface {
	PbVal
	GetHeader() *pbbgp.BGP4MPHeader
}

type BGPUpdater

type BGPUpdater interface {
	PbVal
	GetUpdate() *pbbgp.BGPUpdate
}

type MRTHeaderer

type MRTHeaderer interface {
	PbVal
	GetHeader() *pbbgp.MrtHeader
}

type PbVal

type PbVal interface {
	Parse() (PbVal, error)
	String() string
}

A pbval is an interface that takes a byte slice and populates the underlying pb. all supported pbs must implement it.

type RIBHeaderer

type RIBHeaderer interface {
	PbVal
	GetHeader() *pbbgp.RIB
}

Directories

Path Synopsis
this program generates the appropriate record files based on the templates.
this program generates the appropriate record files based on the templates.
protocol
bgp
mrt
rib
The protoparse util package deals with reading and writing protocol buffer encoded records in, for example, files.
The protoparse util package deals with reading and writing protocol buffer encoded records in, for example, files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL