Documentation ¶
Index ¶
- Variables
- func FmtDefineAddress(name string, addr []byte) string
- type HeaderfileWriter
- func (h *HeaderfileWriter) WriteEndpointConfig(w io.Writer, e datapath.EndpointConfiguration) error
- func (h *HeaderfileWriter) WriteNetdevConfig(w io.Writer, cfg datapath.DeviceConfiguration) error
- func (h *HeaderfileWriter) WriteNodeConfig(w io.Writer, cfg *datapath.LocalNodeConfiguration) error
- func (h *HeaderfileWriter) WriteTemplateConfig(w io.Writer, e datapath.EndpointConfiguration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Cell = cell.Module( "datapath-config-writer", "Generate and write the configuration for datapath program types", cell.Provide( func(in struct { cell.In NodeExtraDefines []dpdef.Map `group:"header-node-defines"` NodeExtraDefineFns []dpdef.Fn `group:"header-node-define-fns"` }) (dptypes.ConfigWriter, error) { return NewHeaderfileWriter(in.NodeExtraDefines, in.NodeExtraDefineFns) }, ), )
Functions ¶
func FmtDefineAddress ¶
FmtDefineAddress returns the a define string from the given name and addr. Example: fmt.Print(FmtDefineAddress("foo", []byte{1, 2, 3})) // "#define foo { .addr = { 0x1, 0x2, 0x3 } }\n"
Types ¶
type HeaderfileWriter ¶
type HeaderfileWriter struct {
// contains filtered or unexported fields
}
HeaderfileWriter is a wrapper type which implements datapath.ConfigWriter. It manages writing of configuration of datapath program headerfiles.
func NewHeaderfileWriter ¶
func (*HeaderfileWriter) WriteEndpointConfig ¶
func (h *HeaderfileWriter) WriteEndpointConfig(w io.Writer, e datapath.EndpointConfiguration) error
WriteEndpointConfig writes the BPF configuration for the endpoint to a writer.
func (*HeaderfileWriter) WriteNetdevConfig ¶
func (h *HeaderfileWriter) WriteNetdevConfig(w io.Writer, cfg datapath.DeviceConfiguration) error
WriteNetdevConfig writes the BPF configuration for the endpoint to a writer.
func (*HeaderfileWriter) WriteNodeConfig ¶
func (h *HeaderfileWriter) WriteNodeConfig(w io.Writer, cfg *datapath.LocalNodeConfiguration) error
WriteNodeConfig writes the local node configuration to the specified writer.
func (*HeaderfileWriter) WriteTemplateConfig ¶
func (h *HeaderfileWriter) WriteTemplateConfig(w io.Writer, e datapath.EndpointConfiguration) error
WriteTemplateConfig writes the BPF configuration for the template to a writer.
Click to show internal directories.
Click to hide internal directories.