package me.haosdent.cgroup.subsystem;

import me.haosdent.cgroup.manage.Group;
import me.haosdent.cgroup.util.Constants;

public class NetCls extends Common {

  public static final int subsystem = Constants.SUBSYS_NET_CLS;

  public NetCls(Group group) {
    super(group);
  }

  public void setClassId() {}

  public void getClassId() {}
}

@@ -115,16 +115,45 @@
 tants;%0A%0A
+import java.io.IOException;%0A%0A
 public c
@@ -208,25 +208,22 @@
 nal int 
-subsystem
+SUBSYS
  = Const
@@ -247,91 +247,652 @@
 LS;%0A
-%0A  public NetCls(Group group) %7B%0A    super(group);%0A  %7D%0A%0A  public void setClassId() %7B
+  public static final String PROP_NET_CLS_CLASSID = %22net_cls.classid%22;%0A%0A  public NetCls(Group group) %7B%0A    super(group);%0A  %7D%0A%0A  private StringBuilder toHex(int num) %7B%0A    String hex = Integer.toHexString(num);%0A    StringBuilder sb = new StringBuilder();%0A    int l = hex.length();%0A    if (l %3E 4) %7B%0A      hex = hex.substring(l - 4 - 1, l);%0A    %7D%0A    for (; l %3C 4; l++) %7B%0A      sb.append('0');%0A    %7D%0A    sb.append(hex);%0A    return sb;%0A  %7D%0A%0A  public void setClassId(int major, int minor) throws IOException %7B%0A    StringBuilder sb = toHex(major);%0A    sb.append(toHex(minor));%0A    shell.cgset(group.getName(), PROP_NET_CLS_CLASSID, sb.toString());%0A  
 %7D%0A%0A 
@@ -899,20 +899,21 @@
  public 
-void
+int%5B%5D
  getClas
@@ -918,13 +918,299 @@
 assId() 
-%7B
+throws IOException %7B%0A    String result = shell.cgget(group.getName(), PROP_NET_CLS_CLASSID);%0A    int major = Integer.getInteger(result.substring(2, 2 + 4), 16);%0A    int minor = Integer.getInteger(result.substring(6, 6 + 4), 16);%0A    int%5B%5D classId = %7Bmajor, minor%7D;%0A    return classId;%0A  
 %7D%0A%7D%0A

Implement methods in NetCls.java