Lines Matching defs:packet
736 /* Dump RIP packet */
738 rip_packet_dump (struct rip_packet *packet, int size, char *sndrcv)
748 if (packet->command > 0 && packet->command < RIP_COMMAND_MAX)
749 command_str = lookup (rip_msg, packet->command);
754 /* Dump packet header. */
755 zlog_info ("%s %s version %d packet size %d",
756 sndrcv, command_str, packet->version, size);
760 rte = packet->rte;
762 for (lim = (caddr_t) packet + size; (caddr_t) rte < lim; rte++)
764 if (packet->version == RIPv2)
782 md5 = (struct rip_md5_info *) &packet->rte;
787 zlog_info (" RIP-2 packet len %d Key ID %d"
912 rip_auth_md5 (struct rip_packet *packet, struct sockaddr_in *from,
932 md5 = (struct rip_md5_info *) &packet->rte;
962 md5data = (struct rip_md5_data *)(((u_char *) packet) + packet_len);
972 md5_process_bytes (packet, packet_len + md5->auth_len, &ctx);
1021 /* Get packet length. */
1024 /* Check packet length. */
1028 zlog_err ("rip_auth_md5_set(): packet length %ld is less than minimum length.", len);
1077 /* Generate a digest for the RIP packet. */
1085 /* Copy the digest to the packet. */
1092 rip_response_process (struct rip_packet *packet, int size,
1130 rip_peer_update (from, packet->version);
1134 rte = packet->rte;
1136 for (lim = (caddr_t) packet + size; (caddr_t) rte < lim; rte++)
1142 /* If the packet gets here it means authentication enabled */
1144 if (packet->version == RIPv2 &&
1145 rte == packet->rte &&
1184 if (packet->version == RIPv1 && rte->nexthop.s_addr != 0)
1187 zlog_info ("RIPv1 packet with nexthop value %s",
1198 if (packet->version == RIPv2 && rte->nexthop.s_addr != 0)
1229 zlog_info ("Next hop %s is on RIP network. Set nexthop to the packet's originator", inet_ntoa (rte->nexthop));
1263 (/16 for class B's) except when the RIP packet does to inside
1266 if ((packet->version == RIPv1 && rte->prefix.s_addr != 0)
1267 || (packet->version == RIPv2
1294 if ((packet->version == RIPv2)
1307 if (packet->version == RIPv2
1323 /* RIP packet send to destination address. */
1377 zlog_warn ("can't send packet : %s", strerror (errno));
1381 printf("can't send packet : %s", strerror (errno));
1497 rip_request_process (struct rip_packet *packet, int size,
1515 rip_peer_update (from, packet->version);
1518 lim = ((caddr_t) packet) + size;
1519 rte = packet->rte;
1535 rip_output_process (ifp, from, rip_all_route, packet->version);
1565 packet->command = RIP_RESPONSE;
1567 rip_send_packet ((caddr_t) packet, size, from, ifp);
1573 /* Set IPv6 packet info to the socket. */
1588 /* Read RIP packet by recvmsg function. */
1624 /* RIP packet read function. */
1638 /* Read RIP packet. */
1643 zlog_warn ("Can't read RIP packet: %s", strerror (errno));
1652 /* First entry point of RIP packet. */
1660 struct rip_packet *packet;
1687 /* Check is this packet comming from myself? */
1692 zlog_warn ("ignore packet comes from myself");
1697 /* Which interface is this packet comes from. */
1700 /* RIP packet received */
1704 zlog_info ("RECV packet from %s port %d on %s",
1709 /* If this packet come from unknown interface, ignore it. */
1713 zlog_info ("packet comes from unknown interface");
1722 zlog_warn ("packet size %d is smaller than minimum size %d",
1731 zlog_warn ("packet size %d is larger than max size %d",
1742 zlog_warn ("packet size %d is wrong for RIP packet alignment", len);
1752 packet = &rip_buf.rip_packet;
1755 if (packet->version == 0)
1758 zlog_info ("version 0 with command %d received.", packet->command);
1765 /* Dump RIP packet. */
1767 rip_packet_dump (packet, len, "RECV");
1773 packet should be treated as RIPv1 ignoring must be zero field. */
1774 if (packet->version > RIPv2)
1775 packet->version = RIPv2;
1790 if (packet->command == RIP_RESPONSE)
1794 if (packet->version != rip->version)
1798 zlog_warn (" packet's v%d doesn't fit to my version %d",
1799 packet->version, rip->version);
1807 if (packet->version == RIPv1)
1812 zlog_warn (" packet's v%d doesn't fit to if version spec",
1813 packet->version);
1818 if (packet->version == RIPv2)
1823 zlog_warn (" packet's v%d doesn't fit to if version spec",
1824 packet->version);
1838 && (packet->version == RIPv2) && (packet->rte->family == 0xffff))
1842 zlog_warn ("packet RIPv%d is dropped because authentication disabled",
1843 packet->version);
1864 if (packet->version == RIPv1 && packet->rte->family == 0xffff)
1868 zlog_warn ("packet RIPv%d is dropped because authentication enabled", packet->version);
1875 if (packet->version == RIPv2)
1877 if (packet->rte->family == 0xffff)
1879 if (ntohs (packet->rte->tag) == RIP_AUTH_SIMPLE_PASSWORD)
1881 ret = rip_auth_simple_password (packet->rte, &from, ifp);
1899 else if (ntohs (packet->rte->tag) == RIP_AUTH_MD5)
1901 ret = rip_auth_md5 (packet, &from, ifp);
1918 /* Reset RIP packet length to trim MD5 data. */
1926 ntohs (packet->rte->tag));
1934 /* There is no authentication in the packet. */
1939 zlog_warn ("RIPv2 authentication failed: no authentication in packet");
1950 switch (packet->command)
1953 rip_response_process (packet, len, &from, ifp);
1957 rip_request_process (packet, len, &from, ifp);
1963 lookup (rip_msg, packet->command));
1970 lookup (rip_msg, packet->command));
1976 zlog_info ("Unknown RIP command %d received", packet->command);
2050 /* RIP packet header. */
2228 /* with Classful mask if we send RIPv1 packet.That's because */
2381 /* Send RIP packet to the interface. */
2401 /* If we can't send multicast packet, send it with unicast. */