Commit c31bad81 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

in Packet added dimPacketHeader, dimPacketDataFieldHeader,...

in Packet added dimPacketHeader, dimPacketDataFieldHeader, dimPacketSourceDataFieldFixed, dimPacketTail, dimPacketStartingFixedPart and related methods
parent 8ad743c6
Loading
Loading
Loading
Loading
+79 −0
Original line number Diff line number Diff line
.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
.\"See Also:
.\"man mdoc.samples for a complete listing of options
.\"man mdoc for the short list of editing options
.\"/usr/share/misc/mdoc.template
.Dd 07/03/14               \" DATE 
.Dt PacketLib-doc 1      \" Program name and manual section number 
.Os Darwin
.Sh NAME                 \" Section Header - required - don't modify 
.Nm PacketLib-doc,
.\" The following lines are read in generating the apropos(man -k) database. Use only key
.\" words here as the database is built based on the words here and in the .ND line. 
.Nm Other_name_for_same_program(),
.Nm Yet another name for the same program.
.\" Use .Nm macro to designate other names for the documented program.
.Nd This line parsed for whatis database.
.Sh SYNOPSIS             \" Section Header - required - don't modify
.Nm
.Op Fl abcd              \" [-abcd]
.Op Fl a Ar path         \" [-a path] 
.Op Ar file              \" [file]
.Op Ar                   \" [file ...]
.Ar arg0                 \" Underlined argument - use .Ar anywhere to underline
arg2 ...                 \" Arguments
.Sh DESCRIPTION          \" Section Header - required - don't modify
Use the .Nm macro to refer to your program throughout the man page like such:
.Nm
Underlining is accomplished with the .Ar macro like this:
.Ar underlined text .
.Pp                      \" Inserts a space
A list of items with descriptions:
.Bl -tag -width -indent  \" Begins a tagged list 
.It item a               \" Each item preceded by .It macro
Description of item a
.It item b
Description of item b
.El                      \" Ends the list
.Pp
A list of flags and their descriptions:
.Bl -tag -width -indent  \" Differs from above in tag removed 
.It Fl a                 \"-a flag as a list item
Description of -a flag
.It Fl b
Description of -b flag
.El                      \" Ends the list
.Pp
.\" .Sh ENVIRONMENT      \" May not be needed
.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
.\" .It Ev ENV_VAR_1
.\" Description of ENV_VAR_1
.\" .It Ev ENV_VAR_2
.\" Description of ENV_VAR_2
.\" .El                      
.Sh FILES                \" File used or created by the topic of the man page
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
.It Pa /usr/share/file_name
FILE_1 description
.It Pa /Users/joeuser/Library/really_long_file_name
FILE_2 description
.El                      \" Ends the list
.\" .Sh DIAGNOSTICS       \" May not be needed
.\" .Bl -diag
.\" .It Diagnostic Tag
.\" Diagnostic informtion here.
.\" .It Diagnostic Tag
.\" Diagnostic informtion here.
.\" .El
.Sh SEE ALSO 
.\" List links in ascending order by section, alphabetically within a section.
.\" Please do not reference files that do not exist without filing a bug report
.Xr a 1 , 
.Xr b 1 ,
.Xr c 1 ,
.Xr a 2 ,
.Xr b 2 ,
.Xr a 3 ,
.Xr b 3 
.\" .Sh BUGS              \" Document known, unremedied bugs 
.\" .Sh HISTORY           \" Document history if command behaves in a unique manner
 No newline at end of file
+23 −4
Original line number Diff line number Diff line
@@ -138,10 +138,17 @@ public:

    virtual  char* printPacketOutputStream();

    
    /// Gets the dimension in byte of the current packet.
    /// Gets the dimension in byte of the current packet (header + datafield (data field header + sdf + tail)
    dword getDimension();

	/// Get dimension in bytes of the fixed part (without tail) = dim(header) + dim(data field header) + dim(source data field fixed)
	inline dword getDimensionFixedPart() { return dimPacketStartingFixedPart; };
    
	/// Get dimension of the prefix
	inline dword getDimensionPrefix() { return dimPrefix; };
	
	/// Get dimension of the tail
    inline dword getDimensionTail() { return dimPacketTail; };
	
    /// Gets the max dimension in byte of the packet.
    dword getMaxDimension();
@@ -262,8 +269,6 @@ protected:

    bool thereisprefix;

    word dimPrefix;

    /// The name of the file .packet that contains the structure of the packet
    char* filename;

@@ -281,6 +286,20 @@ private:

    bool first_output_stream_setted;
	
	///dimension in byte of the fixed part - calculated during the load
	dword dimPrefix;
	
	dword dimPacketHeader;
	
	dword dimPacketDataFieldHeader;
	
	dword dimPacketSourceDataFieldFixed;
	
	dword dimPacketTail;
	
	///dimPacketHeader + dimPacketDataFieldHeader + dimPacketSourceDataFieldFixed
	dword dimPacketStartingFixedPart;

};

}
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ public:
    /// Get the number of bytes of this part of packet.
    virtual dword getDimension();
	
	virtual dword getDimensionFixedPart() { return 0; };

    /// Get the number of bytes of a block.
    virtual dword getDimension(word block);

+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@ public:
    virtual dword getDimension();
	
	
	virtual dword getDimensionFixedPart() { return 0; };


    virtual dword getDimension(word nblock);


+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public:

    virtual dword getMaxDimension();
	
	virtual dword getDimensionFixedPart() { return PartOfPacket::getDimension(); };

};

}
Loading