当前位置: 首页>>代码示例>>Python>>正文


Python conf.layers方法代码示例

本文整理汇总了Python中config.conf.layers方法的典型用法代码示例。如果您正苦于以下问题:Python conf.layers方法的具体用法?Python conf.layers怎么用?Python conf.layers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config.conf的用法示例。


在下文中一共展示了conf.layers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mysummary

# 需要导入模块: from config import conf [as 别名]
# 或者: from config.conf import layers [as 别名]
def mysummary(self):
        """DEV: can be overloaded to return a string that summarizes the layer.
           Only one mysummary() is used in a whole packet summary: the one of the upper layer,
           except if a mysummary() also returns (as a couple) a list of layers whose
           mysummary() must be called if they are present."""
        return "" 
开发者ID:medbenali,项目名称:CyberScan,代码行数:8,代码来源:packet.py

示例2: bind_layers

# 需要导入模块: from config import conf [as 别名]
# 或者: from config.conf import layers [as 别名]
def bind_layers(lower, upper, __fval=None, **fval):
    """Bind 2 layers on some specific fields' values"""
    if __fval is not None:
        fval.update(__fval)
    bind_top_down(lower, upper, **fval)
    bind_bottom_up(lower, upper, **fval) 
开发者ID:medbenali,项目名称:CyberScan,代码行数:8,代码来源:packet.py

示例3: split_layers

# 需要导入模块: from config import conf [as 别名]
# 或者: from config.conf import layers [as 别名]
def split_layers(lower, upper, __fval=None, **fval):
    """Split 2 layers previously bound"""
    if __fval is not None:
        fval.update(__fval)
    split_bottom_up(lower, upper, **fval)
    split_top_down(lower, upper, **fval) 
开发者ID:medbenali,项目名称:CyberScan,代码行数:8,代码来源:packet.py

示例4: ls

# 需要导入模块: from config import conf [as 别名]
# 或者: from config.conf import layers [as 别名]
def ls(obj=None):
    """List  available layers, or infos on a given layer"""
    if obj is None:
        
        import __builtin__
        all = __builtin__.__dict__.copy()
        all.update(globals())
        objlst = sorted(conf.layers, key=lambda x:x.__name__)
        for o in objlst:
            print "%-10s : %s" %(o.__name__,o.name)
    else:
        if isinstance(obj, type) and issubclass(obj, Packet):
            for f in obj.fields_desc:
                print "%-10s : %-20s = (%s)" % (f.name, f.__class__.__name__,  repr(f.default))
        elif isinstance(obj, Packet):
            for f in obj.fields_desc:
                print "%-10s : %-20s = %-15s (%s)" % (f.name, f.__class__.__name__, repr(getattr(obj,f.name)), repr(f.default))
            if not isinstance(obj.payload, NoPayload):
                print "--"
                ls(obj.payload)
                

        else:
            print "Not a packet class. Type 'ls()' to list packet classes."


    
#############
## Fuzzing ##
############# 
开发者ID:medbenali,项目名称:CyberScan,代码行数:32,代码来源:packet.py


注:本文中的config.conf.layers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。