sd-icmp6-nd.c revision 06b643e7f5a3b79005dd57497897ab7255fe3659
/***
This file is part of systemd.
Copyright (C) 2014 Intel Corporation. All rights reserved.
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <string.h>
#include <stdbool.h>
#include "socket-util.h"
#include "refcnt.h"
#include "async.h"
#include "dhcp6-internal.h"
#include "sd-icmp6-nd.h"
#define ICMP6_MAX_ROUTER_SOLICITATIONS 3
enum icmp6_nd_state {
};
struct sd_icmp6_nd {
enum icmp6_nd_state state;
int event_priority;
int index;
struct ether_addr mac_addr;
int fd;
int nd_sent;
void *userdata;
};
#define log_icmp6_nd(p, fmt, ...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__, "ICMPv6 CLIENT: " fmt, ##__VA_ARGS__)
{
}
void *userdata) {
return 0;
}
return 0;
}
if (mac_addr)
else
return 0;
}
int r;
if (event)
else {
if (r < 0)
return 0;
}
return 0;
}
return 0;
}
}
return nd;
}
return 0;
}
}
return NULL;
}
if (!nd)
return -ENOMEM;
return 0;
}
{
struct nd_router_advert ra;
assert(s);
return 0;
return 0;
if (ra.nd_ra_code != 0)
return 0;
"none",
"none");
return 0;
}
void *userdata)
{
struct ether_addr unset = { };
int r;
assert(s);
} else {
if (r < 0)
else {
}
if (r < 0) {
icmp6_nd_notify(nd, r);
return 0;
}
next_timeout, 0,
if (r < 0) {
icmp6_nd_notify(nd, r);
return 0;
}
nd->event_priority);
if (r < 0) {
icmp6_nd_notify(nd, r);
return 0;
}
if (r < 0) {
icmp6_nd_notify(nd, r);
return 0;
}
}
return 0;
}
return 0;
}
int r;
return -EINVAL;
return -EINVAL;
if (r < 0)
return r;
if (r < 0)
goto error;
if (r < 0)
goto error;
if (r < 0)
goto error;
0, 0, icmp6_router_solicitation_timeout, nd);
if (r < 0)
goto error;
if (r < 0)
goto error;
if (r < 0)
else
return r;
}