if(snaplen) { if(!o->setCaptureLen(snaplen)) { msg(MSG_FATAL, "Observer: wrong snaplen specified - using %d", o->getCaptureLen()); } }
static int configure_observer(struct v_objects *v, char *interface, int snaplen){	dictionary *conf=v->v_config;	char *pcap_filter=iniparser_getvalue(conf, CONF_SEC, "pcap_filter");	Observer *o;	o=new Observer(interface);	if(!o->prepare(pcap_filter)) {		msg(MSG_FATAL, "Observer: preparing failed");		goto out;	}	if(snaplen) {		if(!o->setCaptureLen(snaplen)) {			msg(MSG_FATAL, "Observer: wrong snaplen specified - using %d", o->getCaptureLen());		}	}	msg(MSG_DEBUG, "Observer: using interface %s, snaplen %d", o->captureInterface, o->getCaptureLen());	v->observer=o;	return 0;out:	delete o;	return 1;}