Ejemplo n.º 1
0
static void
packet_handler(int port_num, const char *buffer, int length)
{
#if 0
    /* @fixme log vector */
    printf("Packet in on port %d length %d; first bytes:\n", port_num, length);
    int i = 0;
    for (i = 0; i < 16; i++) {
        if (i && ((i % 4) == 0)) {
            printf(" ");
        }
        printf("%02x", (uint8_t) buffer[i]);
    }
    printf("\n");
    printf("rmt proc returns %d\n", rmt_process_pkt(port_num, (char*)buffer, length));
#else
    if (log_level >= P4_LOG_LEVEL_TRACE) {
        packet_log(port_num, buffer, length);
    }
    rmt_process_pkt(port_num, (char*)buffer, length);
#endif
}
Ejemplo n.º 2
0
static void
packet_handler(int port_num, const char *buffer, int length)
{
    /* @fixme log vector */
    printf("Packet in on port %d length %d; first bytes:\n", port_num, length);
    printf("%02x%02x%02x%02x %02x%02x%02x%02x "
           "%02x%02x%02x%02x %02x%02x%02x%02x\n",
           buffer[0], buffer[1], buffer[2], buffer[3],
           buffer[4], buffer[5], buffer[6], buffer[7],
           buffer[8], buffer[9], buffer[10], buffer[11],
           buffer[12], buffer[13], buffer[14], buffer[15]);

    printf("rmt proc returns %d\n", rmt_process_pkt(port_num, (char*)buffer, length));
}
Ejemplo n.º 3
0
static void
packet_handler(int port_num, const char *buffer, int length)
{
    /* @fixme log vector */
    printf("Packet in on port %d length %d; first bytes:\n", port_num, length);
    int i = 0;
    for (i = 0; i < 16; i++) {
        if (i && ((i % 4) == 0)) {
            printf(" ");
        }
        printf("%02x", (uint8_t) buffer[i]);
    }
    printf("\n");
    printf("rmt proc returns %d\n", rmt_process_pkt(port_num, (char*)buffer, length));
}