]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Sockets/RawIp4Tx/Windows/main.c
AppPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / AppPkg / Applications / Sockets / RawIp4Tx / Windows / main.c
CommitLineData
59bc0593 1/** @file\r
2 Windows version of the raw IP4 transmit application\r
3\r
bcb96695
MK
4 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
59bc0593 6\r
7**/\r
8\r
9#include <RawIp4Tx.h>\r
10\r
11\r
12/**\r
13 Transmit raw IP4 packets to the remote system.\r
14\r
15 Please note that this program must be run with administrator privileges!\r
16\r
17 @param [in] argc The number of arguments\r
18 @param [in] argv The argument value array\r
19\r
20 @retval 0 The application exited normally.\r
21 @retval Other An error occurred.\r
22**/\r
23int\r
24main(\r
25 int argc,\r
26 char ** argv\r
27 )\r
28{\r
29 int RetVal;\r
30 WSADATA WsaData;\r
31\r
32 //\r
33 // Initialize the WinSock layer\r
34 //\r
35 RetVal = WSAStartup ( MAKEWORD ( 2, 2 ), &WsaData );\r
36 if ( 0 == RetVal ) {\r
37 //\r
38 // Start the application\r
39 // See http://msdn.microsoft.com/en-us/library/ms740548(v=vs.85).aspx\r
40 //\r
41 RetVal = RawIp4Tx ( argc, argv );\r
42 if ( WSAEACCES == RetVal ) {\r
43 printf ( "Requires administrator privileges to run!\r\n" );\r
44 }\r
45\r
46 //\r
47 // Done with the WinSock layer\r
48 //\r
49 WSACleanup ( );\r
50 }\r
51\r
52 //\r
53 // Return the final result\r
54 //\r
55 return RetVal; \r
56}\r