/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2025-present Eclipse ThreadX Contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Component */ /** */ /** Internet Protocol (IP) */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SOURCE_CODE /* Include necessary system files. */ #include "nx_api.h" #include "nx_ip.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_ip_raw_packet_enable PORTABLE C */ /* 6.4.3 */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function enables IP raw packet sending and receiving */ /* capability by installing the raw packet processing function */ /* pointer. */ /* */ /* INPUT */ /* */ /* ip_ptr Pointer to IP control block */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* None */ /* */ /* CALLED BY */ /* */ /* Application */ /* */ /**************************************************************************/ UINT _nx_ip_raw_packet_enable(NX_IP *ip_ptr) { /* If trace is enabled, insert this event into the trace buffer. */ NX_TRACE_IN_LINE_INSERT(NX_TRACE_IP_RAW_PACKET_ENABLE, ip_ptr, 0, 0, 0, NX_TRACE_IP_EVENTS, 0, 0); /* Enable raw IP packet sending/receiving. */ ip_ptr -> nx_ip_raw_ip_processing = _nx_ip_raw_packet_processing; /* Set the raw packet receive queue max. */ ip_ptr -> nx_ip_raw_received_packet_max = NX_IP_RAW_MAX_QUEUE_DEPTH; /* Return a successful status! */ return(NX_SUCCESS); }