xref: /freebsd/contrib/tcpdump/print-calm-fast.c (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
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 #define NETDISSECT_REWORKED
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22 
23 #include <tcpdump-stdinc.h>
24 
25 #include "interface.h"
26 #include "addrtoname.h"
27 
28 /*
29    ISO 29281:2009
30    Intelligent Transport Systems . Communications access for land mobiles (CALM)
31    CALM non-IP networking
32 */
33 
34 /*
35  * This is the top level routine of the printer.  'bp' points
36  * to the calm header of the packet.
37  */
38 void
39 calm_fast_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int length)
40 {
41 	int srcNwref = bp[0];
42 	int dstNwref = bp[1];
43 	length -= 2;
44 	bp += 2;
45 
46 	ND_PRINT((ndo, "CALM FAST src:%s; ", etheraddr_string(ndo, eth+6)));
47 	ND_PRINT((ndo, "SrcNwref:%d; ", srcNwref));
48 	ND_PRINT((ndo, "DstNwref:%d; ", dstNwref));
49 
50 	if (ndo->ndo_vflag)
51 		ND_DEFAULTPRINT(bp, length);
52 }
53 
54 
55 /*
56  * Local Variables:
57  * c-style: whitesmith
58  * c-basic-offset: 8
59  * End:
60  */
61