throttlenet.lc 1.83 KB
Newer Older
Sven Robertz's avatar
Sven Robertz committed
1
2
3
4
5
6
7
8
typedef short number_t; // placeholder for protocol buffers like encoding
typedef byte[6] eth_addr;

// *** Service registration,  lookup, and channel allocation

typedef struct { 
	string creatorId;
	string svcId;
Sven Robertz's avatar
Sven Robertz committed
9
10
11
	int version;		//unique
	string versionName;	//human readable
} serviceID; // Should probably be a PalCom[_]like struct
Sven Robertz's avatar
Sven Robertz committed
12
13
14

typedef struct {
	string key;
Sven Robertz's avatar
Sven Robertz committed
15
	byte value[[_]];
Sven Robertz's avatar
Sven Robertz committed
16
17
18
19
} property_t; // used for type info, grounding, etc.

typedef struct {
	string name;
Sven Robertz's avatar
Sven Robertz committed
20
21
	property_t properties[[_]];
	param_t params[[_]];
Sven Robertz's avatar
Sven Robertz committed
22
23
24
25
} command_t;

typedef struct {
	string name;
Sven Robertz's avatar
Sven Robertz committed
26
	property_t properties[[_]];
Sven Robertz's avatar
Sven Robertz committed
27
28
29
30
31
} param_t;

typedef struct {
	servicID svcID;
	string   name;
Sven Robertz's avatar
Sven Robertz committed
32
33
        command_t commands[[_]];
	byte data_description[[_]];
Sven Robertz's avatar
Sven Robertz committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
} serviceDescription; // d:o PalCom

typedef struct {
	eth_addr device; // or more generic, as in PalCom?
	serviceID svcID;
	number_t  instanceID;
	string instance_name;
} service_instance;

sample struct {
	service_instance svc;
	number_t chnID;   // the channel to use for connecting to the service
} service_register;

sample boolean ack;

sample struct {
} services_query;

sample struct {
Sven Robertz's avatar
Sven Robertz committed
54
	service_instance svcs[[_]]
Sven Robertz's avatar
Sven Robertz committed
55
56
57
58
59
60
61
} services_list;

sample struct {
	service_instance svc;
	number_t bytes_per_period;
	float periodtime; // in seconds  // or number_t microseconds?
	// importance?
Sven Robertz's avatar
Sven Robertz committed
62
} service_allocate_channel; // client [_]> GlobeThrottle to request connection
Sven Robertz's avatar
Sven Robertz committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

sample struct {
	// requesting service instance?
	number_t chnId; // the channel to send the connect message on
} service_channel_ACK;

sample struct {
	float max_utilization;
	// min period?
} service_channel_NACK;


// *** service to service connection negotiation

typedef struct {
	number_t sender_chnId; // The chnID at the sender's side that will receive the response, and subsequent traffic;
} connect_t;


sample connect_t connect_request;
sample connect_t connect_response;