141c99275SPeter Avalos /*
241c99275SPeter Avalos * Redistribution and use in source and binary forms, with or without
341c99275SPeter Avalos * modification, are permitted provided that: (1) source code
441c99275SPeter Avalos * distributions retain the above copyright notice and this paragraph
541c99275SPeter Avalos * in its entirety, and (2) distributions including binary code include
641c99275SPeter Avalos * the above copyright notice and this paragraph in its entirety in
741c99275SPeter Avalos * the documentation or other materials provided with the distribution.
841c99275SPeter Avalos * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
941c99275SPeter Avalos * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
1041c99275SPeter Avalos * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1141c99275SPeter Avalos * FOR A PARTICULAR PURPOSE.
1241c99275SPeter Avalos *
13411677aeSAaron LI * Original code by Hannes Gredler (hannes@gredler.at)
14411677aeSAaron LI * Turned into common "text protocol" code, which this uses, by
15411677aeSAaron LI * Guy Harris.
1641c99275SPeter Avalos */
1741c99275SPeter Avalos
18411677aeSAaron LI /* \summary: Session Initiation Protocol (SIP) printer */
1941c99275SPeter Avalos
2041c99275SPeter Avalos #ifdef HAVE_CONFIG_H
21*ed775ee7SAntonio Huete Jimenez #include <config.h>
2241c99275SPeter Avalos #endif
2341c99275SPeter Avalos
24*ed775ee7SAntonio Huete Jimenez #include "netdissect-stdinc.h"
2541c99275SPeter Avalos
26411677aeSAaron LI #include "netdissect.h"
2741c99275SPeter Avalos
28411677aeSAaron LI static const char *sipcmds[] = {
29411677aeSAaron LI "ACK",
30411677aeSAaron LI "BYE",
31411677aeSAaron LI "CANCEL",
32411677aeSAaron LI "DO",
33411677aeSAaron LI "INFO",
34411677aeSAaron LI "INVITE",
35411677aeSAaron LI "MESSAGE",
36411677aeSAaron LI "NOTIFY",
37411677aeSAaron LI "OPTIONS",
38411677aeSAaron LI "PRACK",
39411677aeSAaron LI "QAUTH",
40411677aeSAaron LI "REFER",
41411677aeSAaron LI "REGISTER",
42411677aeSAaron LI "SPRACK",
43411677aeSAaron LI "SUBSCRIBE",
44411677aeSAaron LI "UPDATE",
45411677aeSAaron LI "PUBLISH",
46411677aeSAaron LI NULL
47411677aeSAaron LI };
4841c99275SPeter Avalos
4941c99275SPeter Avalos void
sip_print(netdissect_options * ndo,const u_char * pptr,u_int len)50411677aeSAaron LI sip_print(netdissect_options *ndo, const u_char *pptr, u_int len)
5141c99275SPeter Avalos {
52*ed775ee7SAntonio Huete Jimenez ndo->ndo_protocol = "sip";
53*ed775ee7SAntonio Huete Jimenez txtproto_print(ndo, pptr, len, sipcmds, RESP_CODE_SECOND_TOKEN);
5441c99275SPeter Avalos }
55