private TSIP_HeaderAuthorization(THTTP_HeaderAuthorization embeddedHeader)
     : base(tsip_header_type_t.Authorization)
 {
     mEmbeddedHeader = embeddedHeader;
 }
        /* #line 280 "./ragel/thttp_parser_header_Authorization.rl" */
        public static THTTP_HeaderAuthorization Parse(String data)
        {
            int cs = 0;
            int p = 0;
            int pe = data.Length;
            int eof = pe;
            THTTP_HeaderAuthorization hdr_Authorization = new THTTP_HeaderAuthorization();

            int tag_start = 0;

            /* #line 7766 "../Headers/THTTP_HeaderAuthorization.cs" */
            {
            cs = thttp_machine_parser_header_Authorization_start;
            }

            /* #line 293 "./ragel/thttp_parser_header_Authorization.rl" */

            /* #line 7773 "../Headers/THTTP_HeaderAuthorization.cs" */
            {
            sbyte _klen;
            short _trans;
            sbyte _acts;
            sbyte _nacts;
            short _keys;

            if ( p == pe )
            goto _test_eof;
            if ( cs == 0 )
            goto _out;
            _resume:
            _keys = _thttp_machine_parser_header_Authorization_key_offsets[cs];
            _trans = (short)_thttp_machine_parser_header_Authorization_index_offsets[cs];

            _klen = _thttp_machine_parser_header_Authorization_single_lengths[cs];
            if ( _klen > 0 ) {
            short _lower = _keys;
            short _mid;
            short _upper = (short) (_keys + _klen - 1);
            while (true) {
            if ( _upper < _lower )
                break;

            _mid = (short) (_lower + ((_upper-_lower) >> 1));
            if ( data[p] < _thttp_machine_parser_header_Authorization_trans_keys[_mid] )
                _upper = (short) (_mid - 1);
            else if ( data[p] > _thttp_machine_parser_header_Authorization_trans_keys[_mid] )
                _lower = (short) (_mid + 1);
            else {
                _trans += (short) (_mid - _keys);
                goto _match;
            }
            }
            _keys += (short) _klen;
            _trans += (short) _klen;
            }

            _klen = _thttp_machine_parser_header_Authorization_range_lengths[cs];
            if ( _klen > 0 ) {
            short _lower = _keys;
            short _mid;
            short _upper = (short) (_keys + (_klen<<1) - 2);
            while (true) {
            if ( _upper < _lower )
                break;

            _mid = (short) (_lower + (((_upper-_lower) >> 1) & ~1));
            if ( data[p] < _thttp_machine_parser_header_Authorization_trans_keys[_mid] )
                _upper = (short) (_mid - 2);
            else if ( data[p] > _thttp_machine_parser_header_Authorization_trans_keys[_mid+1] )
                _lower = (short) (_mid + 2);
            else {
                _trans += (short)((_mid - _keys)>>1);
                goto _match;
            }
            }
            _trans += (short) _klen;
            }

            _match:
            _trans = (short)_thttp_machine_parser_header_Authorization_indicies[_trans];
            cs = _thttp_machine_parser_header_Authorization_trans_targs[_trans];

            if ( _thttp_machine_parser_header_Authorization_trans_actions[_trans] == 0 )
            goto _again;

            _acts = _thttp_machine_parser_header_Authorization_trans_actions[_trans];
            _nacts = _thttp_machine_parser_header_Authorization_actions[_acts++];
            while ( _nacts-- > 0 )
            {
            switch ( _thttp_machine_parser_header_Authorization_actions[_acts++] )
            {
            case 0:
            /* #line 31 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            tag_start = p;
            }
            break;
            case 1:
            /* #line 35 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Scheme = "Digest";
            }
            break;
            case 2:
            /* #line 39 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Scheme = "Basic";
            }
            break;
            case 3:
            /* #line 43 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.mType = thttp_header_type_t.Authorization;
            }
            break;
            case 4:
            /* #line 47 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.mType = thttp_header_type_t.Proxy_Authorization;
            }
            break;
            case 5:
            /* #line 51 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.UserName = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 6:
            /* #line 55 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Realm = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 7:
            /* #line 59 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Nonce = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 8:
            /* #line 63 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Uri = TSK_RagelState.Parser.GetString(data, p, tag_start);
            }
            break;
            case 9:
            /* #line 67 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Response = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 10:
            /* #line 71 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Algorithm = TSK_RagelState.Parser.GetString(data, p, tag_start);
            }
            break;
            case 11:
            /* #line 75 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Cnonce = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 12:
            /* #line 79 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Opaque = TSK_String.UnQuote(TSK_RagelState.Parser.GetString(data, p, tag_start));
            }
            break;
            case 13:
            /* #line 83 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Qop = TSK_RagelState.Parser.GetString(data, p, tag_start);
            }
            break;
            case 14:
            /* #line 87 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Nc = TSK_RagelState.Parser.GetString(data, p, tag_start);
            }
            break;
            case 15:
            /* #line 91 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            hdr_Authorization.Params = TSK_RagelState.Parser.AddParam(data, p, tag_start, hdr_Authorization.Params);
            }
            break;
            case 16:
            /* #line 95 "./ragel/thttp_parser_header_Authorization.rl" */
            {
            }
            break;
            /* #line 7948 "../Headers/THTTP_HeaderAuthorization.cs" */
            default: break;
            }
            }

            _again:
            if ( cs == 0 )
            goto _out;
            if ( ++p != pe )
            goto _resume;
            _test_eof: {}
            _out: {}
            }

            /* #line 294 "./ragel/thttp_parser_header_Authorization.rl" */

            if( cs <
            /* #line 7965 "../Headers/THTTP_HeaderAuthorization.cs" */
            1351
            /* #line 295 "./ragel/thttp_parser_header_Authorization.rl" */
             ){
                TSK_Debug.Error("Failed to parse SIP 'Authorization' header.");
                hdr_Authorization.Dispose();
                hdr_Authorization = null;
            }

            return hdr_Authorization;
        }