]> The Tcpdump Group git mirrors - tcpdump/blob - print-calm-fast.c
d67c6f5451363f1cea6da8a28cc8fcd014afec9c
[tcpdump] / print-calm-fast.c
1 /*
2 * Copyright (c) 2013 The TCPDUMP project
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
14 *
15 * Original code by Ola Martin Lykkja (ola.lykkja@q-free.com)
16 */
17
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
21
22 #include <tcpdump-stdinc.h>
23
24 #include <stdio.h>
25 #include <string.h>
26
27 #include "interface.h"
28 #include "extract.h"
29 #include "addrtoname.h"
30
31 /*
32 ISO 29281:2009
33 Intelligent Transport Systems . Communications access for land mobiles (CALM)
34 CALM non-IP networking
35 */
36
37 /*
38 * This is the top level routine of the printer. 'bp' points
39 * to the calm header of the packet.
40 */
41 void
42 calm_fast_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int length)
43 {
44 int srcNwref = bp[0];
45 int dstNwref = bp[1];
46 length -= 2;
47 bp += 2;
48
49 printf("CALM FAST src:%s; ", etheraddr_string(eth+6));
50 printf("SrcNwref:%d; ", srcNwref);
51 printf("DstNwref:%d; ", dstNwref);
52
53 if (ndo->ndo_vflag)
54 default_print(bp, length);
55 }
56
57
58 /*
59 * Local Variables:
60 * c-style: whitesmith
61 * c-basic-offset: 8
62 * End:
63 */