Пример #1
0
class Filter(Model):
    device = Text(attr_name=Tc.Param.DEVICE, not_null=True)
    filter_id = Text(attr_name=Tc.Param.FILTER_ID)
    flowid = Text(attr_name=Tc.Param.FLOW_ID)
    protocol = Text(attr_name=Tc.Param.PROTOCOL)
    priority = Integer(attr_name=Tc.Param.PRIORITY)
    src_network = Text(attr_name=Tc.Param.SRC_NETWORK)
    dst_network = Text(attr_name=Tc.Param.DST_NETWORK)
    src_port = Integer(attr_name=Tc.Param.SRC_PORT)
    dst_port = Integer(attr_name=Tc.Param.DST_PORT)

    classid = Text(attr_name=Tc.Param.CLASS_ID)
    handle = Integer(attr_name=Tc.Param.HANDLE)
Пример #2
0
class SourceInfo(Model):
    source_id = Integer(not_null=True)
    dir_name = Text()
    base_name = Text(not_null=True)
    format_name = Text(not_null=True)
    dst_table = Text(not_null=True)
    size = Integer()
    mtime = Integer()

    def get_name(self, verbosity_level):
        if verbosity_level == 0 or self.dir_name is None:
            return self.base_name

        return os.path.join(self.dir_name, self.base_name)
Пример #3
0
class ShapingRuleModel(Model):
    device = Text(not_null=True)
    direction = Text(not_null=True)
    filter_id = Text(not_null=True)
    dst_network = Text()
    dst_port = Integer()
    src_network = Text()
    src_port = Integer()
    protocol = Text(not_null=True)

    delay = Text()
    delay_distro = Text()
    loss = Text()
    duplicate = Text()
    corrupt = Text()
    reorder = Text()
    rate = Text()
Пример #4
0
class Qdisc(Model):
    device = Text(attr_name=Tc.Param.DEVICE, not_null=True)
    direct_qlen = Integer()
    parent = Text(attr_name=Tc.Param.PARENT, not_null=True)
    handle = Text(attr_name=Tc.Param.HANDLE, not_null=True)
    delay = Text()
    delay_distro = Text(attr_name="delay-distro")
    loss = Text()
    duplicate = Text()
    corrupt = Text()
    reorder = Text()
    rate = Text()
Пример #5
0
class IfIndex(Model):
    host = Text(not_null=True)
    ifindex = Integer(primary_key=True)
    ifname = Text(not_null=True)
    peer_ifindex = Integer(not_null=True, unique=True)
Пример #6
0
class Sample(Model):
    foo_id = Integer(primary_key=True)
    name = Text(not_null=True, unique=True)
    value = Real(default=0)
Пример #7
0
class Hoge(Model):
    hoge_id = Integer()
    name = Text()
Пример #8
0
class Foo(Model):
    foo_id = Integer(not_null=True)
    name = Text(not_null=True)
    value = Real(not_null=True)
    blob = Blob()