Exemplo n.º 1
0
static void ospf_packet_db_desc_dump(struct stream *s, uint16_t length)
{
	struct ospf_db_desc *dd;
	char dd_flags[8];

	uint32_t gp;

	gp = stream_get_getp(s);
	dd = (struct ospf_db_desc *)stream_pnt(s);

	zlog_debug("Database Description");
	zlog_debug("  Interface MTU %d", ntohs(dd->mtu));
	zlog_debug("  Options %d (%s)", dd->options,
		   ospf_options_dump(dd->options));
	zlog_debug("  Flags %d (%s)", dd->flags,
		   ospf_dd_flags_dump(dd->flags, dd_flags, sizeof dd_flags));
	zlog_debug("  Sequence Number 0x%08lx",
		   (unsigned long)ntohl(dd->dd_seqnum));

	length -= OSPF_HEADER_SIZE + OSPF_DB_DESC_MIN_SIZE;

	stream_forward_getp(s, OSPF_DB_DESC_MIN_SIZE);

	ospf_lsa_header_list_dump(s, length);

	stream_set_getp(s, gp);
}
Exemplo n.º 2
0
static void ospf_packet_hello_dump(struct stream *s, uint16_t length)
{
	struct ospf_hello *hello;
	int i;

	hello = (struct ospf_hello *)stream_pnt(s);

	zlog_debug("Hello");
	zlog_debug("  NetworkMask %s", inet_ntoa(hello->network_mask));
	zlog_debug("  HelloInterval %d", ntohs(hello->hello_interval));
	zlog_debug("  Options %d (%s)", hello->options,
		   ospf_options_dump(hello->options));
	zlog_debug("  RtrPriority %d", hello->priority);
	zlog_debug("  RtrDeadInterval %ld",
		   (unsigned long)ntohl(hello->dead_interval));
	zlog_debug("  DRouter %s", inet_ntoa(hello->d_router));
	zlog_debug("  BDRouter %s", inet_ntoa(hello->bd_router));

	length -= OSPF_HEADER_SIZE + OSPF_HELLO_MIN_SIZE;
	zlog_debug("  # Neighbors %d", length / 4);
	for (i = 0; length > 0; i++, length -= sizeof(struct in_addr))
		zlog_debug("    Neighbor %s", inet_ntoa(hello->neighbors[i]));
}
Exemplo n.º 3
0
void 
ndnx_lsa_header_dump (struct lsa_header *lsah)
 {
   	const char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
   	writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__,"  LSA Header\n");
	writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__,"    LS age %d\n", ntohs (lsah->ls_age));
	writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__,"    Options %d (%s)\n", lsah->options, ospf_options_dump (lsah->options));   
	writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__,"    LS type %d (%s)\n", lsah->type, (lsah->type ? lsah_type : "unknown type"));
	writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__,"    Link State ID %s\n", inet_ntoa (lsah->id)); 
	if( lsah->type == 9 || lsah->type == 10 || lsah->type ==11)
	{
		writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__," Opaque Type  %d\n" ,ntohl(lsah->id.s_addr)>>24);
		writeLogg(ospfn->logFile,__FILE__,__FUNCTION__,__LINE__," Opaque Id  %d\n" ,ntohl(lsah->id.s_addr)& LSID_OPAQUE_ID_MASK);
	}