[Bro] Bro - Broccoli Data Type Mismatch issue
Vishak Muthukumar
vmuthu at ucdavis.edu
Sat Oct 5 16:20:40 PDT 2013
Hi,
I am developing Bro scripts for reading modbus packets.
I send the packet details to broccoli as events.
When I send an event with parameters of type "addr" and "vector of
count" from the bro script to broccoli, the broccoli doesn't receive the
parameters correctly.
The code --
Bro script --
global pong: event(reg: vector of count, ipaddr: addr);
event modbus_read_holding_registers_response(c: connection, headers:
ModbusHeaders, registers: ModbusRegisters)
{
event pong(ModbusRegisters,c$id$resp_h);
#ModbusRegisters - type vector of count
#c$id$resp_h type-addr
}
Broccoli Script --
static void bro_pong(BroConn *conn,void *data,BroRecord *rec,BroAddr
*address)
{
int type = BRO_TYPE_COUNT;
uint64 *register;
if (! (seq = bro_record_get_nth_val(rec, 0, &type)))
{
printf("Error getting sequence count from event, got type
%i\n", type);
return;
}
printf("pong event from seq=%"PRIu64"",*register);
printf("\nAddress:");
for(i=3;i>=0;i--)
{
printf("%"PRIu32".",address->addr[i]);
}
printf("\n");
}
Thanks in advance!
Vishak Muthukumar
Graduate Student
University of California, Davis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20131005/a742afda/attachment.html
More information about the Bro
mailing list