Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00034 #ifndef PARSE_FLINE_H
00035 #define PARSE_FLINE_H
00036
00037 #include "../str.h"
00038
00039
00040 #define SIP_REQUEST 1
00041
00042
00043 #define SIP_REPLY 2
00044
00045
00046 #define SIP_INVALID 0
00047
00048 #define SIP_VERSION "SIP/2.0"
00049 #define SIP_VERSION_LEN 7
00050
00051 #define HTTP_VERSION "HTTP/1."
00052 #define HTTP_VERSION_LEN (sizeof(HTTP_VERSION)-1)
00053
00054 #define CANCEL "CANCEL"
00055 #define ACK "ACK"
00056 #define INVITE "INVITE"
00057
00058 #define INVITE_LEN 6
00059 #define CANCEL_LEN 6
00060 #define ACK_LEN 3
00061 #define BYE_LEN 3
00062 #define INFO_LEN 4
00063 #define REGISTER_LEN 8
00064 #define SUBSCRIBE_LEN 9
00065 #define NOTIFY_LEN 6
00066 #define MESSAGE_LEN 7
00067 #define OPTIONS_LEN 7
00068 #define PRACK_LEN 5
00069 #define UPDATE_LEN 6
00070 #define REFER_LEN 5
00071 #define PUBLISH_LEN 7
00072
00073 struct msg_start {
00074 int type;
00075 int len;
00076 union {
00077 struct {
00078 str method;
00079 str uri;
00080 str version;
00081 int method_value;
00082 } request;
00083 struct {
00084 str version;
00085 str status;
00086 str reason;
00087 unsigned int statuscode;
00088 } reply;
00089 }u;
00090 };
00091
00092
00093
00094 char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl);
00095
00096 char* parse_fline(char* buffer, char* end, struct msg_start* fl);
00097
00098
00099 #endif