trireme-lib: Index | Files

package pucontext

import ""


Package Files


type PUContext Uses

type PUContext struct {
    ApplicationACLs *acls.ACLCache

    DNSACLs      policy.DNSRuleList
    DNSProxyPort string

    Extension interface{}

    // contains filtered or unexported fields

PUContext holds data indexed by the PU ID

func NewPU Uses

func NewPU(contextID string, puInfo *policy.PUInfo, timeout time.Duration) (*PUContext, error)

NewPU creates a new PU context

func (*PUContext) Annotations Uses

func (p *PUContext) Annotations() *policy.TagStore

Annotations returns the annotations

func (*PUContext) ApplicationACLPolicyFromAddr Uses

func (p *PUContext) ApplicationACLPolicyFromAddr(addr net.IP, port uint16) (report *policy.FlowPolicy, action *policy.FlowPolicy, err error)

ApplicationACLPolicyFromAddr retrieve the policy given an address and port.

func (*PUContext) Autoport Uses

func (p *PUContext) Autoport() bool

Autoport returns if auto port feature is set on the PU

func (*PUContext) CacheExternalFlowPolicy Uses

func (p *PUContext) CacheExternalFlowPolicy(packet *packet.Packet, plc interface{})

CacheExternalFlowPolicy will cache an external flow

func (*PUContext) CompressedTags Uses

func (p *PUContext) CompressedTags() *policy.TagStore

CompressedTags returns the compressed tags.

func (*PUContext) Counters Uses

func (p *PUContext) Counters() *counters.Counters

Counters returns the scopes.

func (*PUContext) CreateRcvRules Uses

func (p *PUContext) CreateRcvRules(policyRules policy.TagSelectorList)

CreateRcvRules create receive rules for this PU based on the update of the policy.

func (*PUContext) CreateTxtRules Uses

func (p *PUContext) CreateTxtRules(policyRules policy.TagSelectorList)

CreateTxtRules create receive rules for this PU based on the update of the policy.

func (*PUContext) GetCachedTokenAndServiceContext Uses

func (p *PUContext) GetCachedTokenAndServiceContext() ([]byte, []byte, error)

GetCachedTokenAndServiceContext returns the cached syn packet token

func (*PUContext) GetJWT Uses

func (p *PUContext) GetJWT() (string, error)

GetJWT retrieves the JWT if it exists in the cache. Returns error otherwise.

func (*PUContext) GetPolicyFromFQDN Uses

func (p *PUContext) GetPolicyFromFQDN(fqdn string) ([]policy.PortProtocolPolicy, error)

GetPolicyFromFQDN gets the list of policies that are mapped with the hostname

func (*PUContext) GetProcessKeys Uses

func (p *PUContext) GetProcessKeys() (string, []string, []string)

GetProcessKeys returns the cache keys for a process

func (*PUContext) HashID Uses

func (p *PUContext) HashID() string

HashID returns the hash of the ID of the PU

func (*PUContext) ID Uses

func (p *PUContext) ID() string

ID returns the ID of the PU

func (*PUContext) Identity Uses

func (p *PUContext) Identity() *policy.TagStore

Identity returns the indentity

func (*PUContext) ManagementID Uses

func (p *PUContext) ManagementID() string

ManagementID returns the management ID

func (*PUContext) ManagementNamespace Uses

func (p *PUContext) ManagementNamespace() string

ManagementNamespace returns the management namespace

func (*PUContext) Mark Uses

func (p *PUContext) Mark() string

Mark returns the PU mark

func (*PUContext) NetworkACLPolicy Uses

func (p *PUContext) NetworkACLPolicy(packet *packet.Packet) (report *policy.FlowPolicy, action *policy.FlowPolicy, err error)

NetworkACLPolicy retrieves the policy based on ACLs

func (*PUContext) NetworkACLPolicyFromAddr Uses

func (p *PUContext) NetworkACLPolicyFromAddr(addr net.IP, port uint16) (report *policy.FlowPolicy, action *policy.FlowPolicy, err error)

NetworkACLPolicyFromAddr retrieve the policy given an address and port.

func (*PUContext) RemoveApplicationACL Uses

func (p *PUContext) RemoveApplicationACL(addr net.IP, mask int)

RemoveApplicationACL removes the application ACLs which are indexed with (ip, mask) key

func (*PUContext) RetrieveCachedExternalFlowPolicy Uses

func (p *PUContext) RetrieveCachedExternalFlowPolicy(id string) (interface{}, error)

RetrieveCachedExternalFlowPolicy returns the policy for an external IP

func (*PUContext) Scopes Uses

func (p *PUContext) Scopes() []string

Scopes returns the scopes.

func (*PUContext) SearchRcvRules Uses

func (p *PUContext) SearchRcvRules(
    tags *policy.TagStore,
) (report *policy.FlowPolicy, packet *policy.FlowPolicy)

SearchRcvRules searches both receive and observed receive rules and returns the index and action

func (*PUContext) SearchTxtRules Uses

func (p *PUContext) SearchTxtRules(
    tags *policy.TagStore,
    skipRejectPolicies bool,
) (report *policy.FlowPolicy, packet *policy.FlowPolicy)

SearchTxtRules searches both receive and observed transmit rules and returns the index and action

func (*PUContext) SynServiceContext Uses

func (p *PUContext) SynServiceContext() []byte

SynServiceContext returns synServiceContext

func (*PUContext) TCPPorts Uses

func (p *PUContext) TCPPorts() []string

TCPPorts returns the PU TCP ports

func (*PUContext) Type Uses

func (p *PUContext) Type() common.PUType

Type return the pu type

func (*PUContext) UDPPorts Uses

func (p *PUContext) UDPPorts() []string

UDPPorts returns the PU UDP ports

func (*PUContext) UpdateApplicationACLs Uses

func (p *PUContext) UpdateApplicationACLs(rules policy.IPRuleList) error

UpdateApplicationACLs updates the application ACL policy

func (*PUContext) UpdateCachedTokenAndServiceContext Uses

func (p *PUContext) UpdateCachedTokenAndServiceContext(token []byte, serviceContext []byte)

UpdateCachedTokenAndServiceContext updates the local cached token

func (*PUContext) UpdateJWT Uses

func (p *PUContext) UpdateJWT(jwt string, expiration time.Time)

UpdateJWT updates the JWT and provides a new expiration date.

func (*PUContext) UpdateNetworkACLs Uses

func (p *PUContext) UpdateNetworkACLs(rules policy.IPRuleList) error

UpdateNetworkACLs updates the network ACL policy

func (*PUContext) UpdateSynServiceContext Uses

func (p *PUContext) UpdateSynServiceContext(synServiceContext []byte)

UpdateSynServiceContext updates the synServiceContext

func (*PUContext) Username Uses

func (p *PUContext) Username() string

Username returns the ID of the PU

Package pucontext imports 15 packages (graph) and is imported by 24 packages. Updated 2020-04-03. Refresh now. Tools for package owners.