1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the MIT License which is available at
6 * https://opensource.org/licenses/MIT.
7 *
8 * SPDX-License-Identifier: MIT
9 **************************************************************************/
10
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** NetX Component */
16 /** */
17 /** Internet Protocol (IP) */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22 #define NX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27
28 #include "nx_api.h"
29 #include "nx_ip.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _nxd_ip_raw_packet_send PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* Yuxin Zhou, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function sends a raw IP packet through the primary IP */
45 /* interface to the specified destination. */
46 /* */
47 /* INPUT */
48 /* */
49 /* ip_ptr Pointer to IP control block */
50 /* packet_ptr Pointer to packet to send */
51 /* destination_ip Destination IP address */
52 /* protocol Value for the protocol field */
53 /* ttl Value for ttl or hop limit */
54 /* tos Value for tos or traffic */
55 /* class and flow label */
56 /* */
57 /* OUTPUT */
58 /* */
59 /* status Actual completion status */
60 /* NX_NOT_ENABLED Raw IP processing not enabled */
61 /* */
62 /* CALLS */
63 /* */
64 /* _nxd_ip_raw_packet_source_send Core raw packet send service */
65 /* */
66 /* CALLED BY */
67 /* */
68 /* Application */
69 /* */
70 /* RELEASE HISTORY */
71 /* */
72 /* DATE NAME DESCRIPTION */
73 /* */
74 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
75 /* 09-30-2020 Yuxin Zhou Modified comment(s), */
76 /* resulting in version 6.1 */
77 /* */
78 /**************************************************************************/
_nxd_ip_raw_packet_send(NX_IP * ip_ptr,NX_PACKET * packet_ptr,NXD_ADDRESS * destination_ip,ULONG protocol,UINT ttl,ULONG tos)79 UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr,
80 NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos)
81 {
82
83 UINT status;
84
85 status = _nxd_ip_raw_packet_source_send(ip_ptr, packet_ptr, destination_ip, 0, protocol, ttl, tos);
86
87 return(status);
88 }
89
90