Lines Matching defs:hello

1 /*	$OpenBSD: hello.c,v 1.27 2024/08/21 15:18:00 florian Exp $ */
36 /* hello packet handling */
41 struct hello_hdr hello;
73 /* hello header */
74 hello.mask = iface->mask.s_addr;
75 hello.hello_interval = htons(iface->hello_interval);
76 hello.opts = area_ospf_options(iface->area);
77 hello.rtr_priority = iface->priority;
78 hello.rtr_dead_interval = htonl(iface->dead_interval);
81 hello.d_rtr = iface->dr->addr.s_addr;
84 hello.d_rtr = 0;
86 hello.bd_rtr = iface->bdr->addr.s_addr;
89 hello.bd_rtr = 0;
91 if (ibuf_add(buf, &hello, sizeof(hello)))
120 struct hello_hdr hello;
125 if (len < sizeof(hello) || (len & 0x03)) {
131 memcpy(&hello, buf, sizeof(hello));
132 buf += sizeof(hello);
133 len -= sizeof(hello);
137 if (hello.mask != iface->mask.s_addr) {
143 if (ntohs(hello.hello_interval) != iface->hello_interval) {
144 log_warnx("recv_hello: invalid hello-interval %d, "
145 "interface %s", ntohs(hello.hello_interval),
150 if (ntohl(hello.rtr_dead_interval) != iface->dead_interval) {
152 "interface %s", ntohl(hello.rtr_dead_interval),
157 if ((hello.opts & OSPF_OPTION_E && iface->area->stub) ||
158 ((hello.opts & OSPF_OPTION_E) == 0 && !iface->area->stub)) {
165 * Match router-id, in case of conflict moan and ignore hello.
189 nbr->dr.s_addr = hello.d_rtr;
190 nbr->bdr.s_addr = hello.bd_rtr;
191 nbr->priority = hello.rtr_priority;
206 nbr->options = hello.opts;
227 nbr->dr.s_addr = hello.d_rtr;
228 nbr->bdr.s_addr = hello.bd_rtr;
229 nbr->priority = hello.rtr_priority;
233 if (nbr->priority != hello.rtr_priority) {
234 nbr->priority = hello.rtr_priority;
239 hello.d_rtr == nbr->addr.s_addr && hello.bd_rtr == 0)
242 if (iface->state & IF_STA_WAITING && hello.bd_rtr == nbr->addr.s_addr) {
248 if (hello.d_rtr == dr->addr.s_addr &&
254 nbr->addr.s_addr != hello.d_rtr) ||
256 nbr->addr.s_addr == hello.d_rtr))
260 nbr->addr.s_addr != hello.bd_rtr) ||
262 nbr->addr.s_addr == hello.bd_rtr))
266 nbr->dr.s_addr = hello.d_rtr;
267 nbr->bdr.s_addr = hello.bd_rtr;