# Bro CVS

**URL:** <https://community.zeek.org/t/bro-cvs/361>\
**Category:** Zeek\
**Created:** [April 10, 2003, 5:51am UTC](https://community.zeek.org/t/bro-cvs/361 "2003-04-10T05:51:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vern](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/vern/32/630_2.png) [@Vern](https://community.zeek.org/u/Vern)\
**Post date:** [April 10, 2003, 5:51am UTC](https://community.zeek.org/t/bro-cvs/361/1 "2003-04-10T05:51:17Z")

</div>

> In order to make an OpenBSD port, I have to patch Bro but I can't find  
> any CVS.

Bro is not presently available via public CVS. Please send patches to  
me so I can integrate them into future releases.

&nbsp;&nbsp;&nbsp;&nbsp;Vern

---

<div class="post-metadata">

**Author:** ![Sylvain\_de\_Tilly1](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sylvain\_de\_Tilly1](https://community.zeek.org/u/Sylvain_de_Tilly1)\
**Post date:** [April 10, 2003, 9:26am UTC](https://community.zeek.org/t/bro-cvs/361/2 "2003-04-10T09:26:26Z")

</div>

Vern Paxson \<vern@icir.org\> writes:

> \> In order to make an OpenBSD port, I have to patch Bro but I can't find  
> \> any CVS.
> 
> Bro is not presently available via public CVS. Please send patches to  
> me so I can integrate them into future releases.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;Vern

Hello,

I give you what I need to do to compile Bro (0.8a20) with an  
OpenBSD(3.3) 17 mars Snapshot.

1- Problème with TCP\_Rewriter.cc :  
Here, the problème I've seen :

> g++ -I. -Ilibedit -O -c TCP\_Rewriter.cc  
> TCP\_Rewriter.cc: In method `int TCP\_TracePacket::Finish(pcap\_pkthdr  
> \*&, const u\_char \*&, int &, unsigned int, unsigned int)':  
> TCP\_Rewriter.cc:350: no match for `bpf\_timeval & = timeval'  
> /usr/include/net/bpf.h:122: candidates are: struct bpf\_timeval &  
> bpf\_timeval::operator =(const bpf\_timeval &)  
> \*\*\* Error code 1

And to resolve it, I modify a few the "double\_to\_timeval"  
function. Here, my changes :

> #define MSG\_PREFIX "TCP trace rewriter: "
> 
> #ifdef OPENBSD
> 
> static struct bpf\_timeval double\_to\_timeval(double t)  
> &nbsp;&nbsp;{  
> &nbsp;&nbsp;struct bpf\_timeval tv;  
> #else  
> static struct timeval double\_to\_timeval(double t)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct timeval tv;  
> #endif
> 
> &nbsp;&nbsp;double t1 = floor(t);  
> &nbsp;&nbsp;tv.tv\_sec = (int) t1;

2- DNS error :

> gcc -I. -Ilibedit -O -c nb\_dns.c  
> nb\_dns.c:81: `NS\_MAXDNAME' undeclared here (not in a function)  
> nb\_dns.c:81: size of array `name' has non-integer type  
> nb\_dns.c: In function `\_nb\_dns\_mkquery':  
> nb\_dns.c:274: `NS\_INADDRSZ' undeclared (first use in this function)  
> nb\_dns.c:274: (Each undeclared identifier is reported only once  
> nb\_dns.c:274: for each function it appears in.)  
> nb\_dns.c:279: `NS\_IN6ADDRSZ' undeclared (first use in this function)  
> nb\_dns.c:291: `ns\_o\_query' undeclared (first use in this function)  
> nb\_dns.c:293: `ns\_c\_in' undeclared (first use in this function)  
> nb\_dns.c: In function `nb\_dns\_addr\_request2':  
> nb\_dns.c:376: `NS\_MAXDNAME' undeclared (first use in this function)  
> nb\_dns.c:376: size of array `name' has non-integer type  
> nb\_dns.c:394: `NS\_IN6ADDRSZ' undeclared (first use in this function)  
> nb\_dns.c: In function `nb\_dns\_activity':  
> nb\_dns.c:457: syntax error before `handle'  
> nb\_dns.c:473: `handle' undeclared (first use in this function)  
> nb\_dns.c:516: `ns\_f\_rcode' undeclared (first use in this function)  
> nb\_dns.c:518: `ns\_r\_nxdomain' undeclared (first use in this function)  
> nb\_dns.c:523: `ns\_r\_servfail' undeclared (first use in this function)  
> nb\_dns.c:528: `ns\_r\_noerror' undeclared (first use in this function)  
> nb\_dns.c:531: `ns\_r\_formerr' undeclared (first use in this function)  
> nb\_dns.c:532: `ns\_r\_notimpl' undeclared (first use in this function)  
> nb\_dns.c:533: `ns\_r\_refused' undeclared (first use in this function)  
> nb\_dns.c:519: warning: unreachable code at beginning of switch statement  
> nb\_dns.c:541: `rr' undeclared (first use in this function)  
> nb\_dns.c:556: `ns\_s\_an' undeclared (first use in this function)  
> nb\_dns.c:572: warning: assignment makes pointer from integer without a cast  
> gmake: \*\*\* [nb\_dns.o] Error 1

To solve it, I had to put the "-I$(BIND9\_PATH)/include" flags in the  
Makefile

3- Link problem :

> g++ -o bro main.o net\_util.o util.o parse.o scan.o re-parse.o re-scan.o rule-parse.o rule-scan.o Active.o Anon.o Attr.o BackDoor.o BroString.o CCL.o CompHash.o Conn.o DFA.o Debug.o DebugCmds.o DbgBreakpoint.o DbgWatch.o DbgHelp.o Desc.o Dict.o Discard.o DNS.o DNS\_Mgr.o EquivClass.o Event.o Expr.o File.o Finger.o Frag.o Frame.o FTP.o Func.o Hash.o HTTP.o ICMP.o ID.o Ident.o InterConn.o IntSet.o List.o Logger.o Login.o MIME.o NFA.o NTP.o NVT.o Net.o NetbiosSSN.o NetVar.o Obj.o PktSrc.o PolicyFile.o Portmap.o PriorityQueue.o Queue.o Reassem.o Rlogin.o RE.o RPC.o Rule.o RuleMatcher.o RuleAction.o RuleCondition.o Scope.o Sessions.o SMTP.o SSH.o SteppingStone.o Stmt.o TCP.o TCP\_Rewriter.o Telnet.o Timer.o Type.o UDP.o Val.o Var.o XDR.o cq.o md5.o setsignal.o version.o nb\_dns.o -Llibedit -ltermcap -ledit -lpcap -lm  
> nb\_dns.o: Undefined symbol `\_\_\_res\_init' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_inet\_ntoa' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_res\_mkquery' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_ns\_initparse' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_ns\_msg\_getflag' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_dn\_expand' referenced from text segment  
> nb\_dns.o: Undefined symbol `\_\_\_ns\_parserr' referenced from text segment  
> readline.c:161: Undefined symbol `\_history' referenced from text segment  
> readline.c:189: Undefined symbol `\_el\_end' referenced from text segment  
> readline.c:191: Undefined symbol `\_history\_end' referenced from text segment  
> readline.c:204: Undefined symbol `\_el\_init' referenced from text segment  
> readline.c:207: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:209: Undefined symbol `\_history\_init' referenced from text segment  
> readline.c:213: Undefined symbol `\_history' referenced from text segment  
> readline.c:216: Undefined symbol `\_history' referenced from text segment  
> readline.c:216: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:220: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:221: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:225: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:231: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:234: Undefined symbol `\_el\_set' referenced from text segment  
> readline.c:248: Undefined symbol `\_el\_source' referenced from text segment  
> readline.c:254: Undefined symbol `\_el\_line' referenced from text segment  
> readline.c:285: Undefined symbol `\_el\_gets' referenced from text segment  
> readline.c:300: Undefined symbol `\_history' referenced from text segment  
> readline.c:434: Undefined symbol `\_history' referenced from text segment  
> readline.c:448: Undefined symbol `\_history' referenced from text segment  
> readline.c:453: Undefined symbol `\_history' referenced from text segment  
> readline.c:820: Undefined symbol `\_history' referenced from text segment  
> readline.c:834: Undefined symbol `\_history' referenced from text segment  
> readline.c:0: More undefined symbol \_history refs follow  
> readline.c:1455: Undefined symbol `\_el\_line' referenced from text segment  
> readline.c:1490: Undefined symbol `\_el\_deletestr' referenced from text segment  
> readline.c:1491: Undefined symbol `\_el\_insertstr' referenced from text segment  
> readline.c:1510: Undefined symbol `\_el\_insertstr' referenced from text segment  
> readline.c:1553: Undefined symbol `\_el\_beep' referenced from text segment  
> readline.c:1557: Undefined symbol `\_el\_beep' referenced from text segment  
> readline.c:1629: Undefined symbol `\_el\_getc' referenced from text segment  
> readline.c:1643: Undefined symbol `\_el\_reset' referenced from text segment  
> readline.c:1663: Undefined symbol `\_el\_push' referenced from text segment  
> collect2: ld returned 1 exit status  
> gmake: \*\*\* [bro] Error 1

Here, I have to put  
"libedit/\*.o" to the "-Llibedit" place.  
I think (but It's just my opinion) the linker have a bug here... I've  
got the 2.95.3 gcc version.

4- Another link problem :

> gcc -I. -Ilibedit -O -c nb\_dns.c  
> nb\_dns.c:81: `NS\_MAXDNAME' undeclared here (not in a function)  
> nb\_dns.c:81: size of array `name' has non-integer type  
> nb\_dns.c: In function `\_nb\_dns\_mkquery':  
> nb\_dns.c:274: `NS\_INADDRSZ' undeclared (first use in this function)  
> nb\_dns.c:274: (Each undeclared identifier is reported only once  
> nb\_dns.c:274: for each function it appears in.)  
> nb\_dns.c:279: `NS\_IN6ADDRSZ' undeclared (first use in this function)  
> nb\_dns.c:291: `ns\_o\_query' undeclared (first use in this function)  
> nb\_dns.c:293: `ns\_c\_in' undeclared (first use in this function)  
> nb\_dns.c: In function `nb\_dns\_addr\_request2':  
> nb\_dns.c:376: `NS\_MAXDNAME' undeclared (first use in this function)  
> nb\_dns.c:376: size of array `name' has non-integer type  
> nb\_dns.c:394: `NS\_IN6ADDRSZ' undeclared (first use in this function)  
> nb\_dns.c: In function `nb\_dns\_activity':  
> nb\_dns.c:457: syntax error before `handle'  
> nb\_dns.c:473: `handle' undeclared (first use in this function)  
> nb\_dns.c:516: `ns\_f\_rcode' undeclared (first use in this function)  
> nb\_dns.c:518: `ns\_r\_nxdomain' undeclared (first use in this function)  
> nb\_dns.c:523: `ns\_r\_servfail' undeclared (first use in this function)  
> nb\_dns.c:528: `ns\_r\_noerror' undeclared (first use in this function)  
> nb\_dns.c:531: `ns\_r\_formerr' undeclared (first use in this function)  
> nb\_dns.c:532: `ns\_r\_notimpl' undeclared (first use in this function)  
> nb\_dns.c:533: `ns\_r\_refused' undeclared (first use in this function)  
> nb\_dns.c:519: warning: unreachable code at beginning of switch statement  
> nb\_dns.c:541: `rr' undeclared (first use in this function)  
> nb\_dns.c:556: `ns\_s\_an' undeclared (first use in this function)  
> nb\_dns.c:572: warning: assignment makes pointer from integer without a cast  
> gmake: \*\*\* [nb\_dns.o] Error 1

Off course, I put the bind include but I need to put the libbind  
too. That what I do in the Makefile (LIBS variable) :  
-L$(BIND\_PATH) -lbind

I think (and It's again my own opinion) the best way to solve the DNS  
problem is to put in the Bro sources the : bind-9.x.x/lib/bind  
directory and modify the Makefile. In that way, the depedence with  
Bind will be solve and I prefer not install bind on my firewall...

5- Yet Another link problem :

> g++ -o bro main.o net\_util.o util.o parse.o scan.o re-parse.o re-scan.o rule-parse.o rule-scan.o Active.o Anon.o Attr.o BackDoor.o BroString.o CCL.o CompHash.o Conn.o DFA.o Debug.o DebugCmds.o DbgBreakpoint.o DbgWatch.o DbgHelp.o Desc.o Dict.o Discard.o DNS.o DNS\_Mgr.o EquivClass.o Event.o Expr.o File.o Finger.o Frag.o Frame.o FTP.o Func.o Hash.o HTTP.o ICMP.o ID.o Ident.o InterConn.o IntSet.o List.o Logger.o Login.o MIME.o NFA.o NTP.o NVT.o Net.o NetbiosSSN.o NetVar.o Obj.o PktSrc.o PolicyFile.o Portmap.o PriorityQueue.o Queue.o Reassem.o Rlogin.o RE.o RPC.o Rule.o RuleMatcher.o RuleAction.o RuleCondition.o Scope.o Sessions.o SMTP.o SSH.o SteppingStone.o Stmt.o TCP.o TCP\_Rewriter.o Telnet.o Timer.o Type.o UDP.o Val.o Var.o XDR.o cq.o md5.o setsignal.o version.o nb\_dns.o -ltermcap -ledit libedit/\*.o -lpcap -lm -L/usr/local/src/bind-9.2.2/lib/bind/ -lbind  
> irs\_data.c:117: Undefined symbol `\_pthread\_mutex\_lock' referenced from text segment  
> irs\_data.c:119: Undefined symbol `\_pthread\_key\_create' referenced from text segment  
> irs\_data.c:120: Undefined symbol `\_pthread\_mutex\_unlock' referenced from text segment  
> irs\_data.c:122: Undefined symbol `\_pthread\_getspecific' referenced from text segment  
> irs\_data.c:130: Undefined symbol `\_pthread\_setspecific' referenced from text segment  
> collect2: ld returned 1 exit status  
> gmake: \*\*\* [bro] Error 1

Here, it's just a pthread librarie which is not link well. Just add  
-lpthread in the LIBS makefile variable.

make & gmake do the same things here.

I wish this will help you.

Regards,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:36pm UTC](https://community.zeek.org/t/bro-cvs/361/3 "2022-05-06T15:36:44Z")

</div>


