Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Add source address to UAttributes (#102)
Browse files Browse the repository at this point in the history
* Add source address to UAttributes

#101

* remove unused import

* UAuthority cannot have ip and id, it is one or the other

* Remote unnecessary optional keywords
  • Loading branch information
Steven Hartley authored Feb 13, 2024
1 parent 5e6c78b commit 4ff5624
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
21 changes: 13 additions & 8 deletions uprotocol/uattributes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,43 @@ message UAttributes {
// Message type (publish, request, response)
UMessageType type = 2;

// The source (address) of the message. For published events this is the producers publish topic
// for requests it is the calling uE respose topic (who sent the request). For responses this is the
// method URI from the uService.
UUri source = 3;

// Destination UUri for a message used for unicast message types
// (notification, request, response)
optional UUri sink = 3;
UUri sink = 4;


// Message priority per
// https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/qos.adoc[uProtocol Prioritization]
UPriority priority = 4;
UPriority priority = 5;

// TTL is How long this message should live for after it was generated (in milliseconds).
// Event expires when:
// \$t_current > t_{id} + ttl\$
optional int32 ttl = 5;
optional int32 ttl = 6;

// Permission level per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions]
optional int32 permission_level = 6;
optional int32 permission_level = 7;

// Communication error attribute populated by uP-L2 dispatchers only when an error
// has occurred in the delivery of RPC request or response events.
// The contents of this attribute, if present, is the unsigned integer representation of
// UCode
optional int32 commstatus = 7;
optional int32 commstatus = 8;

// The correlation ID (UUDI) passed for response type messages to corelate the
// response to a request.
optional UUID reqid = 8;
UUID reqid = 9;

// Authorization token used for TAP per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions]
optional string token = 9;
optional string token = 10;

// Optional identifier used to correlate observability across related events
optional string traceparent = 10;
optional string traceparent = 11;
}


Expand Down
12 changes: 3 additions & 9 deletions uprotocol/umessage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@

import "uattributes.proto";
import "upayload.proto";
import "uri.proto";

option java_package = "org.eclipse.uprotocol.v1";
option java_outer_classname = "UMessageProto";
option java_multiple_files = true;

// UMessage is the top-level message type for the uProtocol.
// It contains a UUri, UAttributes, and UPayload and is a way of representing a
// It contains a header (UAttributes), and payload (UPayload) and is a way of representing a
// message that would be sent between two uEs.
message UMessage {
// The source (address) of the message. For published events this is the producers publish topic
// for requests it is the calling uE respose topic (who sent the request). For responses this is the
// method URI from the uService
UUri source = 1;

// uProtocol mandatory and optional attributes
UAttributes attributes = 2;
UAttributes attributes = 1;

// Optional message payload containing the data to be sent
UPayload payload = 3;
UPayload payload = 2;
}
8 changes: 5 additions & 3 deletions uprotocol/uri.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ message UUri {
// is local.
message UAuthority {
optional string name = 1; // Domain & device name as a string
optional bytes ip = 2; // IPv4 or IPv6 Address in byte format
optional bytes id = 3; // Unique ID for the device, could be a VIN, SHA 128, or any other identifier
// *NOTE:* MAX length is 255 bytes
oneof number {
bytes ip = 2; // IPv4 or IPv6 Address in byte format
bytes id = 3; // Unique ID for the device, could be a VIN, SHA 128, or any other identifier
// *NOTE:* MAX length is 255 bytes
}
}


Expand Down

0 comments on commit 4ff5624

Please sign in to comment.