github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/ipv6/extension-routing.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package ipv6
     4  
     5  import (
     6  	"../protocol"
     7  )
     8  
     9  /*
    10  // Routing is IPv6 extension header with NextHeader==43
    11  type Routing struct {
    12  	NextHeader       uint8
    13  	HdrExtLen        uint8
    14  	RoutingType      uint8
    15  	SegmentsLeft     uint8
    16  	TypeSpecificData [4]byte
    17  	Optional         []byte // more type-specific data...
    18  }
    19  */
    20  type extensionRouting []byte
    21  
    22  func (er extensionRouting) NextHeader() byte          { return o[0] }
    23  func (er extensionRouting) Length() byte              { return o[1] }
    24  func (er extensionRouting) RoutingType() byte         { return o[2] }
    25  func (er extensionRouting) SegmentsLeft() byte        { return o[3] }
    26  func (er extensionRouting) TypeSpecificData() [4]byte { return o[4:] }
    27  func (er extensionRouting) Optional() []byte          { return o[8:] }
    28  func (er extensionRouting) NextHeader() []byte        { return o[8+er.Length():] }
    29  
    30  func (er extensionRouting) Process(conn *Connection) (err protocol.Error) {
    31  	return
    32  }