static int analyzer_gif_init(struct analyzer *analyzer) { struct analyzer_pload_type *pload_type = analyzer_pload_type_get_by_name(ANALYZER_GIF_PLOAD_TYPE); if (!pload_type) { pomlog(POMLOG_ERR "Payload type " ANALYZER_GIF_PLOAD_TYPE " not found"); return POM_ERR; } static struct data_item_reg pload_gif_data_items[ANALYZER_GIF_PLOAD_DATA_COUNT] = { { 0 } }; pload_gif_data_items[analyzer_gif_pload_width].name = "width"; pload_gif_data_items[analyzer_gif_pload_width].value_type = ptype_get_type("uint16"); pload_gif_data_items[analyzer_gif_pload_height].name = "height"; pload_gif_data_items[analyzer_gif_pload_height].value_type = ptype_get_type("uint16"); static struct data_reg pload_gif_data = { .items = pload_gif_data_items, .data_count = ANALYZER_GIF_PLOAD_DATA_COUNT }; static struct analyzer_pload_reg pload_reg; memset(&pload_reg, 0, sizeof(struct analyzer_pload_reg)); pload_reg.analyzer = analyzer; pload_reg.process = analyzer_gif_pload_process; pload_reg.data_reg = &pload_gif_data; pload_reg.flags = ANALYZER_PLOAD_PROCESS_PARTIAL; return analyzer_pload_register(pload_type, &pload_reg); }
static int proto_eap_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_EAP_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "code"; fields[0].value_type = ptype_get_type("uint8"); fields[0].description = "Code"; fields[1].name = "identifier"; fields[1].value_type = ptype_get_type("uint8"); fields[1].description = "Identifier"; static struct proto_reg_info proto_eap = { 0 }; proto_eap.name = "eap"; proto_eap.api_ver = PROTO_API_VER; proto_eap.mod = mod; proto_eap.pkt_fields = fields; proto_eap.number_class = "eap"; static struct conntrack_info ct_info = { 0 }; ct_info.default_table_size = 256; // No hashing done here ct_info.fwd_pkt_field_id = proto_eap_field_identifier; ct_info.rev_pkt_field_id = CONNTRACK_PKT_FIELD_NONE; proto_eap.ct_info = &ct_info; proto_eap.init = proto_eap_init; proto_eap.cleanup = proto_eap_cleanup; proto_eap.process = proto_eap_process; if (proto_register(&proto_eap) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_icmp6_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_ICMP6_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "type"; fields[0].value_type = ptype_get_type("uint8"); fields[0].description = "Type"; fields[1].name = "code"; fields[1].value_type = ptype_get_type("uint8"); fields[1].description = "Code"; static struct proto_reg_info proto_icmp6 = { 0 }; proto_icmp6.name = "icmp6"; proto_icmp6.api_ver = PROTO_API_VER; proto_icmp6.mod = mod; proto_icmp6.pkt_fields = fields; // No contrack here proto_icmp6.init = proto_icmp6_init; proto_icmp6.process = proto_icmp6_process; if (proto_register(&proto_icmp6) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_udp_mod_register(struct mod_reg *mod) { static struct proto_reg_info proto_udp = { 0 }; proto_udp.name = "udp"; proto_udp.api_ver = PROTO_API_VER; proto_udp.mod = mod; static struct proto_pkt_field fields[PROTO_UDP_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "sport"; fields[0].value_type = ptype_get_type("uint16"); fields[0].description = "Source port"; fields[1].name = "dport"; fields[1].value_type = ptype_get_type("uint16"); fields[1].description = "Destination port"; proto_udp.pkt_fields = fields; static struct conntrack_info ct_info = { 0 }; ct_info.default_table_size = 32768; ct_info.fwd_pkt_field_id = proto_udp_field_sport; ct_info.rev_pkt_field_id = proto_udp_field_dport; proto_udp.ct_info = &ct_info; proto_udp.init = proto_udp_init; proto_udp.cleanup = proto_udp_cleanup; proto_udp.process = proto_udp_process; if (proto_register(&proto_udp) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_vlan_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_VLAN_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "vid"; fields[0].value_type = ptype_get_type("uint16"); fields[0].description = "VLAN id"; fields[1].name = "de"; fields[1].value_type = ptype_get_type("bool"); fields[1].description = "Drop eligible"; fields[2].name = "pcp"; fields[2].value_type = ptype_get_type("uint8"); fields[3].description = "Priority Code Point"; static struct proto_reg_info proto_vlan = { 0 }; proto_vlan.name = "vlan"; proto_vlan.api_ver = PROTO_API_VER; proto_vlan.mod = mod; proto_vlan.pkt_fields = fields; proto_vlan.number_class = "ethernet"; // No contrack here proto_vlan.init = proto_vlan_init; proto_vlan.process = proto_vlan_process; if (proto_register(&proto_vlan) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_arp_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_ARP_FIELD_NUM + 1] = { { 0 } }; fields[proto_arp_field_oper].name = "oper"; fields[proto_arp_field_oper].value_type = ptype_get_type("uint16"); fields[proto_arp_field_oper].description = "Operation"; fields[proto_arp_field_sender_hw_addr].name = "sender_hw_addr"; fields[proto_arp_field_sender_hw_addr].value_type = ptype_get_type("mac"); fields[proto_arp_field_sender_hw_addr].description = "Sender hardware address"; fields[proto_arp_field_sender_proto_addr].name = "sender_proto_addr"; fields[proto_arp_field_sender_proto_addr].value_type = ptype_get_type("ipv4"); fields[proto_arp_field_sender_proto_addr].description = "Sender protocol address"; fields[proto_arp_field_target_hw_addr].name = "target_hw_addr"; fields[proto_arp_field_target_hw_addr].value_type = ptype_get_type("mac"); fields[proto_arp_field_target_hw_addr].description = "Target hardware address"; fields[proto_arp_field_target_proto_addr].name = "target_proto_addr"; fields[proto_arp_field_target_proto_addr].value_type = ptype_get_type("ipv4"); fields[proto_arp_field_target_proto_addr].description = "Target protocol address"; static struct proto_reg_info proto_arp = { 0 }; proto_arp.name = "arp"; proto_arp.api_ver = PROTO_API_VER; proto_arp.mod = mod; proto_arp.pkt_fields = fields; // No contrack here proto_arp.process = proto_arp_process; return proto_register(&proto_arp); }
static int proto_tftp_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_TFTP_FIELD_NUM + 1] = { { 0 }}; fields[0].name = "opcode"; fields[0].value_type = ptype_get_type("uint16"); fields[0].description = "OP code"; static struct proto_reg_info proto_tftp = { 0 }; proto_tftp.name = "tftp"; proto_tftp.api_ver = PROTO_API_VER; proto_tftp.mod = mod; proto_tftp.pkt_fields = fields; static struct conntrack_info ct_info = { 0 }; ct_info.default_table_size = 1; // No hashing done here ct_info.cleanup_handler = proto_tftp_conntrack_cleanup; proto_tftp.ct_info = &ct_info; proto_tftp.init = proto_tftp_init; proto_tftp.process = proto_tftp_process; if (proto_register(&proto_tftp) == POM_OK) return POM_OK; return POM_ERR; }
static int analyzer_tftp_init(struct analyzer *analyzer) { struct analyzer_tftp_priv *priv = malloc(sizeof(struct analyzer_tftp_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_tftp_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_tftp_priv)); analyzer->priv = priv; static struct data_item_reg evt_file_data_items[ANALYZER_TFTP_EVT_FILE_DATA_COUNT] = { { 0 } }; evt_file_data_items[analyzer_tftp_file_filename].name = "filename"; evt_file_data_items[analyzer_tftp_file_filename].value_type = ptype_get_type("string"); evt_file_data_items[analyzer_tftp_file_mode].name = "mode"; evt_file_data_items[analyzer_tftp_file_mode].value_type = ptype_get_type("string"); evt_file_data_items[analyzer_tftp_file_write].name = "write"; evt_file_data_items[analyzer_tftp_file_write].value_type = ptype_get_type("bool"); evt_file_data_items[analyzer_tftp_file_size].name = "size"; evt_file_data_items[analyzer_tftp_file_size].value_type = ptype_get_type("uint32"); static struct data_reg evt_file_data = { .items = evt_file_data_items, .data_count = ANALYZER_TFTP_EVT_FILE_DATA_COUNT }; static struct event_reg_info analyzer_tftp_evt_file = { 0 }; analyzer_tftp_evt_file.source_name = "analyzer_tftp"; analyzer_tftp_evt_file.source_obj = priv; analyzer_tftp_evt_file.name = "tftp_file"; analyzer_tftp_evt_file.description = "TFTP file"; analyzer_tftp_evt_file.flags = EVENT_REG_FLAG_PAYLOAD; analyzer_tftp_evt_file.data_reg = &evt_file_data; analyzer_tftp_evt_file.listeners_notify = analyzer_tftp_event_listeners_notify; priv->evt_file = event_register(&analyzer_tftp_evt_file); if (!priv->evt_file) { free(priv); return POM_ERR; } return POM_OK; }
static int analyzer_png_init(struct analyzer *analyzer) { static struct data_item_reg pload_png_data_items[ANALYZER_PNG_PLOAD_DATA_COUNT] = { { 0 } }; pload_png_data_items[analyzer_png_pload_width].name = "width"; pload_png_data_items[analyzer_png_pload_width].value_type = ptype_get_type("uint16"); pload_png_data_items[analyzer_png_pload_height].name = "height"; pload_png_data_items[analyzer_png_pload_height].value_type = ptype_get_type("uint16"); static struct data_reg pload_png_data = { .items = pload_png_data_items, .data_count = ANALYZER_PNG_PLOAD_DATA_COUNT }; static struct pload_analyzer pload_analyzer_reg = { 0 }; pload_analyzer_reg.analyze = analyzer_png_pload_analyze; pload_analyzer_reg.data_reg = &pload_png_data; return pload_set_analyzer(ANALYZER_PNG_PLOAD_TYPE, &pload_analyzer_reg); }
static int proto_ipv4_mod_register(struct mod_reg *mod) { static struct proto_reg_info proto_ipv4 = { 0 }; proto_ipv4.name = "ipv4"; proto_ipv4.api_ver = PROTO_API_VER; proto_ipv4.mod = mod; proto_ipv4.number_class = "ip"; static struct proto_pkt_field fields[PROTO_IPV4_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "src"; fields[0].value_type = ptype_get_type("ipv4"); fields[0].description = "Source address"; fields[1].name = "dst"; fields[1].value_type = ptype_get_type("ipv4"); fields[1].description = "Destination address"; fields[2].name = "tos"; fields[2].value_type = ptype_get_type("uint8"); fields[2].description = "Type of service"; fields[3].name = "ttl"; fields[3].value_type = ptype_get_type("uint8"); fields[3].description = "Time to live"; proto_ipv4.pkt_fields = fields; static struct conntrack_info ct_info = { 0 }; ct_info.default_table_size = 65535; ct_info.fwd_pkt_field_id = proto_ipv4_field_src; ct_info.rev_pkt_field_id = proto_ipv4_field_dst; ct_info.cleanup_handler = proto_ipv4_conntrack_cleanup; proto_ipv4.ct_info = &ct_info; proto_ipv4.init = proto_ipv4_init; proto_ipv4.process = proto_ipv4_process; proto_ipv4.cleanup = proto_ipv4_cleanup; if (proto_register(&proto_ipv4) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_dns_mod_register(struct mod_reg *mod) { static struct proto_pkt_field fields[PROTO_DNS_FIELD_NUM + 1] = { { 0 } }; fields[0].name = "id"; fields[0].value_type = ptype_get_type("uint16"); fields[0].description = "ID"; fields[1].name = "response"; fields[1].value_type = ptype_get_type("bool"); fields[1].description = "Query or response"; fields[2].name = "rcode"; fields[2].value_type = ptype_get_type("uint8"); fields[2].description = "Response code"; fields[3].name = "qdcount"; fields[3].value_type = ptype_get_type("uint16"); fields[3].description = "Question count"; fields[4].name = "ancount"; fields[4].value_type = ptype_get_type("uint16"); fields[4].description = "Answer count"; fields[5].name = "nscount"; fields[5].value_type = ptype_get_type("uint16"); fields[5].description = "Name server count"; fields[6].name = "arcount"; fields[6].value_type = ptype_get_type("uint16"); fields[6].description = "Additional records count"; static struct proto_reg_info proto_dns = { 0 }; proto_dns.name = "dns"; proto_dns.api_ver = PROTO_API_VER; proto_dns.mod = mod; proto_dns.pkt_fields = fields; // No contrack here proto_dns.process = proto_dns_process; if (proto_register(&proto_dns) == POM_OK) return POM_OK; return POM_ERR; }
static int proto_smtp_init(struct proto *proto, struct registry_instance *i) { if (proto_number_register("tcp", 25, proto) != POM_OK || proto_number_register("tcp", 587, proto) != POM_OK) return POM_ERR; struct proto_smtp_priv *priv = malloc(sizeof(struct proto_smtp_priv)); if (!priv) { pom_oom(sizeof(struct proto_smtp_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct proto_smtp_priv)); proto_set_priv(proto, priv); // Register the smtp_cmd event static struct data_item_reg evt_cmd_data_items[PROTO_SMTP_EVT_CMD_DATA_COUNT] = { { 0 } }; evt_cmd_data_items[proto_smtp_cmd_name].name = "name"; evt_cmd_data_items[proto_smtp_cmd_name].value_type = ptype_get_type("string"); evt_cmd_data_items[proto_smtp_cmd_arg].name = "arg"; evt_cmd_data_items[proto_smtp_cmd_arg].value_type = ptype_get_type("string"); static struct data_reg evt_cmd_data = { .items = evt_cmd_data_items, .data_count = PROTO_SMTP_EVT_CMD_DATA_COUNT }; static struct event_reg_info proto_smtp_evt_cmd = { 0 }; proto_smtp_evt_cmd.source_name = "proto_smtp"; proto_smtp_evt_cmd.source_obj = proto; proto_smtp_evt_cmd.name = "smtp_cmd"; proto_smtp_evt_cmd.description = "SMTP command from the client"; proto_smtp_evt_cmd.data_reg = &evt_cmd_data; priv->evt_cmd = event_register(&proto_smtp_evt_cmd); if (!priv->evt_cmd) goto err; // Register the smtp_reply event static struct data_item_reg evt_reply_data_items[PROTO_SMTP_EVT_CMD_DATA_COUNT] = { { 0 } }; evt_reply_data_items[proto_smtp_reply_code].name = "code"; evt_reply_data_items[proto_smtp_reply_code].value_type = ptype_get_type("uint16"); evt_reply_data_items[proto_smtp_reply_text].name = "text"; evt_reply_data_items[proto_smtp_reply_text].flags = DATA_REG_FLAG_LIST; static struct data_reg evt_reply_data = { .items = evt_reply_data_items, .data_count = PROTO_SMTP_EVT_REPLY_DATA_COUNT }; static struct event_reg_info proto_smtp_evt_reply = { 0 }; proto_smtp_evt_reply.source_name = "proto_smtp"; proto_smtp_evt_reply.source_obj = proto; proto_smtp_evt_reply.name = "smtp_reply"; proto_smtp_evt_reply.description = "SMTP command from the client"; proto_smtp_evt_reply.data_reg = &evt_reply_data; priv->evt_reply = event_register(&proto_smtp_evt_reply); if (!priv->evt_reply) goto err; return POM_OK; err: proto_smtp_cleanup(priv); return POM_ERR; }
static int analyzer_smtp_init(struct analyzer *analyzer) { struct analyzer_smtp_priv *priv = malloc(sizeof(struct analyzer_smtp_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_smtp_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_smtp_priv)); analyzer->priv = priv; priv->evt_cmd = event_find("smtp_cmd"); priv->evt_reply = event_find("smtp_reply"); if (!priv->evt_cmd || !priv->evt_reply) goto err; static struct data_item_reg evt_msg_data_items[ANALYZER_SMTP_EVT_MSG_DATA_COUNT] = { { 0 } }; evt_msg_data_items[analyzer_smtp_common_client_addr].name = "client_addr"; evt_msg_data_items[analyzer_smtp_common_client_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_msg_data_items[analyzer_smtp_common_server_addr].name = "server_addr"; evt_msg_data_items[analyzer_smtp_common_server_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_msg_data_items[analyzer_smtp_common_server_port].name = "server_port"; evt_msg_data_items[analyzer_smtp_common_server_port].value_type = ptype_get_type("uint16"); evt_msg_data_items[analyzer_smtp_common_server_host].name = "server_host"; evt_msg_data_items[analyzer_smtp_common_server_host].value_type = ptype_get_type("string"); evt_msg_data_items[analyzer_smtp_common_server_hello].name = "server_hello"; evt_msg_data_items[analyzer_smtp_common_server_hello].value_type = ptype_get_type("string"); evt_msg_data_items[analyzer_smtp_common_client_hello].name = "client_hello"; evt_msg_data_items[analyzer_smtp_common_client_hello].value_type = ptype_get_type("string"); evt_msg_data_items[analyzer_smtp_msg_from].name = "from"; evt_msg_data_items[analyzer_smtp_msg_from].value_type = ptype_get_type("string"); evt_msg_data_items[analyzer_smtp_msg_to].name = "to"; evt_msg_data_items[analyzer_smtp_msg_to].flags = DATA_REG_FLAG_LIST; evt_msg_data_items[analyzer_smtp_msg_result].name = "result"; evt_msg_data_items[analyzer_smtp_msg_result].value_type = ptype_get_type("uint16"); static struct data_reg evt_msg_data = { .items = evt_msg_data_items, .data_count = ANALYZER_SMTP_EVT_MSG_DATA_COUNT }; static struct event_reg_info analyzer_smtp_evt_msg = { 0 }; analyzer_smtp_evt_msg.source_name = "analyzer_smtp"; analyzer_smtp_evt_msg.source_obj = analyzer; analyzer_smtp_evt_msg.name = "smtp_msg"; analyzer_smtp_evt_msg.description = "message received over smtp"; analyzer_smtp_evt_msg.data_reg = &evt_msg_data; analyzer_smtp_evt_msg.listeners_notify = analyzer_smtp_event_listeners_notify; analyzer_smtp_evt_msg.cleanup = analyzer_smtp_evt_msg_cleanup; analyzer_smtp_evt_msg.flags = EVENT_REG_FLAG_PAYLOAD; priv->evt_msg = event_register(&analyzer_smtp_evt_msg); if (!priv->evt_msg) goto err; static struct data_item_reg evt_auth_data_items[ANALYZER_SMTP_EVT_AUTH_DATA_COUNT] = { { 0 } }; evt_auth_data_items[analyzer_smtp_common_client_addr].name = "client_addr"; evt_auth_data_items[analyzer_smtp_common_client_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_auth_data_items[analyzer_smtp_common_server_addr].name = "server_addr"; evt_auth_data_items[analyzer_smtp_common_server_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_auth_data_items[analyzer_smtp_common_server_port].name = "server_port"; evt_auth_data_items[analyzer_smtp_common_server_port].value_type = ptype_get_type("uint16"); evt_auth_data_items[analyzer_smtp_common_server_host].name = "server_host"; evt_auth_data_items[analyzer_smtp_common_server_host].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_smtp_common_server_hello].name = "server_hello"; evt_auth_data_items[analyzer_smtp_common_server_hello].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_smtp_common_client_hello].name = "client_hello"; evt_auth_data_items[analyzer_smtp_common_client_hello].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_smtp_auth_type].name = "type"; evt_auth_data_items[analyzer_smtp_auth_type].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_smtp_auth_params].name = "params"; evt_auth_data_items[analyzer_smtp_auth_params].flags = DATA_REG_FLAG_LIST; evt_auth_data_items[analyzer_smtp_auth_success].name = "success"; evt_auth_data_items[analyzer_smtp_auth_success].value_type = ptype_get_type("bool"); static struct data_reg evt_auth_data = { .items = evt_auth_data_items, .data_count = ANALYZER_SMTP_EVT_AUTH_DATA_COUNT }; static struct event_reg_info analyzer_smtp_evt_auth = { 0 }; analyzer_smtp_evt_auth.source_name = "analyzer_smtp"; analyzer_smtp_evt_auth.source_obj = analyzer; analyzer_smtp_evt_auth.name = "smtp_auth"; analyzer_smtp_evt_auth.description = "SMTP authentication attempts"; analyzer_smtp_evt_auth.data_reg = &evt_auth_data; analyzer_smtp_evt_auth.listeners_notify = analyzer_smtp_event_listeners_notify; priv->evt_auth = event_register(&analyzer_smtp_evt_auth); if (!priv->evt_auth) goto err; return POM_OK; err: analyzer_smtp_cleanup(analyzer); return POM_ERR; }
int analyzer_ppp_pap_init(struct analyzer *analyzer) { struct analyzer_ppp_pap_priv *priv = malloc(sizeof(struct analyzer_ppp_pap_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_ppp_pap_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_ppp_pap_priv)); analyzer->priv = priv; priv->evt_request = event_find("ppp_pap_request"); priv->evt_ack_nack = event_find("ppp_pap_ack_nack"); if (!priv->evt_request || !priv->evt_ack_nack) goto err; static struct data_item_reg evt_auth_data_items[ANALYZER_PPP_PAP_AUTH_DATA_COUNT] = { { 0 } }; evt_auth_data_items[analyzer_ppp_pap_auth_client].name = "client"; evt_auth_data_items[analyzer_ppp_pap_auth_client].flags = DATA_REG_FLAG_NO_ALLOC; evt_auth_data_items[analyzer_ppp_pap_auth_server].name = "server"; evt_auth_data_items[analyzer_ppp_pap_auth_server].flags = DATA_REG_FLAG_NO_ALLOC; evt_auth_data_items[analyzer_ppp_pap_auth_top_proto].name = "top_proto"; evt_auth_data_items[analyzer_ppp_pap_auth_top_proto].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_ppp_pap_auth_vlan].name = "vlan"; evt_auth_data_items[analyzer_ppp_pap_auth_vlan].flags = DATA_REG_FLAG_NO_ALLOC; evt_auth_data_items[analyzer_ppp_pap_auth_identifier].name = "identifier"; evt_auth_data_items[analyzer_ppp_pap_auth_identifier].value_type = ptype_get_type("uint8"); evt_auth_data_items[analyzer_ppp_pap_auth_success].name = "success"; evt_auth_data_items[analyzer_ppp_pap_auth_success].value_type = ptype_get_type("bool"); evt_auth_data_items[analyzer_ppp_pap_auth_peer_id].name = "peer_id"; evt_auth_data_items[analyzer_ppp_pap_auth_peer_id].value_type = ptype_get_type("string"); evt_auth_data_items[analyzer_ppp_pap_auth_password].name = "password"; evt_auth_data_items[analyzer_ppp_pap_auth_password].value_type = ptype_get_type("string"); static struct data_reg evt_auth_data = { .items = evt_auth_data_items, .data_count = ANALYZER_PPP_PAP_AUTH_DATA_COUNT }; static struct event_reg_info analyzer_ppp_pap_evt_auth = { 0 }; analyzer_ppp_pap_evt_auth.source_name = "analyzer_ppp_pap"; analyzer_ppp_pap_evt_auth.source_obj = analyzer; analyzer_ppp_pap_evt_auth.name = "ppp_pap_auth"; analyzer_ppp_pap_evt_auth.description = "PPP PAP MD5 authentication"; analyzer_ppp_pap_evt_auth.data_reg = &evt_auth_data; analyzer_ppp_pap_evt_auth.listeners_notify = analyzer_ppp_pap_event_listeners_notify; priv->evt_auth = event_register(&analyzer_ppp_pap_evt_auth); if (!priv->evt_auth) goto err; return POM_OK; err: analyzer_ppp_pap_cleanup(analyzer); return POM_ERR; }
int analyzer_eap_init(struct analyzer *analyzer) { struct analyzer_eap_priv *priv = malloc(sizeof(struct analyzer_eap_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_eap_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_eap_priv)); analyzer->priv = priv; priv->evt_md5_challenge = event_find("eap_md5_challenge"); priv->evt_success_failure = event_find("eap_success_failure"); if (!priv->evt_md5_challenge || !priv->evt_success_failure) goto err; static struct data_item_reg evt_md5_auth_data_items[ANALYZER_EAP_MD5_AUTH_DATA_COUNT] = { { 0 } }; evt_md5_auth_data_items[analyzer_eap_common_client].name = "client"; evt_md5_auth_data_items[analyzer_eap_common_client].flags = DATA_REG_FLAG_NO_ALLOC; evt_md5_auth_data_items[analyzer_eap_common_server].name = "server"; evt_md5_auth_data_items[analyzer_eap_common_server].flags = DATA_REG_FLAG_NO_ALLOC; evt_md5_auth_data_items[analyzer_eap_common_top_proto].name = "top_proto"; evt_md5_auth_data_items[analyzer_eap_common_top_proto].value_type = ptype_get_type("string"); evt_md5_auth_data_items[analyzer_eap_common_vlan].name = "vlan"; evt_md5_auth_data_items[analyzer_eap_common_vlan].flags = DATA_REG_FLAG_NO_ALLOC; evt_md5_auth_data_items[analyzer_eap_common_identifier].name = "identifier"; evt_md5_auth_data_items[analyzer_eap_common_identifier].value_type = ptype_get_type("uint8"); evt_md5_auth_data_items[analyzer_eap_common_username].name = "username"; evt_md5_auth_data_items[analyzer_eap_common_username].value_type = ptype_get_type("string"); evt_md5_auth_data_items[analyzer_eap_common_success].name = "success"; evt_md5_auth_data_items[analyzer_eap_common_success].value_type = ptype_get_type("bool"); evt_md5_auth_data_items[analyzer_eap_md5_challenge].name = "challenge"; evt_md5_auth_data_items[analyzer_eap_md5_challenge].value_type = ptype_get_type("bytes"); evt_md5_auth_data_items[analyzer_eap_md5_response].name = "response"; evt_md5_auth_data_items[analyzer_eap_md5_response].value_type = ptype_get_type("bytes"); static struct data_reg evt_md5_auth_data = { .items = evt_md5_auth_data_items, .data_count = ANALYZER_EAP_MD5_AUTH_DATA_COUNT }; static struct event_reg_info analyzer_eap_evt_md5_auth = { 0 }; analyzer_eap_evt_md5_auth.source_name = "analyzer_eap"; analyzer_eap_evt_md5_auth.source_obj = analyzer; analyzer_eap_evt_md5_auth.name = "eap_md5_auth"; analyzer_eap_evt_md5_auth.description = "PPP CHAP MD5 authentication"; analyzer_eap_evt_md5_auth.data_reg = &evt_md5_auth_data; analyzer_eap_evt_md5_auth.listeners_notify = analyzer_eap_event_listeners_notify; priv->evt_md5_auth = event_register(&analyzer_eap_evt_md5_auth); if (!priv->evt_md5_auth) goto err; return POM_OK; err: analyzer_eap_cleanup(analyzer); return POM_ERR; }
static int proto_ppp_pap_init(struct proto *proto, struct registry_instance *i) { if (proto_number_register("ppp", 0xc023, proto) != POM_OK) return POM_ERR; struct proto_ppp_pap_priv *priv = malloc(sizeof(struct proto_ppp_pap_priv)); if (!priv) { pom_oom(sizeof(struct proto_ppp_pap_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct proto_ppp_pap_priv)); proto_set_priv(proto, priv); static struct data_item_reg evt_request_data_items[PROTO_PPP_PAP_EVT_REQUEST_DATA_COUNT] = { { 0 } }; evt_request_data_items[evt_ppp_pap_request_code].name = "code"; evt_request_data_items[evt_ppp_pap_request_code].value_type = ptype_get_type("uint8"); evt_request_data_items[evt_ppp_pap_request_identifier].name = "identifier"; evt_request_data_items[evt_ppp_pap_request_identifier].value_type = ptype_get_type("uint8"); evt_request_data_items[evt_ppp_pap_request_peer_id].name = "peer_id"; evt_request_data_items[evt_ppp_pap_request_peer_id].value_type = ptype_get_type("string"); evt_request_data_items[evt_ppp_pap_request_password].name = "password"; evt_request_data_items[evt_ppp_pap_request_password].value_type = ptype_get_type("string"); static struct data_reg evt_ppp_pap_request_data = { .items = evt_request_data_items, .data_count = PROTO_PPP_PAP_EVT_REQUEST_DATA_COUNT }; static struct event_reg_info proto_ppp_pap_request = { 0 }; proto_ppp_pap_request.source_name = "proto_ppp_pap"; proto_ppp_pap_request.source_obj = priv; proto_ppp_pap_request.name = "ppp_pap_request"; proto_ppp_pap_request.description = "PPP PAP Authentication request"; proto_ppp_pap_request.data_reg = &evt_ppp_pap_request_data; priv->evt_request = event_register(&proto_ppp_pap_request); if (!priv->evt_request) goto err; static struct data_item_reg evt_ack_nack_data_items[PROTO_PPP_PAP_EVT_ACK_NACK_DATA_COUNT] = { { 0 } }; evt_ack_nack_data_items[evt_ppp_pap_ack_nack_code].name = "code"; evt_ack_nack_data_items[evt_ppp_pap_ack_nack_code].value_type = ptype_get_type("uint8"); evt_ack_nack_data_items[evt_ppp_pap_ack_nack_identifier].name = "identifier"; evt_ack_nack_data_items[evt_ppp_pap_ack_nack_identifier].value_type = ptype_get_type("uint8"); evt_ack_nack_data_items[evt_ppp_pap_ack_nack_message].name = "message"; evt_ack_nack_data_items[evt_ppp_pap_ack_nack_message].value_type = ptype_get_type("string"); static struct data_reg evt_ppp_pap_ack_nack_data = { .items = evt_ack_nack_data_items, .data_count = PROTO_PPP_PAP_EVT_ACK_NACK_DATA_COUNT }; static struct event_reg_info proto_ppp_pap_ack_nack = { 0 }; proto_ppp_pap_ack_nack.source_name = "proto_ppp_pap"; proto_ppp_pap_ack_nack.source_obj = priv; proto_ppp_pap_ack_nack.name = "ppp_pap_ack_nack"; proto_ppp_pap_ack_nack.description = "PPP-PAP ACK/NACK"; proto_ppp_pap_ack_nack.data_reg = &evt_ppp_pap_ack_nack_data; priv->evt_ack_nack = event_register(&proto_ppp_pap_ack_nack); if (!priv->evt_ack_nack) goto err; priv->p_auth_timeout = ptype_alloc_unit("uint32", "seconds"); if (!priv->p_auth_timeout) goto err; struct registry_param *p = registry_new_param("auth_timeout", "60", priv->p_auth_timeout, "Authentication timeout", 0); if (proto_add_param(proto, p) != POM_OK) { registry_cleanup_param(p); goto err; } return POM_OK; err: proto_ppp_pap_cleanup(priv); return POM_ERR; }
static int analyzer_rtp_init(struct analyzer *analyzer) { struct analyzer_rtp_priv *priv = malloc(sizeof(struct analyzer_rtp_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_rtp_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_rtp_priv)); analyzer->priv = priv; priv->proto_rtp = proto_get("rtp"); if (!priv->proto_rtp) goto err; static struct data_item_reg evt_rtp_stream_data_items[ANALYZER_RTP_STREAM_DATA_COUNT] = { { 0 } }; evt_rtp_stream_data_items[analyzer_rtp_stream_src_addr].name = "src_addr"; evt_rtp_stream_data_items[analyzer_rtp_stream_src_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_rtp_stream_data_items[analyzer_rtp_stream_dst_addr].name = "dst_addr"; evt_rtp_stream_data_items[analyzer_rtp_stream_dst_addr].flags = DATA_REG_FLAG_NO_ALLOC; evt_rtp_stream_data_items[analyzer_rtp_stream_src_port].name = "src_port"; evt_rtp_stream_data_items[analyzer_rtp_stream_src_port].value_type = ptype_get_type("uint16"); evt_rtp_stream_data_items[analyzer_rtp_stream_dst_port].name = "dst_port"; evt_rtp_stream_data_items[analyzer_rtp_stream_dst_port].value_type = ptype_get_type("uint16"); evt_rtp_stream_data_items[analyzer_rtp_stream_sess_proto].name = "sess_proto"; evt_rtp_stream_data_items[analyzer_rtp_stream_sess_proto].value_type = ptype_get_type("string"); evt_rtp_stream_data_items[analyzer_rtp_stream_call_id].name = "call_id"; evt_rtp_stream_data_items[analyzer_rtp_stream_call_id].value_type = ptype_get_type("string"); evt_rtp_stream_data_items[analyzer_rtp_stream_ssrc].name = "ssrc"; evt_rtp_stream_data_items[analyzer_rtp_stream_ssrc].value_type = ptype_get_type("uint32"); static struct data_reg evt_rtp_stream_data = { .items = evt_rtp_stream_data_items, .data_count = ANALYZER_RTP_STREAM_DATA_COUNT }; static struct event_reg_info analyzer_rtp_evt_stream = { 0 }; analyzer_rtp_evt_stream.source_name = "analyzer_rtp"; analyzer_rtp_evt_stream.source_obj = analyzer; analyzer_rtp_evt_stream.name = "rtp_stream"; analyzer_rtp_evt_stream.description = "RTP stream in a single direction"; analyzer_rtp_evt_stream.data_reg = &evt_rtp_stream_data; analyzer_rtp_evt_stream.flags = EVENT_REG_FLAG_PAYLOAD; analyzer_rtp_evt_stream.listeners_notify = analyzer_rtp_event_listeners_notify; analyzer_rtp_evt_stream.cleanup = analyzer_rtp_stream_event_cleanup; priv->evt_rtp_stream = event_register(&analyzer_rtp_evt_stream); if (!priv->evt_rtp_stream) goto err; return POM_OK; err: analyzer_rtp_cleanup(analyzer); return POM_ERR; }
static int proto_eap_init(struct proto *proto, struct registry_instance *i) { if (proto_number_register("8021x", 0x0, proto) != POM_OK || proto_number_register("ppp", 0xc227, proto) != POM_OK) return POM_ERR; struct proto_eap_priv *priv = malloc(sizeof(struct proto_eap_priv)); if (!priv) { pom_oom(sizeof(struct proto_eap_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct proto_eap_priv)); proto_set_priv(proto, priv); priv->p_timeout = ptype_alloc_unit("uint32", "seconds"); if (!priv->p_timeout) goto err; struct registry_param *p = registry_new_param("timeout", "60", priv->p_timeout, "Transaction timeout", 0); if (registry_instance_add_param(i, p) != POM_OK) { registry_cleanup_param(p); goto err; } static struct data_item_reg evt_identity_data_items[PROTO_EAP_EVT_IDENTITY_DATA_COUNT] = { { 0 } }; evt_identity_data_items[evt_eap_common_identifier].name = "identifier"; evt_identity_data_items[evt_eap_common_identifier].value_type = ptype_get_type("uint8"); evt_identity_data_items[evt_eap_common_code].name = "code"; evt_identity_data_items[evt_eap_common_code].value_type = ptype_get_type("uint8"); evt_identity_data_items[evt_eap_identity_identity].name = "identity"; evt_identity_data_items[evt_eap_identity_identity].value_type = ptype_get_type("string"); static struct data_reg evt_eap_identity_data = { .items = evt_identity_data_items, .data_count = PROTO_EAP_EVT_IDENTITY_DATA_COUNT }; static struct event_reg_info proto_eap_identity = { 0 }; proto_eap_identity.source_name = "proto_eap"; proto_eap_identity.source_obj = priv; proto_eap_identity.name = "eap_identity"; proto_eap_identity.description = "EAP Identity"; proto_eap_identity.data_reg = &evt_eap_identity_data; priv->evt_identity = event_register(&proto_eap_identity); if (!priv->evt_identity) goto err; static struct data_item_reg evt_md5_challenge_data_items[PROTO_EAP_EVT_MD5_CHALLENGE_DATA_COUNT] = { { 0 } }; evt_md5_challenge_data_items[evt_eap_common_identifier].name = "identifier"; evt_md5_challenge_data_items[evt_eap_common_identifier].value_type = ptype_get_type("uint8"); evt_md5_challenge_data_items[evt_eap_common_code].name = "code"; evt_md5_challenge_data_items[evt_eap_common_code].value_type = ptype_get_type("uint8"); evt_md5_challenge_data_items[evt_eap_md5_challenge_value].name = "value"; evt_md5_challenge_data_items[evt_eap_md5_challenge_value].value_type = ptype_get_type("bytes"); evt_md5_challenge_data_items[evt_eap_md5_challenge_name].name = "name"; evt_md5_challenge_data_items[evt_eap_md5_challenge_name].value_type = ptype_get_type("string"); static struct data_reg evt_eap_md5_challenge_data = { .items = evt_md5_challenge_data_items, .data_count = PROTO_EAP_EVT_MD5_CHALLENGE_DATA_COUNT }; static struct event_reg_info proto_eap_md5_challenge = { 0 }; proto_eap_md5_challenge.source_name = "proto_eap"; proto_eap_md5_challenge.source_obj = priv; proto_eap_md5_challenge.name = "eap_md5_challenge"; proto_eap_md5_challenge.description = "EAP MD5-Challenge"; proto_eap_md5_challenge.data_reg = &evt_eap_md5_challenge_data; priv->evt_md5_challenge = event_register(&proto_eap_md5_challenge); if (!priv->evt_md5_challenge) goto err; static struct data_item_reg evt_success_failure_data_items[PROTO_EAP_EVT_SUCCESS_FAILURE_DATA_COUNT] = { { 0 } }; evt_success_failure_data_items[evt_eap_common_identifier].name = "identifier"; evt_success_failure_data_items[evt_eap_common_identifier].value_type = ptype_get_type("uint8"); evt_success_failure_data_items[evt_eap_success_failure_success].name = "success"; evt_success_failure_data_items[evt_eap_success_failure_success].value_type = ptype_get_type("bool"); static struct data_reg evt_eap_success_failure_data = { .items = evt_success_failure_data_items, .data_count = PROTO_EAP_EVT_SUCCESS_FAILURE_DATA_COUNT }; static struct event_reg_info proto_eap_success_failure = { 0 }; proto_eap_success_failure.source_name = "proto_eap"; proto_eap_success_failure.source_obj = priv; proto_eap_success_failure.name = "eap_success_failure"; proto_eap_success_failure.description = "EAP Success/Failure"; proto_eap_success_failure.data_reg = &evt_eap_success_failure_data; priv->evt_success_failure = event_register(&proto_eap_success_failure); if (!priv->evt_success_failure) goto err; return POM_OK; err: proto_eap_cleanup(priv); return POM_ERR; }
static int analyzer_arp_init(struct analyzer *analyzer) { struct analyzer_arp_priv *priv = malloc(sizeof(struct analyzer_arp_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_arp_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_arp_priv)); analyzer->priv = priv; if (pthread_mutex_init(&priv->lock, NULL)) { pomlog(POMLOG_ERR "Error while initializing table lock : %s", pom_strerror(errno)); free(priv); return POM_ERR; } priv->proto_vlan = proto_get("vlan"); if (!priv->proto_vlan) goto err; static struct data_item_reg evt_new_sta_data_items[ANALYZER_ARP_EVT_NEW_STA_DATA_COUNT] = { { 0 } }; evt_new_sta_data_items[analyzer_arp_new_sta_mac_addr].name = "mac_addr"; evt_new_sta_data_items[analyzer_arp_new_sta_mac_addr].value_type = ptype_get_type("mac"); evt_new_sta_data_items[analyzer_arp_new_sta_ip_addr].name = "ip_addr"; evt_new_sta_data_items[analyzer_arp_new_sta_ip_addr].value_type = ptype_get_type("ipv4"); evt_new_sta_data_items[analyzer_arp_new_sta_vlan].name = "vlan"; evt_new_sta_data_items[analyzer_arp_new_sta_vlan].value_type = ptype_get_type("uint16"); evt_new_sta_data_items[analyzer_arp_new_sta_input].name = "input"; evt_new_sta_data_items[analyzer_arp_new_sta_input].value_type = ptype_get_type("string"); static struct data_reg evt_new_sta_data = { .items = evt_new_sta_data_items, .data_count = ANALYZER_ARP_EVT_NEW_STA_DATA_COUNT }; static struct event_reg_info analyzer_arp_evt_new_sta = { 0 }; analyzer_arp_evt_new_sta.source_name = "analyzer_arp"; analyzer_arp_evt_new_sta.source_obj = analyzer; analyzer_arp_evt_new_sta.name = "arp_new_sta"; analyzer_arp_evt_new_sta.description = "New station found"; analyzer_arp_evt_new_sta.data_reg = &evt_new_sta_data; analyzer_arp_evt_new_sta.listeners_notify = analyzer_arp_event_listeners_notify; priv->evt_new_sta = event_register(&analyzer_arp_evt_new_sta); if (!priv->evt_new_sta) goto err; static struct data_item_reg evt_sta_changed_data_items[ANALYZER_ARP_EVT_STA_CHANGED_DATA_COUNT] = { { 0 } }; evt_sta_changed_data_items[analyzer_arp_sta_changed_old_mac_addr].name = "old_mac_addr"; evt_sta_changed_data_items[analyzer_arp_sta_changed_old_mac_addr].value_type = ptype_get_type("mac"); evt_sta_changed_data_items[analyzer_arp_sta_changed_new_mac_addr].name = "new_mac_addr"; evt_sta_changed_data_items[analyzer_arp_sta_changed_new_mac_addr].value_type = ptype_get_type("mac"); evt_sta_changed_data_items[analyzer_arp_sta_changed_ip_addr].name = "ip_addr"; evt_sta_changed_data_items[analyzer_arp_sta_changed_ip_addr].value_type = ptype_get_type("ipv4"); evt_sta_changed_data_items[analyzer_arp_sta_changed_vlan].name = "vlan"; evt_sta_changed_data_items[analyzer_arp_sta_changed_vlan].value_type = ptype_get_type("uint16"); evt_sta_changed_data_items[analyzer_arp_sta_changed_input].name = "input"; evt_sta_changed_data_items[analyzer_arp_sta_changed_input].value_type = ptype_get_type("string"); static struct data_reg evt_sta_changed_data = { .items = evt_sta_changed_data_items, .data_count = ANALYZER_ARP_EVT_STA_CHANGED_DATA_COUNT }; static struct event_reg_info analyzer_arp_evt_sta_changed = { 0 }; analyzer_arp_evt_sta_changed.source_name = "analyzer_arp"; analyzer_arp_evt_sta_changed.source_obj = analyzer; analyzer_arp_evt_sta_changed.name = "arp_sta_changed"; analyzer_arp_evt_sta_changed.description = "Station MAC address changed"; analyzer_arp_evt_sta_changed.data_reg = &evt_sta_changed_data; analyzer_arp_evt_sta_changed.listeners_notify = analyzer_arp_event_listeners_notify; priv->evt_sta_changed = event_register(&analyzer_arp_evt_sta_changed); if (!priv->evt_sta_changed) goto err; return POM_OK; err: analyzer_arp_cleanup(analyzer); return POM_ERR; }
static int analyzer_docsis_init(struct analyzer *analyzer) { struct analyzer_docsis_priv *priv = malloc(sizeof(struct analyzer_docsis_priv)); if (!priv) { pom_oom(sizeof(struct analyzer_docsis_priv)); return POM_ERR; } memset(priv, 0, sizeof(struct analyzer_docsis_priv)); analyzer->priv = priv; if (pthread_mutex_init(&priv->lock, NULL)) { pomlog(POMLOG_ERR "Error while initializing table lock : %s", pom_strerror(errno)); free(priv); return POM_ERR; } static struct data_item_reg evt_cm_new_data_items[ANALYZER_DOCSIS_EVT_CM_NEW_DATA_COUNT] = { { 0 } }; evt_cm_new_data_items[analyzer_docsis_cm_new_mac].name = "mac", evt_cm_new_data_items[analyzer_docsis_cm_new_mac].value_type = ptype_get_type("mac"); evt_cm_new_data_items[analyzer_docsis_cm_new_input].name = "input", evt_cm_new_data_items[analyzer_docsis_cm_new_input].value_type = ptype_get_type("string"); static struct data_reg evt_cm_new_data = { .items = evt_cm_new_data_items, .data_count = ANALYZER_DOCSIS_EVT_CM_NEW_DATA_COUNT }; static struct event_reg_info analyzer_docsis_evt_cm_new = { 0 }; analyzer_docsis_evt_cm_new.source_name = "analyzer_docsis"; analyzer_docsis_evt_cm_new.source_obj = analyzer; analyzer_docsis_evt_cm_new.name = "docsis_cm_new"; analyzer_docsis_evt_cm_new.description = "New cable modem found"; analyzer_docsis_evt_cm_new.data_reg = &evt_cm_new_data; analyzer_docsis_evt_cm_new.listeners_notify = analyzer_docsis_event_listeners_notify; priv->evt_cm_new = event_register(&analyzer_docsis_evt_cm_new); if (!priv->evt_cm_new) goto err; static struct data_item_reg evt_cm_reg_status_data_items[ANALYZER_DOCSIS_EVT_CM_REG_STATUS_DATA_COUNT] = { { 0 } }; evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_old].name = "old_status", evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_old].value_type = ptype_get_type("uint8"); evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_new].name = "new_status", evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_new].value_type = ptype_get_type("uint8"); evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_mac].name = "mac"; evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_mac].value_type = ptype_get_type("mac"); evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_timeout].name = "timeout", evt_cm_reg_status_data_items[analyzer_docsis_cm_reg_status_timeout].value_type = ptype_get_type("uint8"); static struct data_reg evt_cm_reg_status_data = { .items = evt_cm_reg_status_data_items, .data_count = ANALYZER_DOCSIS_EVT_CM_REG_STATUS_DATA_COUNT }; static struct event_reg_info analyzer_docsis_evt_cm_reg_status = { 0 }; analyzer_docsis_evt_cm_reg_status.source_name = "analyzer_docsis"; analyzer_docsis_evt_cm_reg_status.source_obj = analyzer; analyzer_docsis_evt_cm_reg_status.name = "docsis_cm_reg_status"; analyzer_docsis_evt_cm_reg_status.description = "Cable modem registration status changed"; analyzer_docsis_evt_cm_reg_status.data_reg = &evt_cm_reg_status_data; analyzer_docsis_evt_cm_reg_status.listeners_notify = analyzer_docsis_event_listeners_notify; priv->evt_cm_reg_status = event_register(&analyzer_docsis_evt_cm_reg_status); if (!priv->evt_cm_reg_status) goto err; return POM_OK; err: analyzer_docsis_cleanup(analyzer); return POM_ERR; }