dsniff  2.4b2
About: A collection of tools for network auditing
  Fossies Dox: dsniff-2.4b2.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

decode_ospf.c
Go to the documentation of this file.
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
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 
pntohs
#define pntohs(p)
Definition: decode.h:33
decode.h
buf
Definition: buf.h:14
config.h
obuf
static char obuf[4096]
Definition: trigger.c:43
decode_ospf
int decode_ospf(u_char *buf, int len, u_char *obuf, int olen)
Definition: decode_ospf.c:21