Oliver Smith | 3a9f267 | 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 | #pragma once |
| 20 | #include <netdb.h> |
| 21 | #include <osmocom/core/msgb.h> |
| 22 | #include <osmocom/core/select.h> |
| 23 | |
| 24 | struct osmo_mdns_sock { |
| 25 | struct osmo_fd osmo_fd; |
| 26 | struct addrinfo *ai; |
| 27 | }; |
| 28 | |
| 29 | struct osmo_mdns_sock *osmo_mdns_sock_init(void *ctx, const char *ip, unsigned int port, |
| 30 | int (*cb)(struct osmo_fd *fd, unsigned int what), |
| 31 | void *data, unsigned int priv_nr); |
| 32 | int osmo_mdns_sock_send(const struct osmo_mdns_sock *mdns_sock, struct msgb *msg); |
| 33 | void osmo_mdns_sock_cleanup(struct osmo_mdns_sock *mdns_sock); |