int ICMPv6::bottom(Packet_ptr pckt) { auto icmp = std::static_pointer_cast<PacketICMP6>(pckt); type_t type = icmp->type(); if (listeners.find(type) != listeners.end()) { return listeners[type](*this, icmp); } else { debug(">>> IPv6 -> ICMPv6 bottom (no handler installed)\n"); debug("ICMPv6 type %d: %s\n", (int) icmp->type(), code_string(icmp->type(), icmp->code()).c_str()); /* // show correct checksum intptr_t chksum = icmp->checksum(); debug("ICMPv6 checksum: %p \n",(void*) chksum); // show our recalculated checksum icmp->header().checksum_ = 0; chksum = checksum(icmp); debug("ICMPv6 our estimate: %p \n", (void*) chksum ); */ return -1; } }
void xheader_finish (struct xheader *xhdr) { struct keyword_list *kp; for (kp = keyword_override_list; kp; kp = kp->next) code_string (kp->value, kp->pattern, xhdr); xhdr->buffer = obstack_finish (xhdr->stk); }
static void code_goal_relation () { int i,j; int eltnr = 0; int mincol = (goalnr < 20)?goalnr:20; code_line ("#define on_spine_to_goal(x) lc_rel[x * %d + topi()]", goalnr); code_line ("static char lc_rel[] ="); code_string ("\t{ "); for (i = 0; i < goalnr; i++) for (j = 0; j < goalnr; j++) { code_string ("%d, ", goal_relation[i * goalnr + j]); eltnr++; if (eltnr == mincol) { code_string ("\n\t "); eltnr = 0; }; }; code_line ("%s};\n", (eltnr)?"\n\t":""); };
void xheader_write_global (struct xheader *xhdr) { if (keyword_global_override_list) { struct keyword_list *kp; xheader_init (xhdr); for (kp = keyword_global_override_list; kp; kp = kp->next) code_string (kp->value, kp->pattern, xhdr); } if (xhdr->stk) { char *name; xheader_finish (xhdr); xheader_write (XGLTYPE, name = xheader_ghdr_name (), time (NULL), xhdr); free (name); } }
static void generate_emp_semi (member m, int *sonnr, int *nrpushes, int vstrict) { cset set = m -> u.semi.set; code_line ("\t pushi (%d);", *sonnr); code_line ("\t pushq (link_son);"); generate_display (m -> u.semi.display, nrpushes); code_line ("\t pushq (make_affix_link);"); code_line ("\t pushq (make_leaf_node);"); code_line ("\t pushq (make_empty_strstore);"); if ((set -> kind & star) && (set -> kind & strict) && vstrict) { code_string ("\t pushs ("); output_string (out, set -> str); code_line (");"); if (set -> kind & non) code_line ("\t pushq (fail_if_iptr_not_at_set);"); else code_line ("\t pushq (fail_if_iptr_at_set);"); *nrpushes += 2; }; *nrpushes += 5; *sonnr -= 1; };
static void generate_leftcorner_semi (member m, int sonnr, int *nrpushes, int code_build) { cset set = m -> u.semi.set; if (code_build) { code_line ("\t pushi (%d);", sonnr); code_line ("\t pushq (link_son);"); generate_display (m -> u.semi.display, nrpushes); code_line ("\t pushq (make_affix_link);"); code_line ("\t pushq (make_leaf_node);"); *nrpushes += 4; }; code_string ("\t pushs ("); output_string (out, set -> str); code_line (");"); code_string ("\t pushq (parse"); if (set -> kind & non) code_string ("_non"); code_string ("_set"); if (set -> kind & star) code_string ("_plus"); /* leftc <> empty */ if (set -> kind & plus) code_string ("_plus"); if (set -> kind & strict) code_string ("_strict"); code_line (");"); *nrpushes += 2; };