freebsd-src/usr.sbin/ndp/ndp.h
R. Christian McDonald 934a24e55a ndp: improve -c and -d handling in ndp_netlink
This patch restores/fixes some of the behavior present in pre-netlink ndp(8).

 1. Deleting a local address now correctly returns EPERM (instead of
    ENOENT)
 2. ndp -c no longer dumps the entire table while complaining about
    local addresses
 3. Return exit code when deleting entry (e.g. trying ndp -d on a local
    address is an error)

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42316
2023-10-23 22:58:29 +02:00

28 lines
655 B
C

#ifndef _USR_SBIN_NDP_NDP_H_
#define _USR_SBIN_NDP_NDP_H_
#define W_ADDR 36
#define W_LL 17
#define W_IF 6
struct ndp_opts {
bool nflag;
bool tflag;
int flags;
time_t expire_time;
};
extern struct ndp_opts opts;
bool valid_type(int if_type);
void ts_print(const struct timeval *tvp);
char *ether_str(struct sockaddr_dl *sdl);
char *sec2str(time_t total);
int getaddr(char *host, struct sockaddr_in6 *sin6);
int print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag);
int delete_nl(uint32_t ifindex, char *host, bool warn);
int set_nl(uint32_t ifindex, struct sockaddr_in6 *dst, struct sockaddr_dl *sdl,
char *host);
#endif