Documentation ¶
Overview ¶
Code generated by goyacc -o y.go -l parse.y. DO NOT EDIT.
Index ¶
- Constants
- type AuthoritativeStatement
- type BooleanExpression
- type ConditionalStatement
- type DomainNameServersOption
- type FixedAddressStatement
- type GroupStatement
- type HardwareStatement
- type HostStatement
- type IncludeStatement
- type PacketOptionTerm
- type Statement
- type StringConstTerm
- type SubnetStatement
- type UseHostDeclNamesStatement
Constants ¶
const BoolAnd = 57354
const BoolEqual = 57357
const BoolExists = 57361
const BoolInequal = 57358
const BoolKnown = 57362
const BoolNot = 57356
const BoolOr = 57355
const BoolRegexIMatch = 57360
const BoolRegexMatch = 57359
const BoolStatic = 57363
const ConditionElse = 57353
const ConditionElsif = 57352
const ConditionIf = 57351
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthoritativeStatement ¶
type AuthoritativeStatement bool
An AuthoritativeStatement represents an "authoritative" parameter. See "The authoritative statement" in dhcpd.conf(5)
func (AuthoritativeStatement) IndentedString ¶
func (as AuthoritativeStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type BooleanExpression ¶
type BooleanExpression struct { // Operator is one of the boolean operators specified in dhcp-eval(5), // represented by the integer constants in this package beginning with // "Bool", e.g. BoolAnd, BoolOr, BoolEqual etc. // // The Operator specified will apply to either the BoolTerms or the // DataTerms supplied with the BooleanExpression. Operator int // one of boolOpStrings(...) // A BooleanExpression may apply an operator to the output of sub- // -expressions, e.g. the "and" operator in the algebraic expression // (x > 1) and (x < 10). In this case, the sub-expressions should be // specified under the BoolTerms field. BoolTerms []BooleanExpression // A BooleanExpression will otherwise apply to comparisons or operations // on data values, e.g. "if x = 'foo'". In this case, the sub-expressions // should be specified under the DataTerms field. DataTerms []fmt.Stringer }
A BooleanExpression is an expression of terms and operators which can be evaluated into a single true or false value. BooleanExpressions are used to determine if the statements within a ConditionalStatement will be evaluated. See dhcp-eval(5) for more information.
type ConditionalStatement ¶
type ConditionalStatement struct { // Operator is one of if/elsif/else, represented by the integers // {ConditionIf, ConditionElsif, ConditionElse}. Operator int // Condition is the expression immediately following the "if/elsif" word, // which determines if the other Statements within this ConditionalStatement // are evaluated. It is unnecessary / will be ignored for "else" // sub-conditionals. Condition BooleanExpression // Statements is the list of Statements which will be evaluated if Condition // proves True. Statements []Statement // SubConditionals is a list of elsif/else ConditionalStatements, whose // evaluation is predicated on the top-level statement not being evaluated, // and their own Conditions proving True. SubConditionals []ConditionalStatement }
A ConditionalStatement represents a conditional-evaluation statement in a config file, a la dhcp-eval(5).
Each top-level ConditionalStatement must be an if-statement; it may optionally have else-if and else sub ConditionalStatements.
Each ConditionalStatement also contains a block of other Statements.
Example usage:
cs := ConditionalStatement{ Operator: ConditionIf, Condition: BooleanExpression { Operator: BoolEqual, DataTerms: []fmt.Stringer { PacketOptionTerm{"user-class"}, StringConstTerm("iPXE"), }, }, SubConditionals: []ConditionalStatement { { Operator: ConditionElse, }, }, } cs.Statements = []Statement{IncludeStatement{"ipxe.conf"}} cs.SubConditionals[0].Statements = []Statement{IncludeStatement{"non-ipxe.conf"}}
This example corresponds to the following config-file text:
if option user-class = "iPXE" { include "ipxe.conf"; } else { include "non-ipxe.conf"; }
func (ConditionalStatement) IndentedString ¶
func (cs ConditionalStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type DomainNameServersOption ¶
A DomainNameServersOption represents a domain-name-servers option parameter. See "option domain-name-servers" in dhcp-options(5)
func (DomainNameServersOption) IndentedString ¶
func (dnso DomainNameServersOption) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type FixedAddressStatement ¶
A FixedAddressStatement represents a fixed-address parameter. See "The fixed-address declaration" in dhcpd.conf(5)
func (FixedAddressStatement) IndentedString ¶
func (fas FixedAddressStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type GroupStatement ¶
type GroupStatement struct {
Statements []Statement
}
A GroupStatement represents a group declaration. See "The group statement" in dhcpd.conf(5)
func (GroupStatement) IndentedString ¶
func (gs GroupStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type HardwareStatement ¶
A HardwareStatement represents a hardware parameter. See "The hardware statement" in dhcpd.conf(5)
func (HardwareStatement) IndentedString ¶
func (hs HardwareStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type HostStatement ¶
A HostStatement represents a host declaration. See "The host statement" in dhcpd.conf(5)
func (HostStatement) IndentedString ¶
func (hs HostStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type IncludeStatement ¶
type IncludeStatement struct {
Filename string
}
An IncludeStatement represents an include-file declaration. See "The include statement" in dhcpd.conf(5)
func (IncludeStatement) IndentedString ¶
func (is IncludeStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type PacketOptionTerm ¶
type PacketOptionTerm struct {
// contains filtered or unexported fields
}
A PacketOptionTerm is a data-term used in a BooleanExpression. It represents an option in a DHCP packet, and is stringified for config file syntax like “option user-class”.
func (PacketOptionTerm) String ¶
func (pot PacketOptionTerm) String() string
type Statement ¶
type Statement interface { // IndentedString produces string representation of the config statement, // in the form expected by dhcpd. The "prefix" argument is used to indent // nested statements; it is not a standard indent-depth, but an explicit // prefix for this particular statement's string representation. // FIXME It'd really be nice to be able to configure the standard depth. IndentedString(prefix string) string }
A Statement represents an ISC-DHCP configuration statement. See dhcpd.conf(5) dhcp-options(5) and dhcpd-eval(5) for canonical types. For implementations, see "go doc iscdhcp | grep Statement".
type StringConstTerm ¶
type StringConstTerm string
A StringConstTerm is a data-term used in a BooleanExpression. It represents a quote-enclosed arbitrary string, e.g. “"foo"”.
func (StringConstTerm) String ¶
func (sct StringConstTerm) String() string
type SubnetStatement ¶
A SubnetStatement represents a subnet declaration. See "The subnet statement" in dhcpd.conf(5)
func (SubnetStatement) IndentedString ¶
func (sns SubnetStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface
type UseHostDeclNamesStatement ¶
type UseHostDeclNamesStatement bool
A UseHostDeclNamesStatement represents a "use-host-decl-names" parameter. See "The use-host-decl-names statement" in dhcpd.conf(5)
func (UseHostDeclNamesStatement) IndentedString ¶
func (uhdns UseHostDeclNamesStatement) IndentedString(prefix string) string
IndentedString implements the method of the same name in the Statement interface