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_rip.c
Go to the documentation of this file.
1 /*
2  * decode_rip.c
3  *
4  * Routing Information Protocol.
5  *
6  * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
7  *
8  * $Id: decode_rip.c,v 1.4 2001/03/15 08:33:02 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_rip(u_char *buf, int len, u_char *obuf, int olen)
22 {
23  if (len < 21)
24  return (0);
25 
26  /* Version 2 simple password authentication. */
27  if (buf[1] != 2 || memcmp(buf + 4, "\xff\xff\x00\x02", 4) != 0)
28  return (0);
29 
30  buf[20] = '\0';
31 
32  return (snprintf(obuf, olen, "%s\n", buf + 20));
33 }
34 
decode.h
buf
Definition: buf.h:14
decode_rip
int decode_rip(u_char *buf, int len, u_char *obuf, int olen)
Definition: decode_rip.c:21
memcmp
int memcmp(void *s1, void *s2, size_t n) const
Definition: memcmp.c:44
config.h
obuf
static char obuf[4096]
Definition: trigger.c:43