print-sip.c revision 285275
1146773Ssam/* 2146773Ssam * Redistribution and use in source and binary forms, with or without 3146773Ssam * modification, are permitted provided that: (1) source code 4146773Ssam * distributions retain the above copyright notice and this paragraph 5146773Ssam * in its entirety, and (2) distributions including binary code include 6146773Ssam * the above copyright notice and this paragraph in its entirety in 7146773Ssam * the documentation or other materials provided with the distribution. 8146773Ssam * THIS SOFTWARE IS PROVIDED ``AS IS'' AND 9146773Ssam * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT 10146773Ssam * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 11146773Ssam * FOR A PARTICULAR PURPOSE. 12146773Ssam * 13146773Ssam * Original code by Hannes Gredler (hannes@juniper.net) 14285275Spkelsey * Turned into common "text protocol" code, which this uses, by 15285275Spkelsey * Guy Harris. 16146773Ssam */ 17146773Ssam 18276788Sdelphij#define NETDISSECT_REWORKED 19146773Ssam#ifdef HAVE_CONFIG_H 20146773Ssam#include "config.h" 21146773Ssam#endif 22146773Ssam 23146773Ssam#include <tcpdump-stdinc.h> 24146773Ssam 25146773Ssam#include "interface.h" 26146773Ssam#include "extract.h" 27146773Ssam 28285275Spkelseystatic const char *sipcmds[] = { 29285275Spkelsey "ACK", 30285275Spkelsey "BYE", 31285275Spkelsey "CANCEL", 32285275Spkelsey "DO", 33285275Spkelsey "INFO", 34285275Spkelsey "INVITE", 35285275Spkelsey "MESSAGE", 36285275Spkelsey "NOTIFY", 37285275Spkelsey "OPTIONS", 38285275Spkelsey "PRACK", 39285275Spkelsey "QAUTH", 40285275Spkelsey "REFER", 41285275Spkelsey "REGISTER", 42285275Spkelsey "SPRACK", 43285275Spkelsey "SUBSCRIBE", 44285275Spkelsey "UPDATE", 45285275Spkelsey "PUBLISH", 46285275Spkelsey NULL 47285275Spkelsey}; 48285275Spkelsey 49146773Ssamvoid 50285275Spkelseysip_print(netdissect_options *ndo, const u_char *pptr, u_int len) 51146773Ssam{ 52285275Spkelsey txtproto_print(ndo, pptr, len, "sip", sipcmds, RESP_CODE_SECOND_TOKEN); 53146773Ssam} 54