Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9eeeca569be75ba1d81f8aabfb772ef5c484b0fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;

/**
 * A class to represent a data packet. This abstract class just has all of the
 * common fields and associated get-methods.
 * 
 * @author patrickm
 * 
 */
public abstract class DMPacket {

	// TODO?: replace with java enums

	// header ID
	protected final int BEGINSTR = 0xa1b2c3d4;
	public int packetsize;

	// common packet fields
	protected int clientID;
	protected int size;
	protected int scriptID;
	protected String filename;

	/**
	 * Return the client ID number from this packet. This needs to be included
	 * in all outgoing packets (so the DM can tell who is sending what).
	 * 
	 * @return The clientID of this packet.
	 */
	public int getclientID() {
		return clientID;
	}
	/**
	 * Return the filename from this packet. This needs to be included
	 * in all outgoing packets (so the DM can tell who is sending what).
	 * 
	 * @return The filename.
	 */
	
	public String getfilename() {
		return filename;
	}

	/**
	 * Return the script number of this packet. Consult the data manager package
	 * for what these map to.
	 * 
	 * @return The script number of this packet.
	 */
	public int getscriptID() {
		return scriptID;
	}

	/**
	 * Return the size field of this packet. This is not the size of the packet
	 * but the size of the following stream. All request packets this will be
	 * zero, most response packets will be non negative.
	 * 
	 * @return The size in bytes of this packets "size" field
	 */
	public int getsize() {
		return size;
	}

}

Back to the top