BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[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
9f7f5161 4 Copyright (c) 2011-2012, Intel Corporation\r
59bc0593 5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <RawIp4Tx.h>\r
16\r
17\r
18/**\r
19 Transmit raw IP4 packets to the remote system.\r
20\r
21 Please note that this program must be run with administrator privileges!\r
22\r
23 @param [in] argc The number of arguments\r
24 @param [in] argv The argument value array\r
25\r
26 @retval 0 The application exited normally.\r
27 @retval Other An error occurred.\r
28**/\r
29int\r
30main(\r
31 int argc,\r
32 char ** argv\r
33 )\r
34{\r
35 int RetVal;\r
36 WSADATA WsaData;\r
37\r
38 //\r
39 // Initialize the WinSock layer\r
40 //\r
41 RetVal = WSAStartup ( MAKEWORD ( 2, 2 ), &WsaData );\r
42 if ( 0 == RetVal ) {\r
43 //\r
44 // Start the application\r
45 // See http://msdn.microsoft.com/en-us/library/ms740548(v=vs.85).aspx\r
46 //\r
47 RetVal = RawIp4Tx ( argc, argv );\r
48 if ( WSAEACCES == RetVal ) {\r
49 printf ( "Requires administrator privileges to run!\r\n" );\r
50 }\r
51\r
52 //\r
53 // Done with the WinSock layer\r
54 //\r
55 WSACleanup ( );\r
56 }\r
57\r
58 //\r
59 // Return the final result\r
60 //\r
61 return RetVal; \r
62}\r