net.h File Reference

Cross platform UDP network code. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NET_BUFFER_SIZE   (0x2000)
#define NET_USE_OS_ASSIGNED_PORT   0

Functions

S32 start_net (S32 &socket_out, int &nPort)
void end_net (S32 &socket_out)
S32 receive_packet (int hSocket, char *receiveBuffer)
BOOL send_packet (int hSocket, const char *sendBuffer, int size, U32 recipient, int nPort)
LLHost get_sender ()
U32 get_sender_port ()
U32 get_sender_ip (void)
const char * u32_to_ip_string (U32 ip)
char * u32_to_ip_string (U32 ip, char *ip_string)
U32 ip_string_to_u32 (const char *ip_string)

Variables

const char * LOOPBACK_ADDRESS_STRING
const S32 MTUBYTES = 1200
const S32 ETHERNET_MTU_BYTES = 1500
const S32 MTUBITS = MTUBYTES*8
const S32 MTUU32S = MTUBITS/32


Detailed Description

Cross platform UDP network code.

LicenseInfo
firstyear=2000&license=viewergpl

Copyright (c) 2000-2007, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file net.h.


Define Documentation

#define NET_BUFFER_SIZE   (0x2000)

Definition at line 38 of file net.h.

Referenced by LLPacketBuffer::LLPacketBuffer(), and receive_packet().

#define NET_USE_OS_ASSIGNED_PORT   0

Definition at line 41 of file net.h.

Referenced by idle_startup(), and start_net().


Function Documentation

void end_net ( S32 socket_out  ) 

Definition at line 467 of file net.cpp.

Referenced by LLMessageSystem::~LLMessageSystem().

LLHost get_sender (  ) 

Definition at line 97 of file net.cpp.

References stSrcAddr.

Referenced by LLPacketBuffer::init(), and LLPacketRing::receivePacket().

U32 get_sender_ip ( void   ) 

Definition at line 102 of file net.cpp.

References stSrcAddr.

U32 get_sender_port (  ) 

Definition at line 107 of file net.cpp.

References stSrcAddr.

U32 ip_string_to_u32 ( const char *  ip_string  ) 

Definition at line 160 of file net.cpp.

Referenced by LLHost::LLHost(), LLHost::set(), and LLHost::setAddress().

S32 receive_packet ( int  hSocket,
char *  receiveBuffer 
)

Definition at line 475 of file net.cpp.

References NET_BUFFER_SIZE, and stSrcAddr.

Referenced by LLPacketBuffer::init(), and LLPacketRing::receivePacket().

BOOL send_packet ( int  hSocket,
const char *  sendBuffer,
int  size,
U32  recipient,
int  nPort 
)

Definition at line 495 of file net.cpp.

References FALSE, llinfos, S32, and TRUE.

Referenced by LLPacketRing::sendPacket().

S32 start_net ( S32 socket_out,
int &  nPort 
)

Definition at line 370 of file net.cpp.

References llformat(), llinfos, llwarns, MAXADDRSTR, NET_USE_OS_ASSIGNED_PORT, PORT_DISCOVERY_RANGE_MAX, PORT_DISCOVERY_RANGE_MIN, RECEIVE_BUFFER_SIZE, and SEND_BUFFER_SIZE.

Referenced by LLMessageSystem::LLMessageSystem().

char* u32_to_ip_string ( U32  ip,
char *  ip_string 
)

Definition at line 136 of file net.cpp.

References NULL.

const char* u32_to_ip_string ( U32  ip  ) 

Definition at line 112 of file net.cpp.

References MAXADDRSTR, and NULL.


Variable Documentation

const S32 ETHERNET_MTU_BYTES = 1500

Definition at line 68 of file net.h.

Referenced by LLMessageSystem::sendError().

const char* LOOPBACK_ADDRESS_STRING

Definition at line 84 of file net.cpp.

Referenced by main().

const S32 MTUBITS = MTUBYTES*8

Definition at line 69 of file net.h.

const S32 MTUBYTES = 1200

Definition at line 67 of file net.h.

Referenced by LLGestureManager::activateGestures(), LLGestureManager::deactivateSimilarGestures(), LLTemplateMessageBuilder::isMessageFull(), pack_instant_message_block(), process_improved_im(), LLMessageSystem::processError(), LLViewerImageList::receiveImagePacket(), LLMessageSystem::sendError(), LLMessageSystem::sendMessage(), LLViewerParcelMgr::sendParcelAccessListUpdate(), LLViewerAssetStorage::storeAssetData(), and LLIMInfo::unpackMessageBlock().

const S32 MTUU32S = MTUBITS/32

Definition at line 70 of file net.h.


Generated on Thu Jul 1 06:10:56 2010 for Second Life Viewer by  doxygen 1.4.7