Class: OsCtld::Devices::V2::Configurator

Inherits:
Configurator show all
Defined in:
lib/osctld/devices/v2/configurator.rb

Direct Known Subclasses

ContainerConfigurator, GroupConfigurator

Instance Attribute Summary collapse

Attributes inherited from Configurator

#owner

Instance Method Summary collapse

Methods inherited from Configurator

#add_device, #apply_changes, #dup, #initialize, #reconfigure, #remove_device

Constructor Details

This class inherits a constructor from OsCtld::Devices::Configurator

Instance Attribute Details

#prog_nameString (readonly)

Returns:

  • (String)


6
7
8
# File 'lib/osctld/devices/v2/configurator.rb', line 6

def prog_name
  @prog_name
end

Instance Method Details

#abs_cgroup_pathString (protected)

Returns absolute cgroup path.

Returns:

  • (String)

    absolute cgroup path

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/osctld/devices/v2/configurator.rb', line 20

def abs_cgroup_path
  raise NotImplementedError
end

#attach_prog(devices) ⇒ Object (protected)



24
25
26
27
28
29
30
31
# File 'lib/osctld/devices/v2/configurator.rb', line 24

def attach_prog(devices)
  @prog_name = Devices::V2::BpfProgramCache.set(
    owner.pool.name,
    devices,
    abs_cgroup_path,
    prog_name: @prog_name
  )
end

#cgroup_pathString (protected)

Returns relative cgroup path.

Returns:

  • (String)

    relative cgroup path

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/osctld/devices/v2/configurator.rb', line 15

def cgroup_path
  raise NotImplementedError
end

#get_prog(devices) ⇒ Object (protected)



33
34
35
# File 'lib/osctld/devices/v2/configurator.rb', line 33

def get_prog(devices)
  @prog_name = Devices::V2::BpfProgramCache.get_prog_name(devices)
end

#init(devices) ⇒ Object



8
9
10
# File 'lib/osctld/devices/v2/configurator.rb', line 8

def init(devices)
  get_prog(devices)
end