Documentation ¶
Overview ¶
Package api implements the oftee API that can be used for injecting packets to the open flow devices
Index ¶
- type API
- func (api *API) ListDevicesHandler(resp http.ResponseWriter, req *http.Request)
- func (api *API) ListenAndServe()
- func (api *API) MemProfileHandler(resp http.ResponseWriter, req *http.Request)
- func (api *API) PacketOutHandler(resp http.ResponseWriter, req *http.Request)
- func (api *API) StartCPUProfileHandler(resp http.ResponseWriter, req *http.Request)
- func (api *API) StopCPUProfileHandler(resp http.ResponseWriter, req *http.Request)
- type DPIDMapping
- type DevicesResponse
- type MappingAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { DPIDMappingListener chan DPIDMapping ListenOn string MemProfile string CPUProfile string // contains filtered or unexported fields }
API maintains the configuration and runtime information for the API
func (*API) ListDevicesHandler ¶
func (api *API) ListDevicesHandler(resp http.ResponseWriter, req *http.Request)
ListDevicesHandler returns a list of DPIDs known to the system as a JSON array
func (*API) ListenAndServe ¶
func (api *API) ListenAndServe()
ListenAndServe implements the API service loop
func (*API) MemProfileHandler ¶
func (api *API) MemProfileHandler(resp http.ResponseWriter, req *http.Request)
MemProfileHandler creates a snapshot memory profile
func (*API) PacketOutHandler ¶
func (api *API) PacketOutHandler(resp http.ResponseWriter, req *http.Request)
PacketOutHandler handles an HTTP request to packet out to a given switch port. The payload to the request should be the []byte of a OpenFlow packet out message, including the open flow header, the packet out header, and the packet.
func (*API) StartCPUProfileHandler ¶
func (api *API) StartCPUProfileHandler(resp http.ResponseWriter, req *http.Request)
StartCPUProfileHandler starts a CPU profile session
func (*API) StopCPUProfileHandler ¶
func (api *API) StopCPUProfileHandler(resp http.ResponseWriter, req *http.Request)
StopCPUProfileHandler stops a CPU profile session
type DPIDMapping ¶
type DPIDMapping struct { Action MappingAction DPID uint64 Inject injector.Injector }
DPIDMapping is used to associate a DPID with an injecting packet processor
type DevicesResponse ¶
type DevicesResponse struct {
Devices []string `json:"devices"`
}
DevicesResponse is used to create a HTTP response that lists all the known DPIDs
type MappingAction ¶
type MappingAction uint8
MappingAction defines DPID mapping actions
const ( // MapActionNone no op action MapActionNone MappingAction = 0x0 // MapActionAdd indicates addition of mapping MapActionAdd MappingAction = 1 << 0 // MapActionDelete indicated deletion of mapping MapActionDelete MappingAction = 1 << 1 )