Lines Matching defs:ospf_hdr
40 struct ospf_hdr *, u_int16_t, const struct iface *);
48 struct ospf_hdr ospf_hdr;
50 bzero(&ospf_hdr, sizeof(ospf_hdr));
51 ospf_hdr.version = OSPF_VERSION;
52 ospf_hdr.type = type;
53 ospf_hdr.rtr_id = ospfe_router_id();
55 ospf_hdr.area_id = iface->area->id.s_addr;
56 ospf_hdr.auth_type = htons(iface->auth_type);
58 return (ibuf_add(buf, &ospf_hdr, sizeof(ospf_hdr)));
121 struct ospf_hdr *ospf_hdr;
201 if (len < sizeof(*ospf_hdr)) {
205 ospf_hdr = (struct ospf_hdr *)buf;
207 if ((l = ospf_hdr_sanity_check(&ip_hdr, ospf_hdr, len, iface)) == -1)
210 nbr = nbr_find_id(iface, ospf_hdr->rtr_id);
211 if (ospf_hdr->type != PACKET_TYPE_HELLO && nbr == NULL) {
227 buf += sizeof(*ospf_hdr);
228 len = l - sizeof(*ospf_hdr);
231 switch (ospf_hdr->type) {
244 recv_hello(iface, ip_hdr.ip_src, ospf_hdr->rtr_id, buf, len);
281 ospf_hdr_sanity_check(const struct ip *ip_hdr, struct ospf_hdr *ospf_hdr,
286 if (ospf_hdr->version != OSPF_VERSION) {
288 ospf_hdr->version);
292 if (ntohs(ospf_hdr->len) > len ||
293 len <= sizeof(struct ospf_hdr)) {
295 ntohs(ospf_hdr->len));
300 if (ospf_hdr->area_id != iface->area->id.s_addr) {
301 addr.s_addr = ospf_hdr->area_id;
307 if (ospf_hdr->area_id != 0) {
308 addr.s_addr = ospf_hdr->area_id;
326 return (ntohs(ospf_hdr->len));