static int end(struct sr_input *in)
{
struct context *inc;
- struct sr_datafeed_packet packet;
int ret;
inc = in->priv;
flush_output_buffer(in);
- if (inc->meta_sent) {
- packet.type = SR_DF_END;
- sr_session_send(in->sdi, &packet);
- }
+ if (inc->meta_sent)
+ std_session_send_df_end(in->sdi, LOG_PREFIX);
return ret;
}
+static int reset(struct sr_input *in)
+{
+ struct context *inc = in->priv;
+
+ inc->meta_sent = FALSE;
+ inc->header_read = FALSE;
+ inc->records_read = FALSE;
+ inc->trigger_sent = FALSE;
+ inc->cur_record = 0;
+
+ g_string_truncate(in->buf, 0);
+
+ return SR_OK;
+}
+
static struct sr_option options[] = {
{ "podA", "Import pod A / iprobe",
"Create channels and data for pod A / iprobe", NULL, NULL },
.init = init,
.receive = receive,
.end = end,
+ .reset = reset,
};