print out SRV record type as well

dev
LeRoyce Pearson 2024-03-03 23:05:45 -07:00
parent fc166b9ee9
commit ff7e3c70bf
1 changed files with 5 additions and 0 deletions

View File

@ -169,6 +169,11 @@ const JoinMultiplayerGame = struct {
const namestr = c.mdns_record_parse_ptr(data_ptr_opaque, data_len, record_offset, record_length, &namebuffer, namebuffer.len); const namestr = c.mdns_record_parse_ptr(data_ptr_opaque, data_len, record_offset, record_length, &namebuffer, namebuffer.len);
log.info("{?} : {s} {s} \"{}\"", .{ std_from, entrytype_str, recordtype_str, std.zig.fmtEscapes(namestr.str[0..namestr.length]) }); log.info("{?} : {s} {s} \"{}\"", .{ std_from, entrytype_str, recordtype_str, std.zig.fmtEscapes(namestr.str[0..namestr.length]) });
}, },
c.MDNS_RECORDTYPE_SRV => {
var strbuffer: [128]u8 = undefined;
const record = c.mdns_record_parse_srv(data_ptr_opaque, data_len, record_offset, record_length, &strbuffer, strbuffer.len);
log.info("{?} : {s} {s} \"{}\":{}", .{ std_from, entrytype_str, recordtype_str, std.zig.fmtEscapes(record.name.str[0..record.name.length]), record.port });
},
c.MDNS_RECORDTYPE_A => { c.MDNS_RECORDTYPE_A => {
var std_address: std.net.Ip4Address = undefined; var std_address: std.net.Ip4Address = undefined;
_ = c.mdns_record_parse_a(data_ptr_opaque, data_len, record_offset, record_length, @ptrCast(&std_address.sa)); _ = c.mdns_record_parse_a(data_ptr_opaque, data_len, record_offset, record_length, @ptrCast(&std_address.sa));