Changeset 3207

Show
Ignore:
Timestamp:
07/23/08 21:30:57 (5 years ago)
Author:
getxsick
Message:

Added new attribute Field.auto to get inform if the field value is autogenerated

Location:
branch/UMPA/umpa/protocols
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branch/UMPA/umpa/protocols/IP.py

    r3206 r3207  
    2525class HIHL(IntField): 
    2626    bits = 4 
     27    auto = True 
    2728    def generate_value(self): 
    2829        pass 
     
    3132class HTotalLength(Field): 
    3233    bits = 16 
     34    auto = True 
    3335    def fillout(self): 
    3436        pass 
     
    3638class HIdentification(Field): 
    3739    bits = 16 
     40    auto = True 
    3841    def fillout(self): 
    3942        pass 
     
    4144class HFragmentOffset(Field): 
    4245    bits = 13 
     46    auto = True 
    4347    def fillout(self): 
    4448        pass 
     
    4650class HProtocol(Field): 
    4751    bits = 8 
     52    auto = True 
    4853    def fillout(self): 
    4954        pass 
     
    5156class HHeaderChecksum(Field): 
    5257    bits = 16 
     58    auto = True 
    5359    def fillout(self): 
    5460        pass 
     
    5662class HPadding(Field): 
    5763    bits = 0 
     64    auto = True 
    5865    def fillout(self): 
    5966        pass 
     
    7885        flags = ('reserved', 'df', 'mf') 
    7986 
    80         fields_list = [ IntField("Version", 4, 4), HIHL("IHL"), 
     87        fields_list = [ IntField("Version", 4, 4, True), HIHL("IHL"), 
    8188                        Flags("TOS",tos), HTotalLength("Total Length"), 
    8289                        HIdentification("Identification"), 
  • branch/UMPA/umpa/protocols/_.py

    r3206 r3207  
    3333    like the one provided by Umit Project. 
    3434    """ 
    35  
    36     def __init__(self, name, value=None, bits=None): 
     35    auto = False 
     36    def __init__(self, name, value=None, bits=None, auto=None): 
    3737        self.name = name 
     38        if auto is not None: 
     39            self.auto = auto 
    3840 
    3941        if bits is not None: