1 /* parser.h 2 * 3 * Copyright (C) 2010 - 2013 UNISYS CORPORATION 4 * All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or (at 9 * your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 14 * NON INFRINGEMENT. See the GNU General Public License for more 15 * details. 16 */ 17 18 #ifndef __PARSER_H__ 19 #define __PARSER_H__ 20 21 #include <linux/uuid.h> 22 23 #include "timskmod.h" 24 #include "channel.h" 25 26 typedef enum { 27 PARSERSTRING_INITIATOR, 28 PARSERSTRING_TARGET, 29 PARSERSTRING_CONNECTION, 30 PARSERSTRING_NAME, 31 } PARSER_WHICH_STRING; 32 33 struct parser_context *parser_init(u64 addr, u32 bytes, BOOL isLocal, 34 BOOL *tryAgain); 35 struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, BOOL local, 36 BOOL *retry); 37 void parser_param_start(struct parser_context *ctx, 38 PARSER_WHICH_STRING which_string); 39 void *parser_param_get(struct parser_context *ctx, char *nam, int namesize); 40 void *parser_string_get(struct parser_context *ctx); 41 uuid_le parser_id_get(struct parser_context *ctx); 42 char *parser_simpleString_get(struct parser_context *ctx); 43 void *parser_byte_stream_get(struct parser_context *ctx, ulong *nbytes); 44 void parser_done(struct parser_context *ctx); 45 46 #endif 47