1 /*
2  * decode_ospf.c
3  *
4  * Open Shortest Path First.
5  *
6  * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
7  *
8  * $Id: decode_ospf.c,v 1.6 2001/03/15 08:33:01 dugsong Exp $
9  */
10 
11 #include "config.h"
12 
13 #include <sys/types.h>
14 
15 #include <stdio.h>
16 #include <string.h>
17 
18 #include "decode.h"
19 
20 int
decode_ospf(u_char * buf,int len,u_char * obuf,int olen)21 decode_ospf(u_char *buf, int len, u_char *obuf, int olen)
22 {
23 	if (len < 25)
24 		return (0);
25 
26 	if (pntohs(buf + 14) != 1)
27 		return (0);
28 
29 	buf[24] = '\0';
30 
31 	return (snprintf(obuf, olen, "%s\n", buf + 16));
32 }
33 
34