Documentation ¶
Index ¶
- Constants
- func APIResponse(ctx *gin.Context, err error, data interface{})
- func BacthMissionFailedResponse(ctx *gin.Context, err ...error)
- func BacthMissionSuccessResponse(ctx *gin.Context, err error)
- func ConnectDbusService(ctx *gin.Context, err error)
- func NotFount(ctx *gin.Context, err error, data interface{})
- func SuccessResponse(ctx *gin.Context, err error, data interface{})
- type Accept
- type Audit
- type BatchPortQuery
- type BatchServiceQuery
- type BatchSettingQuery
- type BatchZoneQuery
- type Destination
- type Drop
- type ForwardPort
- type ForwardQuery
- type IcmpBlock
- type IcmpType
- type Interface
- type Limit
- type Log
- type Mark
- type Port
- type PortQuery
- type Protocol
- type Query
- type QueryRich
- type QuerySettings
- type Reject
- type RemoveQuery
- type Response
- type ResponseSlice
- type Rich
- type RichQuery
- type Rule
- type ServiceQuery
- type ServiceSetting
- type ServiceSettingQuery
- type Settings
- type Source
- type SourcePort
- type ZoneDst
- type ZoneSettingQuery
Constants ¶
View Source
const ( INTERFACE = "org.fedoraproject.FirewallD1" PATH = "/org/fedoraproject/FirewallD1" DIRECT = INTERFACE + ".direct" IPSET = INTERFACE + ".ipset" POLICIES = INTERFACE + ".policies" ZONE = INTERFACE + ".zone" INTROSPECTABLE = "org.freedesktop.DBus.Introspectable" PROPERTIES = "org.freedesktop.DBus.Properties" CONFIG_PATH = PATH + "/config" CONFIG_INTERFACE = INTERFACE + ".config" CONFIG_DIRECT_INTERFACE = INTERFACE + ".config.direct" CONFIG_POLICIES_INTERFACE = INTERFACE + ".config.policies" ZONE_PATH = CONFIG_PATH + "/zone" ZONE_INTERFACE = INTERFACE + ".config.zone" SERVICE_PATH = PATH + "/config/service/i" SERVICE_INTERFACE = INTERFACE + ".config.service" IPSET_PATH = PATH + "/config/ipset/i" IPSET_INTERFACE = INTERFACE + ".config.ipset" ICMP_PATH = PATH + "/config/icmptype/i" ICMP_INTERFACE = INTERFACE + ".config.icmptype" // org.fedoraproject.FirewallD1 INTERFACE_GETDEFAULTZONE = INTERFACE + ".getDefaultZone" INTERFACE_SETDEFAULTZONE = INTERFACE + ".setDefaultZone" INTERFACE_GETZONESETTINGS = INTERFACE + ".getZoneSettings" INTERFACE_RELOAD = INTERFACE + ".completeReload" INTERFACE_LISTSERVICES = INTERFACE + ".listServices" INTERFACE_RUNTIMETOPERMANENT = INTERFACE + ".runtimeToPermanent" //config CONFIG_ADDSERVICE = CONFIG_INTERFACE + ".addService" // org.fedoraproject.FirewallD1.zone ZONE_ADDMASQUERADE = ZONE + ".addMasquerade" ZONE_REMOVEMASQUERADE = ZONE + ".removeMasquerade" ZONE_QUERYMASQUERADE = ZONE + ".queryMasquerade" ZONE_ADDPORT = ZONE + ".addPort" ZONE_REMOVEPORT = ZONE + ".removePort" ZONE_ADDPROTOCOL = ZONE + ".addProtocol" ZONE_ADDRICHRULE = ZONE + ".addRichRule" ZONE_ADDSERVICE = ZONE + ".addService" ZONE_GETSERVICES = ZONE + ".getServices" ZONE_ADDSOURCE = ZONE + ".addSource" ZONE_ADDINTERFACE = ZONE + ".addInterface" ZONE_QUERYINTERFACE = ZONE + ".queryInterface" ZONE_REMOVEINTERFACE = ZONE + ".removeInterface" ZONE_REOMVERICHRULE = ZONE + ".removeRichRule" ZONE_GETPORTS = ZONE + ".getPorts" ZONE_ADDFORWARDPORT = ZONE + ".addForwardPort" ZONE_GETFORWARDPORT = ZONE + ".getForwardPorts" ZONE_REMOVEFORWARDPORT = ZONE + ".removeForwardPort" ZONE_QUERYFORWARDPORT = ZONE + ".queryForwardPort" // get ZONE_GETZONES = ZONE + ".getZones" ZONE_GETZONEOFINTERFACE = ZONE + ".getZoneOfInterface" ZONE_GETRICHRULES = ZONE + ".getRichRules" ZONE_QUERYRICHRULE = ZONE + ".queryRichRule" ZONE_QUERYSERVICE = ZONE + ".queryService" ZONE_REMOVESERVICE = ZONE + ".removeService" // org.fedoraproject.FirewallD1.config CONFIG_ADDZONE = CONFIG_INTERFACE + ".addZone" // org.fedoraproject.FirewallD1.config.zone CONFIG_ZONE = CONFIG_INTERFACE + ".zone" CONFIG_UPDATE = CONFIG_ZONE + ".update" CONFIG_ZONE_ADDRICHRULE = CONFIG_ZONE + ".addRichRule" CONFIG_ZONE_REOMVERICHRULE = CONFIG_ZONE + ".removeRichRule" CONFIG_ZONE_QUERYRICHRULE = CONFIG_ZONE + ".queryRichRule" CONFIG_ZONE_ADDSERVICE = CONFIG_ZONE + ".addService" CONFIG_ZONE_QUERYSERVICE = CONFIG_ZONE + ".queryService" CONFIG_ZONE_REMOVESERVICE = CONFIG_ZONE + ".removeService" CONFIG_ZONE_GETSERVICES = CONFIG_ZONE + ".getServices" CONFIG_ZONE_ADDPORT = CONFIG_ZONE + ".addPort" CONFIG_ZONE_GETPORTS = CONFIG_ZONE + ".getPorts" CONFIG_ZONE_REMOVEPORT = CONFIG_ZONE + ".removePort" CONFIG_ZONE_ADDMASQUERADE = CONFIG_ZONE + ".addMasquerade" CONFIG_ZONE_REMOVEMASQUERADE = CONFIG_ZONE + ".removeMasquerade" CONFIG_ZONE_QUERYMASQUERADE = CONFIG_ZONE + ".queryMasquerade" CONFIG_ZONE_ADDINTERFACE = CONFIG_ZONE + ".addInterface" CONFIG_ZONE_REMOVEINTERFACE = CONFIG_ZONE + ".removeInterface" CONFIG_ZONE_ADDFORWARDPORT = CONFIG_ZONE + ".addForwardPort" CONFIG_ZONE_REMOVEFORWARDPORT = CONFIG_ZONE + ".removeForwardPort" CONFIG_ZONE_QUERYFORWARDPORT = CONFIG_ZONE + ".queryForwardPort" CONFIG_GETFORWARDPORT = CONFIG_ZONE + ".getForwardPorts" CONFIG_REMOVEZONE = CONFIG_ZONE + ".remove" )
Variables ¶
This section is empty.
Functions ¶
func BacthMissionFailedResponse ¶
ConnectDbusService ....
func BacthMissionSuccessResponse ¶
ConnectDbusService ....
func ConnectDbusService ¶
ConnectDbusService ....
func SuccessResponse ¶
SuccessResponse ....
Types ¶
type BatchPortQuery ¶
type BatchServiceQuery ¶
type BatchServiceQuery struct { Delay uint32 `form:"delay,default=0" json:"delay,omitempty"` Services []ServiceQuery `form:"services" json:"services,omitempty"` }
type BatchSettingQuery ¶
type BatchZoneQuery ¶
type Destination ¶
type Destination struct { Address string `form:"address" json:"address,omitempty"` Invert string `form:"invert" json:"invert,omitempty"` }
func (*Destination) IsEmpty ¶
func (this *Destination) IsEmpty() bool
func (*Destination) ToString ¶
func (this *Destination) ToString() string
type ForwardPort ¶
type ForwardPort struct { Port string `form:"port" json:"port,omitempty"` Protocol string `form:"protocol" json:"protocol,omitempty"` ToPort string `form:"toport" json:"toport,omitempty"` ToAddr string `form:"toaddr" json:"toaddr,omitempty"` }
func SliceToStruct ¶
func SliceToStruct(array interface{}) (ForwardPort, error)
func (*ForwardPort) IsEmpty ¶
func (this *ForwardPort) IsEmpty() bool
func (*ForwardPort) ToString ¶
func (this *ForwardPort) ToString() string
type ForwardQuery ¶
type ForwardQuery struct { Ip string `form:"ip" json:"ip" binding:"required"` Zone string `form:"zone,default=public" json:"zone"` Timeout uint32 `form:"timeout,default=0" json:"timeout"` Forward *ForwardPort `form:"forward" json:"forward,omitempty" binding:"required"` }
type Log ¶
type Mark ¶
type Port ¶
type Query ¶
type Query struct { Ip string `form:"ip" json:"ip" binding:"required"` Zone string `form:"zone,default=public" json:"zone"` Timeout uint32 `form:"timeout,default=0" json:"timeout"` Port *Port `form:"port" json:"port,omitempty"` Forward *ForwardPort `form:"forward" json:"forward,omitempty"` Rich *Rule `form:"rich" json:"rich,omitempty"` Service string `form:"service" json:"service,omitempty"` }
type QueryRich ¶
type QueryRich struct { Address string `form:"address" json:"address" binding:"required,omitempty"` Port int `form:"port" json:"port" binding:"required,omitempty"` Protocol string `form:"protocol" json:"protocol" binding:"required,omitempty"` Type string `form:"type" json:"type" binding:"required,omitempty"` Expire int `form:"expire" json:"expire,omitempty"` Zone string `form:"utils" json:"utils" binding:"required,omitempty"` }
type QuerySettings ¶
type QuerySettings struct { Version string `deepcopier:"field:Version" form:"version" json:"version,omitempty"` Short string `deepcopier:"field:Short" form:"short" json:"short,omitempty" binding:"required"` Description string `deepcopier:"field:Description" form:"description" json:"description,omitempty" binding:"required"` Forward bool `deepcopier:"field:Forward" form:"forward" json:"forward,omitempty"` Target string `deepcopier:"field:Target" form:"target" json:"target,omitempty" binding:"required"` Service []string `deepcopier:"field:Service" form:"service" json:"service,omitempty"` Port []*Port `deepcopier:"field:Port" form:"port" json:"port,omitempty"` IcmpBlock []*IcmpBlock `deepcopier:"field:IcmpBlock" form:"icmpblock" json:"icmpblock,omitempty"` Masquerade bool `deepcopier:"field:Masquerade" form:"masquerade" json:"masquerade,omitempty"` ForwardPort []*ForwardPort `deepcopier:"field:ForwardPort" form:"forwardport" json:"forwardport,omitempty"` Interface []*Interface `deepcopier:"field:Interface" form:"interface" json:"interface,omitempty"` Source []*Source `deepcopier:"field:Source" form:"source" json:"source,omitempty"` Rule []*Rule `deepcopier:"skip" form:"rule" json:"rule,omitempty"` Protocol []*Protocol `deepcopier:"field:Protocol" form:"protocol" json:"protocol,omitempty"` SourcePort []*SourcePort `deepcopier:"field:SourcePort" form:"sourceport" json:"sourceport,omitempty"` IcmpBlockInversion bool `deepcopier:"field:IcmpBlockInversion" form:"icmp-block-inversion" json:"icmp-block-inversion",omitempty"` }
type Reject ¶
type RemoveQuery ¶
type ResponseSlice ¶
type Rich ¶
type Rich struct { Address string `form:"address" json:"address" binding:"required,omitempty"` Port int `form:"port" json:"port" binding:"required,omitempty"` Protocol string `form:"protocol" json:"protocol" binding:"required,omitempty"` Type string `form:"type" json:"type" binding:"required,omitempty"` Expire int `form:"expire" json:"expire,omitempty"` Zone string `form:"utils" json:"utils,omitempty"` }
type Rule ¶
type Rule struct { Family string `form:"family" json:"family,omitempty,default=ipv4"` Source *Source `form:"source" json:"source,omitempty"` Destination *Destination `form:"destination" json:"destination,omitempty"` Service []string `form:"service" json:"service,omitempty"` Port *Port `form:"protocol" json:"protocol,omitempty"` Protocol *Protocol `form:"protocol" json:"protocol,omitempty"` IcmpBlock *IcmpBlock `form:"icmpblock" json:"icmpblock,omitempty"` IcmpType *IcmpType `form:"icmptype" json:"icmptype,omitempty"` ForwardPort *ForwardPort `form:"forwardport" json:"forwardport,omitempty"` Log *Log `form:"log" json:"log,omitempty"` Audit *Audit `form:"audit" json:"audit,omitempty"` Accept *Accept `form:"accept" json:"accept,omitempty"` Reject *Reject `form:"reject" json:"reject,omitempty"` Drop *Drop `form:"drop" json:"drop,omitempty"` Mark *Mark `form:"mark" json:"mark,omitempty"` }
func StringToRule ¶
type ServiceQuery ¶
type ServiceSetting ¶
type ServiceSetting struct { Version string `form:"version" json:"version,omitempty"` Short string `form:"short" json:"short,omitempty"` Description string `form:"description" json:"description,omitempty"` Port *[]Port `form:"port" json:"port,omitempty"` Module []string `form:"module" json:"module,omitempty"` Destination map[string]string `form:"destination" json:"destination,omitempty"` Protocol []string `form:"protocol" json:"protocol,omitempty"` Source_ports []string `form:"source_ports" json:"source_ports,omitempty"` }
type ServiceSettingQuery ¶
type ServiceSettingQuery struct { Host string `form:"host" json:"host" binding:"required"` ServiceName string `form:"service_name" json:"service_name" binding:"required"` Setting *ServiceSetting `form:"setting" json:"setting,omitempty" binding:"required"` }
type Settings ¶
type Settings struct { Version string `deepcopier:"field:Version" form:"version" json:"version,omitempty"` Short string `deepcopier:"field:Short" form:"short" json:"short,omitempty" binding:"required"` Description string `deepcopier:"field:Description" form:"description" json:"description,omitempty" binding:"required"` Forward bool `deepcopier:"field:Forward" form:"forward" json:"forward,omitempty"` Target string `deepcopier:"field:Target" form:"target" json:"target,omitempty" binding:"required"` Service []string `deepcopier:"field:Service" form:"service" json:"service,omitempty"` Port []*Port `deepcopier:"field:Port" form:"port" json:"port,omitempty"` IcmpBlock []*IcmpBlock `deepcopier:"field:IcmpBlock" form:"icmpblock" json:"icmpblock,omitempty"` Masquerade bool `deepcopier:"field:Masquerade" form:"masquerade" json:"masquerade,omitempty"` ForwardPort []*ForwardPort `deepcopier:"field:ForwardPort" form:"forwardport" json:"forwardport,omitempty"` Interface []*Interface `deepcopier:"field:Interface" form:"interface" json:"interface,omitempty"` Source []*Source `deepcopier:"field:Source" form:"source" json:"source,omitempty"` Rule []string `deepcopier:"skip" form:"rule" json:"rule,omitempty"` Protocol []*Protocol `deepcopier:"field:Protocol" form:"protocol" json:"protocol,omitempty"` SourcePort []*SourcePort `deepcopier:"field:SourcePort" form:"sourceport" json:"sourceport,omitempty"` IcmpBlockInversion bool `deepcopier:"field:IcmpBlockInversion" form:"icmp-block-inversion" json:"icmp-block-inversion",omitempty"` }
type Source ¶
type SourcePort ¶
type ZoneSettingQuery ¶
type ZoneSettingQuery struct { Ip string `form:"ip" json:"ip" binding:"required"` Setting *QuerySettings `form:"setting" json:"Setting,omitempty" binding:"required"` }
Click to show internal directories.
Click to hide internal directories.