mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr.git
				synced 2025-11-03 21:53:30 +00:00 
			
		
		
		
	osmo_mdns_rfc_record/question_encode: remove ctx
Remove the ctx argument to both functions, as it's not used anymore. Related: OS#5821 Change-Id: I5e3dd18bf08f7aa42f49c262e13250778ea0c6a2
This commit is contained in:
		@@ -102,9 +102,9 @@ struct osmo_mdns_rfc_record {
 | 
				
			|||||||
void osmo_mdns_rfc_header_encode(struct msgb *msg, const struct osmo_mdns_rfc_header *hdr);
 | 
					void osmo_mdns_rfc_header_encode(struct msgb *msg, const struct osmo_mdns_rfc_header *hdr);
 | 
				
			||||||
int osmo_mdns_rfc_header_decode(const uint8_t *data, size_t data_len, struct osmo_mdns_rfc_header *hdr);
 | 
					int osmo_mdns_rfc_header_decode(const uint8_t *data, size_t data_len, struct osmo_mdns_rfc_header *hdr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int osmo_mdns_rfc_question_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_question *qst);
 | 
					int osmo_mdns_rfc_question_encode(struct msgb *msg, const struct osmo_mdns_rfc_question *qst);
 | 
				
			||||||
struct osmo_mdns_rfc_question *osmo_mdns_rfc_question_decode(void *ctx, const uint8_t *data, size_t data_len);
 | 
					struct osmo_mdns_rfc_question *osmo_mdns_rfc_question_decode(void *ctx, const uint8_t *data, size_t data_len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int osmo_mdns_rfc_record_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_record *rec);
 | 
					int osmo_mdns_rfc_record_encode(struct msgb *msg, const struct osmo_mdns_rfc_record *rec);
 | 
				
			||||||
struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_t *data, size_t data_len,
 | 
					struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_t *data, size_t data_len,
 | 
				
			||||||
							 size_t *record_len);
 | 
												 size_t *record_len);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@ int osmo_mdns_msg_request_encode(void *ctx, struct msgb *msg, const struct osmo_
 | 
				
			|||||||
	qst.domain = req->domain;
 | 
						qst.domain = req->domain;
 | 
				
			||||||
	qst.qtype = req->type;
 | 
						qst.qtype = req->type;
 | 
				
			||||||
	qst.qclass = OSMO_MDNS_RFC_CLASS_IN;
 | 
						qst.qclass = OSMO_MDNS_RFC_CLASS_IN;
 | 
				
			||||||
	if (osmo_mdns_rfc_question_encode(ctx, msg, &qst) != 0)
 | 
						if (osmo_mdns_rfc_question_encode(msg, &qst) != 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
@@ -106,7 +106,7 @@ int osmo_mdns_msg_answer_encode(void *ctx, struct msgb *msg, const struct osmo_m
 | 
				
			|||||||
		rec.rdlength = ans_record->length;
 | 
							rec.rdlength = ans_record->length;
 | 
				
			||||||
		rec.rdata = ans_record->data;
 | 
							rec.rdata = ans_record->data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (osmo_mdns_rfc_record_encode(ctx, msg, &rec) != 0)
 | 
							if (osmo_mdns_rfc_record_encode(msg, &rec) != 0)
 | 
				
			||||||
			return -EINVAL;
 | 
								return -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,7 +69,7 @@ int osmo_mdns_rfc_header_decode(const uint8_t *data, size_t data_len, struct osm
 | 
				
			|||||||
/*! Encode question section (RFC 1035 4.1.2).
 | 
					/*! Encode question section (RFC 1035 4.1.2).
 | 
				
			||||||
 * \param[in] msgb  mesage buffer to which the encoded data will be appended.
 | 
					 * \param[in] msgb  mesage buffer to which the encoded data will be appended.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int osmo_mdns_rfc_question_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_question *qst)
 | 
					int osmo_mdns_rfc_question_encode(struct msgb *msg, const struct osmo_mdns_rfc_question *qst)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	uint8_t *buf;
 | 
						uint8_t *buf;
 | 
				
			||||||
	size_t buf_len;
 | 
						size_t buf_len;
 | 
				
			||||||
@@ -125,7 +125,7 @@ error:
 | 
				
			|||||||
/*! Encode one resource record (RFC 1035 4.1.3).
 | 
					/*! Encode one resource record (RFC 1035 4.1.3).
 | 
				
			||||||
 * \param[in] msgb  mesage buffer to which the encoded data will be appended.
 | 
					 * \param[in] msgb  mesage buffer to which the encoded data will be appended.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int osmo_mdns_rfc_record_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_record *rec)
 | 
					int osmo_mdns_rfc_record_encode(struct msgb *msg, const struct osmo_mdns_rfc_record *rec)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	uint8_t *buf;
 | 
						uint8_t *buf;
 | 
				
			||||||
	size_t buf_len;
 | 
						size_t buf_len;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -147,7 +147,7 @@ void test_enc_dec_rfc_question(void *ctx)
 | 
				
			|||||||
		struct msgb *msg = msgb_alloc(4096, "dns_test");
 | 
							struct msgb *msg = msgb_alloc(4096, "dns_test");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		PRINT_QST(&in, "in");
 | 
							PRINT_QST(&in, "in");
 | 
				
			||||||
		assert(osmo_mdns_rfc_question_encode(ctx, msg, &in) == 0);
 | 
							assert(osmo_mdns_rfc_question_encode(msg, &in) == 0);
 | 
				
			||||||
		fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg)));
 | 
							fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg)));
 | 
				
			||||||
		out = osmo_mdns_rfc_question_decode(ctx, msgb_data(msg), msgb_length(msg));
 | 
							out = osmo_mdns_rfc_question_decode(ctx, msgb_data(msg), msgb_length(msg));
 | 
				
			||||||
		assert(out);
 | 
							assert(out);
 | 
				
			||||||
@@ -211,7 +211,7 @@ void test_enc_dec_rfc_record(void *ctx)
 | 
				
			|||||||
		size_t record_len;
 | 
							size_t record_len;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		PRINT_REC(&in, "in");
 | 
							PRINT_REC(&in, "in");
 | 
				
			||||||
		assert(osmo_mdns_rfc_record_encode(ctx, msg, &in) == 0);
 | 
							assert(osmo_mdns_rfc_record_encode(msg, &in) == 0);
 | 
				
			||||||
		fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg)));
 | 
							fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg)));
 | 
				
			||||||
		out = osmo_mdns_rfc_record_decode(ctx, msgb_data(msg), msgb_length(msg), &record_len);
 | 
							out = osmo_mdns_rfc_record_decode(ctx, msgb_data(msg), msgb_length(msg), &record_len);
 | 
				
			||||||
		fprintf(stderr, "record_len: %lu\n", record_len);
 | 
							fprintf(stderr, "record_len: %lu\n", record_len);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user