Ejemplo n.º 1
0
class Node(enc.TlvModel):
    id = enc.UintField(TypeNumber.NODE_ID)
    parent = enc.UintField(TypeNumber.PARENT_ID)
    rule_name = enc.RepeatedField(enc.BytesField(TypeNumber.IDENTIFIER, is_string=True))
    v_edges = enc.RepeatedField(enc.ModelField(TypeNumber.VALUE_EDGE, ValueEdge))
    p_edges = enc.RepeatedField(enc.ModelField(TypeNumber.PATTERN_EDGE, PatternEdge))
    sign_cons = enc.RepeatedField(enc.UintField(TypeNumber.KEY_NODE_ID))
Ejemplo n.º 2
0
class ConstraintOption(enc.TlvModel):
    # Equal to a given NameComponent value
    value = enc.BytesField(TypeNumber.COMPONENT_VALUE)
    # Equal to another pattern
    tag = enc.UintField(TypeNumber.PATTERN_TAG)
    # Decide by a user function call
    fn = enc.ModelField(TypeNumber.USER_FN_CALL, UserFnCall)
Ejemplo n.º 3
0
class PushRequest(enc.TlvModel):
    ret_info = enc.ModelField(0x05, RefInfo)
    force = enc.BoolField(0x06)
Ejemplo n.º 4
0
class SyncUpdate(enc.TlvModel):
    ref_into = enc.RepeatedField(enc.ModelField(0x05, RefInfo))
Ejemplo n.º 5
0
class PatternEdge(enc.TlvModel):
    dest = enc.UintField(TypeNumber.NODE_ID)
    tag = enc.UintField(TypeNumber.PATTERN_TAG)
    cons_sets = enc.RepeatedField(enc.ModelField(TypeNumber.CONSTRAINT, PatternConstraint))
Ejemplo n.º 6
0
class PatternConstraint(enc.TlvModel):
    options = enc.RepeatedField(enc.ModelField(TypeNumber.CONS_OPTION, ConstraintOption))
Ejemplo n.º 7
0
class UserFnCall(enc.TlvModel):
    fn_id = enc.BytesField(TypeNumber.USER_FN_ID, is_string=True)
    args = enc.RepeatedField(enc.ModelField(TypeNumber.FN_ARGS, UserFnArg))
Ejemplo n.º 8
0
class LvsModel(enc.TlvModel):
    version = enc.UintField(TypeNumber.VERSION)
    start_id = enc.UintField(TypeNumber.NODE_ID)
    named_pattern_cnt = enc.UintField(TypeNumber.NAMED_PATTERN_NUM)
    nodes = enc.RepeatedField(enc.ModelField(TypeNumber.NODE, Node))
    symbols = enc.RepeatedField(enc.ModelField(TypeNumber.TAG_SYMBOL, TagSymbol))