Oliver Smith | 06455ea | 2019-11-20 10:56:35 +0100 | [diff] [blame^] | 1 | /* Copyright 2019 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 2 | * |
| 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | /*! \file mdns.h */ |
| 20 | |
| 21 | #pragma once |
| 22 | |
| 23 | #include <osmocom/core/msgb.h> |
| 24 | #include <osmocom/mslookup/mslookup.h> |
| 25 | |
| 26 | #define OSMO_MDNS_DOMAIN_SUFFIX_DEFAULT "mdns.osmocom.org" |
| 27 | |
| 28 | struct msgb *osmo_mdns_query_encode(void *ctx, uint16_t packet_id, const struct osmo_mslookup_query *query, |
| 29 | const char *domain_suffix); |
| 30 | |
| 31 | struct osmo_mslookup_query *osmo_mdns_query_decode(void *ctx, const uint8_t *data, size_t data_len, |
| 32 | uint16_t *packet_id, const char *domain_suffix); |
| 33 | |
| 34 | struct msgb *osmo_mdns_result_encode(void *ctx, uint16_t packet_id, const struct osmo_mslookup_query *query, |
| 35 | const struct osmo_mslookup_result *result, const char *domain_suffix); |
| 36 | |
| 37 | int osmo_mdns_result_decode(void *ctx, const uint8_t *data, size_t data_len, uint16_t *packet_id, |
| 38 | struct osmo_mslookup_query *query, struct osmo_mslookup_result *result, |
| 39 | const char *domain_suffix); |