Пример #1
0
static char const *mgcp_info_2_str(struct proto_info const *info_)
{
    struct mgcp_proto_info const *info = DOWNCAST(info_, info, mgcp_proto_info);
    return tempstr_printf("%s, %s, %s",
        proto_info_2_str(info_),
        info->response ? mgcp_resp_2_str(&info->u.resp) : mgcp_query_2_str(&info->u.query),
        mgcp_params_2_str(info));
}
Пример #2
0
static char const *udp_info_2_str(struct proto_info const *info_)
{
    struct udp_proto_info const *info = DOWNCAST(info_, info, udp_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, ports=%"PRIu16"->%"PRIu16,
        proto_info_2_str(info_),
        info->key.port[0], info->key.port[1]);
    return str;
}
Пример #3
0
static char const *cifs_info_2_str(struct proto_info const *info_)
{
    struct cifs_proto_info const *info = DOWNCAST(info_, info, cifs_proto_info);
    char *str = tempstr_printf("%s, command=%#04x, status=0x%08"PRIx32,
            proto_info_2_str(info_),
            info->command,
            info->status);
    return str;
}
Пример #4
0
Файл: tds.c Проект: iHaD/junkie
char const *tds_info_2_str(struct proto_info const *info_)
{
    struct tds_proto_info const *info = DOWNCAST(info_, info, tds_proto_info);
    char *str = tempstr_printf("%s, type=%s, status=0x%x, length=%"PRIu16"",
            proto_info_2_str(info_),
            tds_packet_type_2_str(info->type),
            info->status, info->length);
    return str;
}
Пример #5
0
static char const *rtp_info_2_str(struct proto_info const *info_)
{
    struct rtp_proto_info const *info = DOWNCAST(info_, info, rtp_proto_info);
    char *str = tempstr();

    snprintf(str, TEMPSTR_SIZE, "%s, payload_type=%s, SSRC=%"PRIu32", seqnum=%"PRIu16", timestamp=%"PRIu32,
        proto_info_2_str(info_), rtp_payload_type_2_str(info->payload_type), info->sync_src, info->seq_num, info->timestamp);

    return str;
}
Пример #6
0
static char const *cap_info_2_str(struct proto_info const *info_)
{
    struct cap_proto_info const *info = DOWNCAST(info_, info, cap_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, dev_id=%u, tv=%s",
        proto_info_2_str(info_),
        info->dev_id,
        timeval_2_str(&info->tv));
    return str;
}
Пример #7
0
static char const *fcoe_info_2_str(struct proto_info const *info_)
{
    struct fcoe_proto_info *info = DOWNCAST(info_, info, fcoe_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, version=%d, sof=0x%02x, eof=0x%02x",
             proto_info_2_str(info_),
             info->version,
             info->sof,
             info->eof);
    return str;
}
Пример #8
0
static char const *icmp_info_2_str(struct proto_info const *info_)
{
    struct icmp_proto_info const *info = DOWNCAST(info_, info, icmp_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, type=%s, err=%s",
        proto_info_2_str(info_),
        icmp_type_2_str(info->type, info->code),
        info->set_values & ICMP_ERR_SET ? icmp_err_2_str(&info->err, info->set_values) : "NONE");

    return str;
}
Пример #9
0
static char const *sdp_info_2_str(struct proto_info const *info_)
{
    struct sdp_proto_info const *info = DOWNCAST(info_, info, sdp_proto_info);
    char *str = tempstr();

    snprintf(str, TEMPSTR_SIZE, "%s, host=%s, port=%s",
             proto_info_2_str(info_),
             info->set_values & SDP_HOST_SET ? ip_addr_2_str(&info->host) : "unset",
             info->set_values & SDP_PORT_SET ? tempstr_printf("%u", info->port) : "unset");

    return str;
}
Пример #10
0
static char const *eth_info_2_str(struct proto_info const *info_)
{
    struct eth_proto_info const *info = DOWNCAST(info_, info, eth_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, vlan_id=%d, source=%s, dest=%s, proto=%s",
        proto_info_2_str(info_),
        info->vlan_id,
        eth_addr_2_str(info->addr[0]),
        eth_addr_2_str(info->addr[1]),
        eth_proto_2_str(info->protocol));
    return str;
}
Пример #11
0
// Not the same than ICMP(v4) since the error codes are different.
static char const *icmpv6_info_2_str(struct proto_info const *info_)
{
    struct icmp_proto_info const *info = DOWNCAST(info_, info, icmp_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, type=%s, code=%"PRIu8", err=%s, id=%d",
        proto_info_2_str(info_),
        icmpv6_type_2_str(info->type), info->code,
        info->set_values & ICMP_ERR_SET ? icmp_err_2_str(&info->err, info->set_values) : "NONE",
        info->set_values & ICMP_ID_SET ? info->id : -1);

    return str;
}
Пример #12
0
static char const *dhcp_info_2_str(struct proto_info const *info_)
{
    struct dhcp_proto_info const *info = DOWNCAST(info_, info, dhcp_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, opcode=%s, msg_type=%s, xid=0x%x, client_ip=%s, client_mac=%s, server=%s",
        proto_info_2_str(info_),
        dhcp_opcode_2_str(info->opcode),
        dhcp_msg_type_2_str(info->msg_type),
        info->xid,
        info->set_values & DHCP_CLIENT_SET     ? ip_addr_2_str(&info->client) : "unset",
        info->hw_addr_is_eth ? eth_addr_2_str(info->client_mac) : "not eth",
        info->server_name[0] != '\0' ? info->server_name : "unset");

    return str;
}
Пример #13
0
static char const *skinny_info_2_str(struct proto_info const *info_)
{
    struct skinny_proto_info const *info = DOWNCAST(info_, info, skinny_proto_info);
    return tempstr_printf("%s, MsgId:%s%s%s%s%s%s%s%s%s%s",
        proto_info_2_str(&info->info),
        skinny_msgid_2_str(info->msgid),
        info->set_values & SKINNY_NEW_KEY_PAD   ? tempstr_printf(", Key:%"PRIu32,        info->new_key_pad):"",
        info->set_values & SKINNY_LINE_INSTANCE ? tempstr_printf(", Line:%"PRIu32,       info->line_instance):"",
        info->set_values & SKINNY_CALL_ID       ? tempstr_printf(", CallId:%"PRIu32,     info->call_id):"",
        info->set_values & SKINNY_CONFERENCE_ID ? tempstr_printf(", ConfId:%"PRIu32,     info->conf_id):"",
        info->set_values & SKINNY_PASS_THRU_ID  ? tempstr_printf(", PassThruId:%"PRIu32, info->pass_thru_id):"",
        info->set_values & SKINNY_CALL_STATE    ? tempstr_printf(", CallState:%s", skinny_call_state_2_str(info->call_state)):"",
        info->set_values & SKINNY_MEDIA_CNX     ? tempstr_printf(", MediaIp:%s:%"PRIu16, ip_addr_2_str(&info->media_ip), info->media_port):"",
        info->set_values & SKINNY_CALLING_PARTY ? tempstr_printf(", CallingParty:%s",    info->calling_party):"",
        info->set_values & SKINNY_CALLED_PARTY  ? tempstr_printf(", CalledParty:%s",     info->called_party):"");
}
Пример #14
0
Файл: sip.c Проект: rixed/junkie
static char const *sip_info_2_str(struct proto_info const *info_)
{
    struct sip_proto_info const *info = DOWNCAST(info_, info, sip_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, cmd=%s, cseq=%s, via=%s, code=%s, mime_type=%s, content-length=%s, call-id=%s, from=%s, to=%s",
             proto_info_2_str(info_),
             info->set_values & SIP_CMD_SET    ? sip_cmd_2_str(info->cmd)          : "unset",
             info->set_values & SIP_CSEQ_SET   ? tempstr_printf("%lu", info->cseq) : "unset",
             info->set_values & SIP_VIA_SET    ? via_2_str(&info->via)             : "unset",
             info->set_values & SIP_CODE_SET   ? tempstr_printf("%u", info->code)  : "unset",
             info->set_values & SIP_MIME_SET   ? info->mime_type                   : "unset",
             info->set_values & SIP_LENGTH_SET ? tempstr_printf("%u", info->content_length) : "unset",
             info->set_values & SIP_CALLID_SET ? info->call_id                     : "unset",
             info->set_values & SIP_FROM_SET   ? info->from                        : "unset",
             info->set_values & SIP_TO_SET     ? info->to                          : "unset");

    return str;
}
Пример #15
0
static char const *tcp_info_2_str(struct proto_info const *info_)
{
    struct tcp_proto_info const *info = DOWNCAST(info_, info, tcp_proto_info);
    char *str = tempstr();
    snprintf(str, TEMPSTR_SIZE, "%s, ports=%"PRIu16"%s->%"PRIu16"%s, flags=%s%s%s%s%s%s, win=%"PRIu16", ack=%"PRIu32", seq=%"PRIu32" (%"PRIu32"), urg=%"PRIx16", opts=%s",
        proto_info_2_str(info_),
        info->key.port[0], info->to_srv ? "":"(srv)",
        info->key.port[1], info->to_srv ? "(srv)":"",
        info->syn ? "Syn":"",
        info->ack ? "Ack":"",
        info->rst ? "Rst":"",
        info->fin ? "Fin":"",
        info->urg ? "Urg":"",
        info->psh ? "Psh":"",
        info->window,
        info->ack_num,
        info->seq_num,
        info->rel_seq_num,
        info->urg_ptr,
        tcp_options_2_str(info));
    return str;
}
Пример #16
0
char const *sql_info_2_str(struct proto_info const *info_)
{
    struct sql_proto_info const *info = DOWNCAST(info_, info, sql_proto_info);
    char *str = tempstr();

    char const *(*spec_info_2_str)(struct sql_proto_info const *) = NULL;
    switch (info->msg_type) {
        case SQL_UNKNOWN:
            break;
        case SQL_STARTUP:
            spec_info_2_str = info->is_query ? startup_query_2_str : startup_reply_2_str;
            break;
        case SQL_QUERY:
            spec_info_2_str = info->is_query ? query_query_2_str : query_reply_2_str;
            break;
        case SQL_EXIT:
            spec_info_2_str = exit_2_str;
            break;
    }

    snprintf(str, TEMPSTR_SIZE, "%s, %s%s, %s%s%s%s%s%s%s%s%s%s",
        proto_info_2_str(info_),
        info->is_query ? "Clt->Srv" : "Srv->Clt",
        version_info_2_str(info),
        sql_msg_type_2_str(info->msg_type),
        spec_info_2_str ? spec_info_2_str(info) : "",
        info->set_values & SQL_REQUEST_STATUS ? ", Status=" : "",
        info->set_values & SQL_REQUEST_STATUS ? sql_request_status_2_str(info->request_status) : "",
        info->set_values & SQL_ERROR_SQL_STATUS ? ", SqlCode=" : "",
        info->set_values & SQL_ERROR_SQL_STATUS ? info->error_sql_status : "",
        info->set_values & SQL_ERROR_CODE ? ", ErrorCode=" : "",
        info->set_values & SQL_ERROR_CODE ? info->error_code : "",
        info->set_values & SQL_ERROR_MESSAGE ? ", ErrorMessage=" : "",
        info->set_values & SQL_ERROR_MESSAGE ? info->error_message : "");
    return str;
}