Documentation ¶
Index ¶
- Constants
- func InitDB() error
- func IsMoreThanOne(err error) bool
- func IsNotFound(err error) bool
- type SIface
- type SIfaceManager
- type SIfacePeer
- type SIfacePeerManager
- type SMeshNetwork
- type SMeshNetworkManager
- type SMeshNetworkMember
- type SMeshNetworkMemberManager
- type SRoute
- type SRouteManager
- type SRouter
- func (router *SRouter) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (router *SRouter) PerformDeploy(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PerformJoinMeshNetwork(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PerformLeaveMeshNetwork(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PerformRealize(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PerformRegisterIfname(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PerformUnregisterIfname(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (router *SRouter) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (router *SRouter) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (router *SRouter) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.RouterUpdateInput, error)
- type SRouterDeployment
- type SRouterDeploymentManager
- type SRouterManager
- type SRule
- type SRuleManager
- type Subnets
Constants ¶
View Source
const ( MIN_PRIO = 0 MAX_PRIO = 2000 DEF_PRIO = 0 DEF_PRIO_ROUTER_FORWARD = 1000 DEF_PRIO_MASQUERADE = 1000 ACT_SNAT = "SNAT" ACT_DNAT = "DNAT" ACT_MASQUERADE = "MASQUERADE" ACT_TCPMSS = "TCPMSS" // FORWARD chain for now ACT_INPUT_ACCEPT = "INPUT_ACCEPT" ACT_FORWARD_ACCEPT = "FORWARD_ACCEPT" PROTO_TCP = "tcp" PROTO_UDP = "udp" )
Variables ¶
This section is empty.
Functions ¶
func IsMoreThanOne ¶
func IsNotFound ¶
Types ¶
type SIface ¶
type SIface struct { db.SStandaloneResourceBase RouterId string `length:"32" nullable:"false"` NetworkId string `length:"32" nullable:"false"` Ifname string `length:"32" nullable:"false"` PrivateKey string PublicKey string ListenPort int `nullable:"false"` IsSystem bool `nullable:"false"` }
func (*SIface) CustomizeDelete ¶
func (iface *SIface) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SIface) ValidateDeleteCondition ¶
type SIfaceManager ¶
type SIfaceManager struct {
db.SStandaloneResourceBaseManager
}
var IfaceManager *SIfaceManager
func (*SIfaceManager) ListItemFilter ¶
func (man *SIfaceManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)
虚拟路由器接口列表
func (*SIfaceManager) ValidateCreateData ¶
func (man *SIfaceManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
type SIfacePeer ¶
type SIfacePeerManager ¶
type SIfacePeerManager struct {
db.SStandaloneResourceBaseManager
}
var IfacePeerManager *SIfacePeerManager
type SMeshNetwork ¶
type SMeshNetwork struct {
db.SStandaloneResourceBase
}
func (*SMeshNetwork) CustomizeDelete ¶
func (mn *SMeshNetwork) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SMeshNetwork) PerformRealize ¶
func (mn *SMeshNetwork) PerformRealize(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
type SMeshNetworkManager ¶
type SMeshNetworkManager struct {
db.SStandaloneResourceBaseManager
}
var MeshNetworkManager *SMeshNetworkManager
type SMeshNetworkMember ¶
type SMeshNetworkMember struct { db.SStandaloneResourceBase MeshNetworkId string RouterId string AdvertiseSubnets string }
type SMeshNetworkMemberManager ¶
type SMeshNetworkMemberManager struct {
db.SStandaloneResourceBaseManager
}
var MeshNetworkMemberManager *SMeshNetworkMemberManager
type SRoute ¶
type SRoute struct { db.SStandaloneResourceBase IfaceId string `length:"32" nullable:"false" list:"user" create:"required"` Ifname string `length:"32" nullable:"false" list:"user" create:"optional"` Network string `length:"32" nullable:"false" list:"user" update:"user" create:"required"` Gateway string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` RouterId string `length:"32" nullable:"false" list:"user" create:"optional"` }
func (*SRoute) ValidateUpdateData ¶
func (route *SRoute) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.RouteUpdateInput) (api.RouteUpdateInput, error)
type SRouteManager ¶
type SRouteManager struct {
db.SStandaloneResourceBaseManager
}
var RouteManager *SRouteManager
func (*SRouteManager) ListItemFilter ¶
func (man *SRouteManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)
虚拟路由器路由列表
func (*SRouteManager) ValidateCreateData ¶
func (man *SRouteManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
type SRouter ¶
type SRouter struct { db.SStandaloneResourceBase User string `nullable:"false" list:"user" update:"user" create:"optional"` Host string `nullable:"false" list:"user" update:"user" create:"required"` Port int `nullable:"false" list:"user" update:"user" create:"optional"` PrivateKey string `nullable:"true" update:"user" create:"optional"` // do not allow get, list RealizeWgIfaces bool `width:"16" charset:"ascii" nullable:"false" list:"user" create:"optional" update:"user"` RealizeRoutes bool `width:"16" charset:"ascii" nullable:"false" list:"user" create:"optional" update:"user"` RealizeRules bool `width:"16" charset:"ascii" nullable:"false" list:"user" create:"optional" update:"user"` }
Add revision?
func (*SRouter) CustomizeDelete ¶
func (router *SRouter) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SRouter) PerformDeploy ¶
func (router *SRouter) PerformDeploy(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PerformJoinMeshNetwork ¶
func (router *SRouter) PerformJoinMeshNetwork(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PerformLeaveMeshNetwork ¶
func (router *SRouter) PerformLeaveMeshNetwork(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PerformRealize ¶
func (router *SRouter) PerformRealize(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PerformRegisterIfname ¶
func (router *SRouter) PerformRegisterIfname(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PerformUnregisterIfname ¶
func (router *SRouter) PerformUnregisterIfname(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SRouter) PostCreate ¶
func (router *SRouter) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SRouter) PostUpdate ¶
func (router *SRouter) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SRouter) ValidateUpdateData ¶
func (router *SRouter) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.RouterUpdateInput) (api.RouterUpdateInput, error)
type SRouterDeployment ¶
type SRouterDeployment struct { db.SStandaloneResourceBase RouterId string AnsiblePlaybookId string RouterRevision int }
type SRouterDeploymentManager ¶
type SRouterDeploymentManager struct {
db.SStandaloneResourceBaseManager
}
var RouterDeploymentManager *SRouterDeploymentManager
type SRouterManager ¶
type SRouterManager struct {
db.SStandaloneResourceBaseManager
}
var RouterManager *SRouterManager
func (*SRouterManager) ValidateCreateData ¶
func (man *SRouterManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
type SRule ¶
type SRule struct { db.SStandaloneResourceBase Prio int `nullable:"false" list:"user" update:"user" create:"optional"` MatchSrcNet string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` MatchDestNet string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` MatchProto string `length:"8" nullable:"false" list:"user" update:"user" create:"optional"` MatchSrcPort int `nullable:"false" list:"user" update:"user" create:"optional"` MatchDestPort int `nullable:"false" list:"user" update:"user" create:"optional"` MatchInIfname string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` MatchOutIfname string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` Action string `length:"32" nullable:"false" list:"user" update:"user" create:"required"` ActionOptions string `length:"32" nullable:"false" list:"user" update:"user" create:"optional"` RouterId string `length:"32" nullable:"false" list:"user" create:"optional"` IsSystem bool `nullable:"false" list:"user" create:"optional"` }
func (*SRule) ValidateUpdateData ¶
func (rule *SRule) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.RuleUpdateInput) (api.RuleUpdateInput, error)
type SRuleManager ¶
type SRuleManager struct {
db.SStandaloneResourceBaseManager
}
var RuleManager *SRuleManager
func (*SRuleManager) ListItemFilter ¶
func (man *SRuleManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error)
虚拟路由器路由规则列表
func (*SRuleManager) ValidateCreateData ¶
func (man *SRuleManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
type Subnets ¶
type Subnets []*netutils.IPV4Prefix
func (Subnets) ContainsAny ¶
func (Subnets) ContainsAnyEx ¶
func (nets Subnets) ContainsAnyEx(nets1 Subnets) (bool, *netutils.IPV4Prefix)
Click to show internal directories.
Click to hide internal directories.