Browse Source

Support for MESSAGE and OPTIONS method types are added to the parser.

Miklos Tirpak 16 years ago
parent
commit
19af811d79
3 changed files with 6 additions and 1 deletions
  1. 2 1
      parser/msg_parser.h
  2. 2 0
      parser/parse_fline.c
  3. 2 0
      parser/parse_fline.h

+ 2 - 1
parser/msg_parser.h

@@ -79,7 +79,8 @@
 /* number methods as power of two to allow bitmap matching */
 /* number methods as power of two to allow bitmap matching */
 enum request_method { METHOD_UNDEF=0, METHOD_INVITE=1, METHOD_CANCEL=2, METHOD_ACK=4,
 enum request_method { METHOD_UNDEF=0, METHOD_INVITE=1, METHOD_CANCEL=2, METHOD_ACK=4,
 	METHOD_BYE=8, METHOD_INFO=16, METHOD_REGISTER=32, METHOD_SUBSCRIBE=64,
 	METHOD_BYE=8, METHOD_INFO=16, METHOD_REGISTER=32, METHOD_SUBSCRIBE=64,
-        METHOD_NOTIFY=128, METHOD_OTHER=256 };
+	METHOD_NOTIFY=128, METHOD_MESSAGE=256, METHOD_OPTIONS=512,
+	METHOD_OTHER=1024 };
 
 
 #define FL_FORCE_RPORT 1   /* force rport */
 #define FL_FORCE_RPORT 1   /* force rport */
 #define FL_FORCE_ACTIVE 2  /* force active SDP */
 #define FL_FORCE_ACTIVE 2  /* force active SDP */

+ 2 - 0
parser/parse_fline.c

@@ -123,6 +123,8 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl)
 	else IFISMETHOD( REGISTER, 'R')
 	else IFISMETHOD( REGISTER, 'R')
 	else IFISMETHOD( SUBSCRIBE, 'S')
 	else IFISMETHOD( SUBSCRIBE, 'S')
 	else IFISMETHOD( NOTIFY, 'N')
 	else IFISMETHOD( NOTIFY, 'N')
+	else IFISMETHOD( MESSAGE, 'M')
+	else IFISMETHOD( OPTIONS, 'O')
 	/* if you want to add another method XXX, include METHOD_XXX in
 	/* if you want to add another method XXX, include METHOD_XXX in
            H-file (this is the value which you will take later in
            H-file (this is the value which you will take later in
            processing and define XXX_LEN as length of method name;
            processing and define XXX_LEN as length of method name;

+ 2 - 0
parser/parse_fline.h

@@ -58,6 +58,8 @@
 #define REGISTER_LEN 8
 #define REGISTER_LEN 8
 #define SUBSCRIBE_LEN 9
 #define SUBSCRIBE_LEN 9
 #define NOTIFY_LEN 6
 #define NOTIFY_LEN 6
+#define MESSAGE_LEN 7
+#define OPTIONS_LEN 7
 
 
 struct msg_start {
 struct msg_start {
 	int type;					/* Type of the Message - Request/Response */
 	int type;					/* Type of the Message - Request/Response */