MCPcopy Create free account
hub / github.com/F-Stack/f-stack / logsctpparse

Function logsctpparse

freebsd/netinet/libalias/alias_sctp.c:2541–2585  ·  view source on GitHub ↗

@ingroup Logging * @brief Log what the parser parsed * * @param direction Direction of packet * @param sm Pointer to sctp message information */

Source from the content-addressed store, hash-verified

2539 * @param sm Pointer to sctp message information
2540 */
2541static void
2542logsctpparse(int direction, struct sctp_nat_msg *sm)
2543{
2544 char *ploc, *pstate;
2545 switch (direction) {
2546 case SN_TO_LOCAL:
2547 ploc = "TO_LOCAL -";
2548 break;
2549 case SN_TO_GLOBAL:
2550 ploc = "TO_GLOBAL -";
2551 break;
2552 default:
2553 ploc = "";
2554 }
2555 switch (sm->msg) {
2556 case SN_SCTP_INIT:
2557 pstate = "Init";
2558 break;
2559 case SN_SCTP_INITACK:
2560 pstate = "InitAck";
2561 break;
2562 case SN_SCTP_ABORT:
2563 pstate = "Abort";
2564 break;
2565 case SN_SCTP_SHUTACK:
2566 pstate = "ShutAck";
2567 break;
2568 case SN_SCTP_SHUTCOMP:
2569 pstate = "ShutComp";
2570 break;
2571 case SN_SCTP_ASCONF:
2572 pstate = "Asconf";
2573 break;
2574 case SN_SCTP_ASCONFACK:
2575 pstate = "AsconfAck";
2576 break;
2577 case SN_SCTP_OTHER:
2578 pstate = "Other";
2579 break;
2580 default:
2581 pstate = "***ERROR***";
2582 break;
2583 }
2584 SctpAliasLog("Parsed: %s %s\n", ploc, pstate);
2585}
2586
2587/** @ingroup Logging
2588 * @brief Log an SCTP association's details

Callers 1

SctpAliasFunction · 0.85

Calls 1

SctpAliasLogFunction · 0.85

Tested by

no test coverage detected