1255570Strasz%{ 2255570Strasz/*- 3255570Strasz * Copyright (c) 2012 The FreeBSD Foundation 4255570Strasz * All rights reserved. 5255570Strasz * 6255570Strasz * This software was developed by Edward Tomasz Napierala under sponsorship 7255570Strasz * from the FreeBSD Foundation. 8255570Strasz * 9255570Strasz * Redistribution and use in source and binary forms, with or without 10255570Strasz * modification, are permitted provided that the following conditions 11255570Strasz * are met: 12255570Strasz * 1. Redistributions of source code must retain the above copyright 13255570Strasz * notice, this list of conditions and the following disclaimer. 14255570Strasz * 2. Redistributions in binary form must reproduce the above copyright 15255570Strasz * notice, this list of conditions and the following disclaimer in the 16255570Strasz * documentation and/or other materials provided with the distribution. 17255570Strasz * 18255570Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19255570Strasz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20255570Strasz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21255570Strasz * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22255570Strasz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23255570Strasz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24255570Strasz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25255570Strasz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26255570Strasz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27255570Strasz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28255570Strasz * SUCH DAMAGE. 29255570Strasz * 30255570Strasz * $FreeBSD$ 31255570Strasz */ 32255570Strasz 33255570Strasz#include <stdio.h> 34255570Strasz#include <stdint.h> 35255570Strasz#include <string.h> 36255570Strasz 37255570Strasz#include "iscsictl.h" 38255570Strasz#include "y.tab.h" 39255570Strasz 40255570Straszint lineno; 41255570Strasz 42255570Strasz#define YY_DECL int yylex(void) 43255570Straszextern int yylex(void); 44255570Strasz 45255570Strasz%} 46255570Strasz 47255570Strasz%option noinput 48255570Strasz%option nounput 49255570Strasz 50255570Strasz%% 51255570StraszHeaderDigest { return HEADER_DIGEST; } 52255570StraszDataDigest { return DATA_DIGEST; } 53255570StraszTargetName { return TARGET_NAME; } 54255570StraszTargetAddress { return TARGET_ADDRESS; } 55255570StraszInitiatorName { return INITIATOR_NAME; } 56255570StraszInitiatorAddress { return INITIATOR_ADDRESS; } 57255570StraszInitiatorAlias { return INITIATOR_ALIAS; } 58255570StraszchapIName { return USER; } 59255570StraszchapSecret { return SECRET; } 60255570StrasztgtChapName { return MUTUAL_USER; } 61255570StrasztgtChapSecret { return MUTUAL_SECRET; } 62255570StraszAuthMethod { return AUTH_METHOD; } 63255570StraszSessionType { return SESSION_TYPE; } 64255570Straszprotocol { return PROTOCOL; } 65255570Straszport { return IGNORED; } 66255570StraszMaxConnections { return IGNORED; } 67255570StraszTargetAlias { return IGNORED; } 68255570StraszTargetPortalGroupTag { return IGNORED; } 69255570StraszInitialR2T { return IGNORED; } 70255570StraszImmediateData { return IGNORED; } 71255570StraszMaxRecvDataSegmentLength { return IGNORED; } 72255570StraszMaxBurstLength { return IGNORED; } 73255570StraszFirstBurstLength { return IGNORED; } 74255570StraszDefaultTime2Wait { return IGNORED; } 75255570StraszDefaultTime2Retain { return IGNORED; } 76255570StraszMaxOutstandingR2T { return IGNORED; } 77255570StraszDataPDUInOrder { return IGNORED; } 78255570StraszDataSequenceInOrder { return IGNORED; } 79255570StraszErrorRecoveryLevel { return IGNORED; } 80255570Strasztags { return IGNORED; } 81255570Straszmaxluns { return IGNORED; } 82255570Straszsockbufsize { return IGNORED; } 83255570StraszchapDigest { return IGNORED; } 84255570Strasz\"[^"]+\" { yylval.str = strndup(yytext + 1, 85255570Strasz strlen(yytext) - 2); return STR; } 86255570Strasz[a-zA-Z0-9\.\-_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } 87255570Strasz\{ { return OPENING_BRACKET; } 88255570Strasz\} { return CLOSING_BRACKET; } 89255570Strasz= { return EQUALS; } 90255570Strasz#.*$ /* ignore comments */; 91255570Strasz\n { lineno++; } 92255570Strasz[ \t]+ /* ignore whitespace */; 93255570Strasz%% 94