]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-network/arp-util.h
arp-util: use struct in_addr
[thirdparty/systemd.git] / src / libsystemd-network / arp-util.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
5c1d3fc9
UTL
2#pragma once
3
4/***
810adae9 5 Copyright © 2014 Axis Communications AB. All rights reserved.
5c1d3fc9
UTL
6***/
7
ae695a9e 8#include <net/ethernet.h>
ecad63f8 9#include <netinet/in.h>
5c1d3fc9 10
5c1d3fc9 11#include "socket-util.h"
71d35b6b 12#include "sparse-endian.h"
5c1d3fc9 13
ecad63f8 14int arp_network_bind_raw_socket(int index, const struct in_addr *a, const struct ether_addr *eth_mac);
5c1d3fc9 15
e1a3915b
YW
16int arp_send_packet(
17 int fd,
18 int ifindex,
ecad63f8 19 const struct in_addr *pa,
e1a3915b
YW
20 const struct ether_addr *ha,
21 bool announce);
22static inline int arp_send_probe(
23 int fd,
24 int ifindex,
ecad63f8 25 const struct in_addr *pa,
e1a3915b
YW
26 const struct ether_addr *ha) {
27 return arp_send_packet(fd, ifindex, pa, ha, false);
28}
29static inline int arp_send_announcement(
30 int fd,
31 int ifindex,
ecad63f8 32 const struct in_addr *pa,
e1a3915b
YW
33 const struct ether_addr *ha) {
34 return arp_send_packet(fd, ifindex, pa, ha, true);
35}