source: rtems-libbsd/mDNSResponder/mDNSShared/dnsextd_lexer.l @ f761b29

55-freebsd-126-freebsd-12
Last change on this file since f761b29 was f761b29, checked in by Sebastian Huber <sebastian.huber@…>, on 09/19/18 at 06:52:21

mDNSResponder: Update to v625.41.2

The sources can be obtained via:

https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-625.41.2.tar.gz

Update #3522.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2006-2011 Apple Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18%{
19#include <string.h>
20#include <stdio.h>
21#include "dnsextd_parser.h"
22
23
24extern YYSTYPE yylval;
25
26#define YY_NO_INPUT 1
27int  yylex(void);
28
29static char*
30StripQuotes
31        (
32        const char * string
33        )
34{
35        char * dup;
36
37        dup = strdup( string + 1);
38
39        dup[ strlen( dup ) - 1 ] = '\0';
40
41        return dup;
42}
43
44
45%}
46
47%option nounput
48%%
49
50options                                                         return OPTIONS;
51listen-on                                                       return LISTEN_ON;
52nameserver                                                      return NAMESERVER;
53port                                                            return PORT;
54address                                                         return ADDRESS;
55llq                                                                     return LLQ;
56public                                                          return PUBLIC;
57private                                                         return PRIVATE;
58key                                                                     return KEY;
59allow-update                                            return ALLOWUPDATE;
60allow-query                                                     return ALLOWQUERY;
61algorithm                                                       return ALGORITHM;
62secret                                                          return SECRET;
63zone                                            return ZONE;
64type                                            return TYPE;
65allow                                                           return ALLOW;
66\{                                              return OBRACE;
67\}                                              return EBRACE;
68;                                               return SEMICOLON;
69IN                                                                      return IN;
70\*                                                                      yylval.string = strdup(yytext); return WILDCARD;
71[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+          yylval.string = strdup(yytext); return DOTTED_DECIMAL_ADDRESS;
72[0123456789]+                                           yylval.number = atoi(yytext);   return NUMBER;
73[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*           yylval.string = strdup(yytext); return HOSTNAME;
74[a-zA-Z0-9\.]+([a-zA-Z0-9\.]+)*         yylval.string = strdup(yytext); return DOMAINNAME;
75\"([^"\\\r\n]*(\\.[^"\\\r\n]*)*)\"      yylval.string = StripQuotes(yytext);    return QUOTEDSTRING;
76[\/][\/].*                                                      /* ignore C++ style comments */;
77\n                                              yylineno++; /* ignore EOL */;
78[ \t]+                                          /* ignore whitespace */;
79%%
Note: See TracBrowser for help on using the repository browser.