2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Add mechanism for copernicus to request any confluent

This can be used for network debug in a generic way, to identify vlan adjacency without regard to nodedoploy state or uuid matching.
This commit is contained in:
Jarrod Johnson 2022-09-02 13:32:05 -04:00
parent 1c811dbf3e
commit 6c1f87aeb7
2 changed files with 9 additions and 0 deletions

View File

@ -129,6 +129,10 @@ int main(int argc, char* argv[]) {
inet_pton(AF_INET, "239.255.255.250", &dst4.sin_addr);
strncpy(msg, "M-SEARCH * HTTP/1.1\r\nST: urn:xcat.org:service:confluent:", 1024);
offset = strnlen(msg, 1024);
if (argc > 1 && strcmp(argv[1], "-a") == 0) {
strncpy(msg + offset, "/allconfluent=1", 1024 - offset);
offset = strnlen(msg, 1024);
}
add_confluent_uuid(msg + offset, 1024 - offset);
offset = strnlen(msg, 1024);
add_uuid(msg + offset, 1024 - offset);

View File

@ -218,6 +218,11 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None):
if curruuid != myuuid:
break
forcereply = True
elif query.startswith('allconfluent=1'):
reply = 'HTTP/1.1 200 OK\r\n\r\nCONFLUENT: PRESENT\r\n'
if not isinstance(reply, bytes):
reply = reply.encode('utf8')
s.sendto(reply, peer)
elif query.startswith('uuid='):
curruuid = query.split('=', 1)[1].lower()
node = uuidlookup(curruuid)