Documentation
¶
Index ¶
- Variables
- func FmtDefineAddress(name string, addr []byte) string
- type HeaderfileWriter
- func (h *HeaderfileWriter) WriteEndpointConfig(w io.Writer, e endpoint.Config) error
- func (h *HeaderfileWriter) WriteNetdevConfig(w io.Writer, opts *option.IntOptions) error
- func (h *HeaderfileWriter) WriteNodeConfig(w io.Writer, cfg *config.Config) errordeprecated
- func (h *HeaderfileWriter) WriteTemplateConfig(w io.Writer, e endpoint.Config) error
- type Writer
- type WriterParams
Constants ¶
This section is empty.
Variables ¶
var Cell = cell.Module( "datapath-linux-config", "Generate and write the configuration for datapath program types", cell.Provide(NewHeaderfileWriter), )
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 Writer. It manages writing of configuration of datapath program headerfiles.
func (*HeaderfileWriter) WriteEndpointConfig ¶
WriteEndpointConfig writes the BPF configuration for the endpoint to a writer.
func (*HeaderfileWriter) WriteNetdevConfig ¶
func (h *HeaderfileWriter) WriteNetdevConfig(w io.Writer, opts *option.IntOptions) error
WriteNetdevConfig writes the BPF configuration for the endpoint to a writer.
func (*HeaderfileWriter) WriteNodeConfig
deprecated
WriteNodeConfig writes the local node configuration to the specified writer.
Deprecated: Future additions to this function will be rejected. The docs at https://docs.cilium.io/en/latest/contributing/development/datapath_config will guide you through adding new configuration.
func (*HeaderfileWriter) WriteTemplateConfig ¶
WriteTemplateConfig writes the BPF configuration for the template to a writer.
type Writer ¶
type Writer interface {
// WriteNodeConfig writes the implementation-specific configuration of
// node-wide options into the specified writer.
WriteNodeConfig(io.Writer, *config.Config) error
// WriteNetdevConfig writes the implementation-specific configuration
// of configurable options to the specified writer. Options specified
// here will apply to base programs and not to endpoints, though
// endpoints may have equivalent configurable options.
WriteNetdevConfig(io.Writer, *option.IntOptions) error
// WriteTemplateConfig writes the implementation-specific configuration
// of configurable options for BPF templates to the specified writer.
WriteTemplateConfig(w io.Writer, cfg endpoint.Config) error
// WriteEndpointConfig writes the implementation-specific configuration
// of configurable options for the endpoint to the specified writer.
WriteEndpointConfig(w io.Writer, cfg endpoint.Config) error
}
Writer is anything which writes the configuration for various datapath program types.
func NewHeaderfileWriter ¶
func NewHeaderfileWriter(p WriterParams) (Writer, error)
type WriterParams ¶ added in v1.15.0
type WriterParams struct {
cell.In
Log *slog.Logger
LBConfig loadbalancer.Config
NodeMap nodemap.MapV2
NodeAddressing node.Addressing
NodeExtraDefines []dpdef.Map `group:"header-node-defines"`
NodeExtraDefineFns []dpdef.Fn `group:"header-node-define-fns"`
Sysctl sysctl.Sysctl
KPRConfig kpr.KPRConfig
IPSecConfig ipsec.Config
}