hashy is a distribute hashing-as-a-service server. It uses the results of hashing to direct traffic.
Summary should be a small paragraph explanation of what this project does.
This project and everyone participating in it are governed by the XMiDT Code Of Conduct. By participating, you agree to this Code.
hashy provides a low-level protocol for hashing multiple objects at once and checking which objects hash to a subject. All integral values are big-endian. Binary strings are represented as a single length octet followed by the octets in the string.
Hash requests concern subjects and objects. hashy assigns objects to subjects via distributed hashing. A subject is often a host name, while an object is often a MAC address or similar identifier. Subjects and objects are represented as binary strings.
Hash requests may refer to groups. Groups are simply named sets of subjects. Groups are represented as binary strings.
---
title: "Hash header"
---
packet
+16: "Magic number (0xA9F4)"
+8: "Version"
+16: "Message ID"
+1: "RS"
+1: "ERR"
+6: "Message Type"
+32: "Message length"
All hash messages are prefixed with the 16-bit value 0xA9F4.
Version holds the 8-bit protocol version. The initial version is 1.
A client can set a 16-bit identifier to uniquely identify a message. hashy will place this same identifier into the response message.
A single bit indicates whether this is a request or response. 0 is used for request, 1 for response.
This bit is set if the message represents an error.
Message types are 6-bit values that indicate the purpose and layout of the message.
| Value | Message Type | Request | Response |
|---|---|---|---|
| 000000 | Hash | One or more objects to hash, optionally filtered by group(s) | A map of objects to subjects. |
| 000001 | Check | A subject and multiple objects | A keep and a reject list of objects |
A 32-bit length integer concludes the header and specifies how many message bytes follow.
For all error responses, the message length will be set to 4 and the message will consist of a 4-octet error code.
---
title: "Hash Request"
---
packet
+8: "Group count (0 indicates no filtering by group)"
+16: "Groups"
+16: "Object count (must be at least 1)"
+16: "Objects"
---
title: "Hash Response"
---
packet
+16: "Count of object/subject/group entries"
+16: "Object (variable length)"
+16: "Subject (variable length)"
+16: "Group (variable length)"
---
title: "Check Request"
---
packet
+32: "Checksum"
+16: "Subject (variable length)"
+16: "Object count"
+16: "Objects (variable length)"
---
title: "Check Response"
---
packet
+32: "Checksum (possibly new)"
+16: "Subject (variable length, same as request)"
+16: "Reject count (only present if the request checksum was out of date)"
+16: "Objects (variable length)"
Add details here.
Refer to CONTRIBUTING.md.