print-sip.c revision 313537
1139804Simp/*
21541Srgrimes * Redistribution and use in source and binary forms, with or without
31541Srgrimes * modification, are permitted provided that: (1) source code
41541Srgrimes * distributions retain the above copyright notice and this paragraph
51541Srgrimes * in its entirety, and (2) distributions including binary code include
61541Srgrimes * the above copyright notice and this paragraph in its entirety in
71541Srgrimes * the documentation or other materials provided with the distribution.
81541Srgrimes * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
91541Srgrimes * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
101541Srgrimes * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
111541Srgrimes * FOR A PARTICULAR PURPOSE.
121541Srgrimes *
131541Srgrimes * Original code by Hannes Gredler (hannes@juniper.net)
141541Srgrimes * Turned into common "text protocol" code, which this uses, by
151541Srgrimes * Guy Harris.
161541Srgrimes */
171541Srgrimes
181541Srgrimes/* \summary: Session Initiation Protocol (SIP) printer */
191541Srgrimes
201541Srgrimes#ifdef HAVE_CONFIG_H
211541Srgrimes#include "config.h"
221541Srgrimes#endif
231541Srgrimes
241541Srgrimes#include <netdissect-stdinc.h>
251541Srgrimes
261541Srgrimes#include "netdissect.h"
271541Srgrimes#include "extract.h"
281541Srgrimes
291541Srgrimesstatic const char *sipcmds[] = {
301541Srgrimes	"ACK",
311541Srgrimes	"BYE",
321541Srgrimes	"CANCEL",
331541Srgrimes	"DO",
3414526Shsu	"INFO",
351541Srgrimes	"INVITE",
361541Srgrimes	"MESSAGE",
37116182Sobrien	"NOTIFY",
38116182Sobrien	"OPTIONS",
39116182Sobrien	"PRACK",
4014328Speter	"QAUTH",
4180418Speter	"REFER",
4213226Swollman	"REGISTER",
431541Srgrimes	"SPRACK",
4480418Speter	"SUBSCRIBE",
4580418Speter	"UPDATE",
46172696Salfred	"PUBLISH",
471541Srgrimes	NULL
48137393Sdes};
4984783Sps
501541Srgrimesvoid
511541Srgrimessip_print(netdissect_options *ndo, const u_char *pptr, u_int len)
521541Srgrimes{
531541Srgrimes	txtproto_print(ndo, pptr, len, "sip", sipcmds, RESP_CODE_SECOND_TOKEN);
541541Srgrimes}
55145154Smarius