github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/utils/cgnetcls/cgnetcls_osx.go (about)

     1  // +build darwin
     2  
     3  //Package cgnetcls implements functionality to manage classid for processes belonging to different cgroups
     4  package cgnetcls
     5  
     6  //Creategroup creates a cgroup/net_cls structure and writes the allocated classid to the file.
     7  //To add a new process to this cgroup we need to write to the cgroup file
     8  func (s *netCls) Creategroup(cgroupname string) error {
     9  	return nil
    10  }
    11  
    12  //AssignMark writes the mark value to net_cls.classid file.
    13  func (s *netCls) AssignMark(cgroupname string, mark uint64) error {
    14  	return nil
    15  }
    16  
    17  // AssignRootMark assings the value at the root.
    18  func (s *netCls) AssignRootMark(mark uint64) error {
    19  	return nil
    20  }
    21  
    22  //AddProcess adds the process to the net_cls group
    23  func (s *netCls) AddProcess(cgroupname string, pid int) error {
    24  	return nil
    25  }
    26  
    27  //RemoveProcess removes the process from the cgroup by writing the pid to the
    28  //top of net_cls cgroup cgroup.procs
    29  func (s *netCls) RemoveProcess(cgroupname string, pid int) error {
    30  	return nil
    31  }
    32  
    33  // DeleteCgroup removes the cgroup
    34  func (s *netCls) DeleteCgroup(cgroupname string) error {
    35  	return nil
    36  }
    37  
    38  func (s *netCls) Deletebasepath(contextID string) bool {
    39  	return true
    40  }
    41  
    42  func (s *netCls) GetCgroupList() {
    43  
    44  }
    45  
    46  // ListCgroupProcesses lists the processes of the cgroup
    47  func (s *netCls) ListCgroupProcesses(cgroupname string) ([]string, error) {
    48  	return []string{}, nil
    49  }
    50  
    51  // ListAllCgroups returns a list of the cgroups that are managed in the Trireme path
    52  func (s *netCls) ListAllCgroups(path string) []string {
    53  	return []string{}
    54  }
    55  
    56  //NewCgroupNetController returns a handle to call functions on the cgroup net_cls controller
    57  func NewCgroupNetController(triremepath string, releasePath string) Cgroupnetcls {
    58  	return &netCls{}
    59  }
    60  
    61  //NewDockerCgroupNetController returns a handle to call functions on the cgroup net_cls controller
    62  func NewDockerCgroupNetController() Cgroupnetcls {
    63  	return &netCls{}
    64  }
    65  
    66  // MarkVal returns a new Mark
    67  func MarkVal() uint64 {
    68  	return 103
    69  }