URL
https://opencores.org/ocsvn/nocmodel/nocmodel/trunk
Subversion Repositories nocmodel
[/] [nocmodel/] [trunk/] [doc/] [nocmodel.basicmodels.basic_protocol.html] - Rev 2
Compare with Previous | Blame | View Log
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: class basic_protocol</title> </head><body bgcolor="#f0f0f8"> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><strong>nocmodel.basicmodels.basic_protocol</strong> = <a name="nocmodel.basicmodels.basic_protocol">class basic_protocol</a>(<a href="nocmodel.noc_base.html#protocol">nocmodel.noc_base.protocol</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Basic protocol class<br> <br> This class simplify protocol object creation. It defines a simple packet<br> with the following fields:<br> <br> |0 7|8 15|16 31|<br> | src | dst | data |<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="nocmodel.basicmodels.basic_protocol.html#basic_protocol">basic_protocol</a></dd> <dd><a href="nocmodel.noc_base.html#protocol">nocmodel.noc_base.protocol</a></dd> <dd><a href="nocmodel.noc_base.html#nocobject">nocmodel.noc_base.nocobject</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="basic_protocol-__init__"><strong>__init__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="nocmodel.noc_base.html#protocol">nocmodel.noc_base.protocol</a>:<br> <dl><dt><a name="basic_protocol-get_protocol_ref"><strong>get_protocol_ref</strong></a>(self)</dt></dl> <dl><dt><a name="basic_protocol-newpacket"><strong>newpacket</strong></a>(self, zerodefault<font color="#909090">=True</font>, *args, **kwargs)</dt><dd><tt>Return a new packet with all required fields.<br> <br> Arguments:<br> * zerodefault: If True, all missing fields will be zeroed by default.<br> If False, a missing value in arguments will throw an exception.<br> * args: Nameless arguments will add field values based on packet field<br> order.<br> * kwargs: Key-based arguments will add specified field values based in <br> its keys<br> <br> Notes: <br> * kwargs takes precedence over args: i.e. named arguments can overwrite<br> nameless arguments.</tt></dd></dl> <dl><dt><a name="basic_protocol-register_packet_generator"><strong>register_packet_generator</strong></a>(self, packet_class)</dt><dd><tt>Register a special packet generator class.<br> <br> Must be a derived class of packet</tt></dd></dl> <dl><dt><a name="basic_protocol-update_packet_field"><strong>update_packet_field</strong></a>(self, name, type, bitlen, description<font color="#909090">=''</font>)</dt><dd><tt>Add or update a packet field.<br> <br> Arguments<br> * name<br> * type: string that can be "int", "fixed" or "float"<br> * bitlen: bit length of this field<br> * description: optional description of this field<br> <br> Notes: <br> * Each new field will be added at the end.</tt></dd></dl> </td></tr></table> </body></html>