Robert Edmonds | 11 May 2011 04:56

nmsg 0.6.15 released

ftp://ftp.isc.org/isc/nmsg/nmsg-0.6.15.tar.gz

changes:

    * add a new message type ISC/encode for encoding other types of data
      (JSON, YAML, etc).  includes "hello world" python examples.

--

-- 
Robert Edmonds
edmonds <at> isc.org
_______________________________________________
nmsg-dev mailing list
nmsg-dev <at> lists.isc.org
https://lists.isc.org/mailman/listinfo/nmsg-dev
Matt Thompson | 19 May 2011 21:52
Favicon

32 bit build with external libprotobuf_c

Hi,

I was compiling libnmsg on a 32 bit linux system with an external
libprotobuf_c and it seems that the m4 macro checks of the structure
sizes are hardcoded for a 64 bit system.

>From autoconf/check_libprotobuf-c_sizeof.m4:

if test "$use_internal_libprotobuf_c" != "true"; then
    AC_CHECK_SIZEOF(ProtobufCMessageDescriptor,, [[#include
<google/protobuf-c/protobuf-c.h>]])
    AC_CHECK_SIZEOF(ProtobufCFieldDescriptor,,   [[#include
<google/protobuf-c/protobuf-c.h>]])
    AC_CHECK_SIZEOF(ProtobufCEnumDescriptor,,    [[#include
<google/protobuf-c/protobuf-c.h>]])

    if test "$ac_cv_sizeof_ProtobufCEnumDescriptor" != "120"; then
        AC_MSG_FAILURE([sizeof(ProtobufCEnumDescriptor) != 120])
    fi

    if test "$ac_cv_sizeof_ProtobufCFieldDescriptor" != "72"; then
        AC_MSG_FAILURE([sizeof(ProtobufCFieldDescriptor) != 72])
    fi

    if test "$ac_cv_sizeof_ProtobufCMessageDescriptor" != "120"; then
        AC_MSG_FAILURE([sizeof(ProtobufCMessageDescriptor) != 120])
    fi
fi

On a 32 bit system the structure sizes are:
(Continue reading)

Robert Edmonds | 19 May 2011 22:03

Re: 32 bit build with external libprotobuf_c

Matt Thompson wrote:
> I was compiling libnmsg on a 32 bit linux system with an external
> libprotobuf_c and it seems that the m4 macro checks of the structure
> sizes are hardcoded for a 64 bit system.

yes, they are.  it's a rather crude check to make sure that the
protobuf-c structs haven't changed, as the nmsg msgmod ABI
(NMSG_MSGMOD_VERSION in msgmod_plugin.h) embeds structures created by
the protobuf-c compiler.

i am thinking these checks should actually be disabled by default.

--

-- 
Robert Edmonds
edmonds <at> isc.org
Jose Nazario | 24 May 2011 19:01

what am i doing wrong?

python2.5 on fbsd7 amd64

recently updated to wreck-0.1.13. now this code causes an error:

def process_msg_ch204(m):
    name = wdns.domain_to_str(m['rrname'])
    rrclass = m['rrclass']
    rrtype = m['rrtype']
    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
    if m['qtype'] in (1, 2, 28): return name, rdata
    else: return None

here's the error:

Traceback (most recent call last):
  File "pdns6.py", line 48, in <module>
    res = process_msg_ch204(m)
  File "pdns6.py", line 19, in process_msg_ch204
    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
  File "wdns.pyx", line 180, in wdns.rdata.__repr__ (wdns.c:3172)
TypeError: raise: exception class must be a subclass of BaseException

any ideas? 

_____________________________
jose nazario, ph.d. jose <at> arbor.net
sr. manager of security research, arbor networks
http://asert.arbor.net/
Jose Nazario | 24 May 2011 20:52

Re: what am i doing wrong?

figured it out. thanks. 

On May 24, 2011, at 1:01 PM, Jose Nazario wrote:

> python2.5 on fbsd7 amd64
> 
> recently updated to wreck-0.1.13. now this code causes an error:
> 
> def process_msg_ch204(m):
>    name = wdns.domain_to_str(m['rrname'])
>    rrclass = m['rrclass']
>    rrtype = m['rrtype']
>    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
>    if m['qtype'] in (1, 2, 28): return name, rdata
>    else: return None
> 
> here's the error:
> 
> 
> Traceback (most recent call last):
>  File "pdns6.py", line 48, in <module>
>    res = process_msg_ch204(m)
>  File "pdns6.py", line 19, in process_msg_ch204
>    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
>  File "wdns.pyx", line 180, in wdns.rdata.__repr__ (wdns.c:3172)
> TypeError: raise: exception class must be a subclass of BaseException
> 
> 
> any ideas? 
> 
(Continue reading)

Robert Edmonds | 25 May 2011 01:51

Re: what am i doing wrong?

Jose Nazario wrote:
> figured it out. thanks. 

what was the problem?

> On May 24, 2011, at 1:01 PM, Jose Nazario wrote:
> 
> > python2.5 on fbsd7 amd64
> > 
> > recently updated to wreck-0.1.13. now this code causes an error:
> > 
> > def process_msg_ch204(m):
> >    name = wdns.domain_to_str(m['rrname'])
> >    rrclass = m['rrclass']
> >    rrtype = m['rrtype']
> >    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
> >    if m['qtype'] in (1, 2, 28): return name, rdata
> >    else: return None
> > 
> > here's the error:
> > 
> > 
> > Traceback (most recent call last):
> >  File "pdns6.py", line 48, in <module>
> >    res = process_msg_ch204(m)
> >  File "pdns6.py", line 19, in process_msg_ch204
> >    rdata = [ str(wdns.rdata(r, rrclass, rrtype)) for r in m['rdata'] ]
> >  File "wdns.pyx", line 180, in wdns.rdata.__repr__ (wdns.c:3172)
> > TypeError: raise: exception class must be a subclass of BaseException
> > 
(Continue reading)

jose nazario | 25 May 2011 02:36

Re: what am i doing wrong?

On May 24, 2011, at 7:51 PM, Robert Edmonds wrote:

> what was the problem?

not sure how it built the first time but i rebuilt it using current  
cython, fixing the exception base class problems.

then i had to modify the code a bit to look for the right key in the  
dnsmsg and to fix use of the rdata->str conversions.

works like a champ now. took a bit but after updating it seems to have  
worked out ok.

-- jose

Gmane