Changeset View
Changeset View
Standalone View
Standalone View
g10/packet.h
Show First 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | |||||
/* A context used with parse_packet. */ | /* A context used with parse_packet. */ | ||||
struct parse_packet_ctx_s | struct parse_packet_ctx_s | ||||
{ | { | ||||
iobuf_t inp; /* The input stream with the packets. */ | iobuf_t inp; /* The input stream with the packets. */ | ||||
struct packet_struct last_pkt; /* The last parsed packet. */ | struct packet_struct last_pkt; /* The last parsed packet. */ | ||||
int free_last_pkt; /* Indicates that LAST_PKT must be freed. */ | int free_last_pkt; /* Indicates that LAST_PKT must be freed. */ | ||||
int skip_meta; /* Skip ring trust packets. */ | int skip_meta; /* Skip ring trust packets. */ | ||||
unsigned int n_parsed_packets; /* Number of parsed packets. */ | unsigned int n_parsed_packets; /* Number of parsed packets. */ | ||||
int sigs_only; /* Only accept detached signature packets */ | |||||
}; | }; | ||||
typedef struct parse_packet_ctx_s *parse_packet_ctx_t; | typedef struct parse_packet_ctx_s *parse_packet_ctx_t; | ||||
#define init_parse_packet(a,i) do { \ | #define init_parse_packet(a,i) do { \ | ||||
(a)->inp = (i); \ | (a)->inp = (i); \ | ||||
(a)->last_pkt.pkttype = 0; \ | (a)->last_pkt.pkttype = 0; \ | ||||
(a)->last_pkt.pkt.generic= NULL;\ | (a)->last_pkt.pkt.generic= NULL;\ | ||||
(a)->free_last_pkt = 0; \ | (a)->free_last_pkt = 0; \ | ||||
(a)->skip_meta = 0; \ | (a)->skip_meta = 0; \ | ||||
(a)->n_parsed_packets = 0; \ | (a)->n_parsed_packets = 0; \ | ||||
(a)->sigs_only = 0; \ | |||||
} while (0) | } while (0) | ||||
#define deinit_parse_packet(a) do { \ | #define deinit_parse_packet(a) do { \ | ||||
if ((a)->free_last_pkt) \ | if ((a)->free_last_pkt) \ | ||||
free_packet (NULL, (a)); \ | free_packet (NULL, (a)); \ | ||||
} while (0) | } while (0) | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |