Index: /trunk/lib/format_erf.c
===================================================================
--- /trunk/lib/format_erf.c	(revision 593)
+++ /trunk/lib/format_erf.c	(revision 594)
@@ -147,8 +147,10 @@
 #ifdef HAVE_DAG
 static int dag_init_input(struct libtrace_t *libtrace) {
-	struct stat buf;
 	libtrace->format_data = (struct libtrace_format_data_t *)
 		malloc(sizeof(struct libtrace_format_data_t));
-
+}
+
+static int dag_start_input(struct libtrace_t *libtrace) {
+	struct stat buf;
 	if (stat(packet->trace->uridata) == -1) {
 		trace_set_err(errno,"stat(%s)",libtrace->uridata);
@@ -203,4 +205,8 @@
 		malloc(sizeof(struct libtrace_format_data_t));
 
+}
+
+static int erf_start_input(struct libtrace_t *libtrace)
+{
 	libtrace->format_data->input.file = trace_open_file(libtrace);
 
@@ -800,5 +806,5 @@
 	erf_init_input,			/* init_input */	
 	NULL,				/* config_input */
-	NULL,				/* start_input */
+	erf_start_input,		/* start_input */
 	NULL,				/* pause_input */
 	erf_init_output,		/* init_output */
@@ -834,5 +840,5 @@
 	dag_init_input,			/* init_input */	
 	NULL,				/* config_input */
-	NULL,				/* start_output */
+	dag_start_input,		/* start_input */
 	NULL,				/* init_output */
 	NULL,				/* config_output */
Index: /trunk/lib/trace.c
===================================================================
--- /trunk/lib/trace.c	(revision 593)
+++ /trunk/lib/trace.c	(revision 594)
@@ -423,4 +423,33 @@
 		libtrace->format->pause_input(libtrace);
 	libtrace->started=false;
+	return 0;
+}
+
+int trace_config(libtrace_t *libtrace,
+		trace_option_t option,
+		void *value)
+{
+	int ret;
+	if (libtrace->format->config_input) {
+		ret=libtrace->format->config_input(libtrace,option,value);
+		if (ret==0)
+			return 0;
+	}
+	switch(option) {
+		case TRACE_OPTION_SNAPLEN:
+			libtrace->snaplen=*(int*)value;
+			break;
+		case TRACE_OPTION_FILTER:
+			libtrace->filter=value;
+			break;
+		case TRACE_OPTION_PROMISC:
+			trace_set_err(TRACE_ERR_OPTION_UNAVAIL,
+				"Promisc mode is not supported by this format module");
+			return -1;
+		default:
+			trace_set_err(TRACE_ERR_UNKNOWN_OPTION,
+				"Unknown option %i", option);
+			return -1;
+	}
 	return 0;
 }
@@ -1514,8 +1543,15 @@
 void trace_set_err(int errcode,const char *msg,...)
 {
+	char buf[256];
 	va_list va;
 	va_start(va,msg);
 	trace_err.err_num=errcode;
-	vsnprintf(trace_err.problem,sizeof(trace_err.problem),msg,va);
+	if (errcode>0) {
+		vsnprintf(buf,sizeof(buf),msg,va);
+		snprintf(trace_err.problem,sizeof(trace_err.problem),
+				"%s: %s",buf,strerror(errno));
+	} else {
+		vsnprintf(trace_err.problem,sizeof(trace_err.problem),msg,va);
+	}
 	va_end(va);
 }
