netstat.c File Reference

Implements the network status menu item. More...

#include <string.h>
#include <stdlib.h>
#include "color.h"
#include "genconmac.h"
#include "hostlookup.h"
#include "netstat.h"
#include "text.h"
#include "timesync.h"
#include "net.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>

Include dependency graph for netstat.c:

Go to the source code of this file.

Data Structures

struct  NetStatData_t
 The data needed by the network status menu item while it is in use. More...

Defines

#define netdat   ((NetStatData*)(item->data))
 A convienience macro for accessing data maintained for the life of the network status menu item.

Typedefs

typedef NetStatData_t NetStatData

Functions

void NetStatFocus (MenuItem *item)
 Changes the network status item's display based on receiving or losing focus.
Bool NetStatInit (MenuItem *item)
 Sets up the network status menu item for use.
int NetStatInput (MenuItem *item, Uint8 *ec, rtsa_char keyval)
 Responds to user input.
void NetStatUninit (MenuItem *item)
 Removes dynamically allocated data that is only needed by the network status menu item while it is in use.
int NetStatUpdate (MenuItem *item)
 Updates the network status item with new information and places its render items in the appropriate spots.
static void RenderLatency (MenuItem *item)
 Renders the latency to the server.
static void RenderLocalAddr (MenuItem *item)
 Renders the local machine's address to textItems[TEXTITEM_NETOPTS].
static void RenderTSync (MenuItem *item)
 Informs the user that time sync is in progress.

Variables

SocketAddr outgoingAddr
 The socket address of the server that the client is in communication with.
char statHost [64]


Detailed Description

Implements the network status menu item.

Author:
Jeff Jackowski (jeffj@ro.com)
Copyright (C) 2007 Jeff Jackowski

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Or visit their website at: http://www.gnu.org/

Definition in file netstat.c.


Define Documentation

#define netdat   ((NetStatData*)(item->data))

A convienience macro for accessing data maintained for the life of the network status menu item.

For internal use only.

Author:
Jeff Jackowski

Definition at line 71 of file netstat.c.

Referenced by NetStatInit(), NetStatUninit(), and NetStatUpdate().


Typedef Documentation

typedef struct NetStatData_t NetStatData

Definition at line 63 of file netstat.c.


Function Documentation

static void RenderLatency ( MenuItem item  )  [static]

Renders the latency to the server.

For internal use only.

Parameters:
item The network status menu item to work with.
Author:
Jeff Jackowski

Definition at line 150 of file netstat.c.

References COLOR_TEXT, colorFmtInd, FONT_SCORE, TimeSample_t::latency, RenderItem_t::loc, MenuItem_t::region, STRING_NETLAT, strings, TEXTITEM_NETOPTS, textItems, TextRenderString(), and timeSyncResults.

Referenced by NetStatUpdate().

Here is the call graph for this function:

static void RenderLocalAddr ( MenuItem item  )  [static]

Renders the local machine's address to textItems[TEXTITEM_NETOPTS].

For internal use only.

Precondition:
The localhostAddrStr must not be an empty string.
Parameters:
item The network status menu item to work with.
Author:
Jeff Jackowski

Definition at line 116 of file netstat.c.

References COLOR_TEXT, colorFmtInd, FONT_SCORE, RenderItem_t::loc, localhostAddrStr, MenuItem_t::region, STRING_NETADDR, strings, TEXTITEM_NETOPTS, textItems, and TextRenderString().

Referenced by NetStatUpdate().

Here is the call graph for this function:

static void RenderTSync ( MenuItem item  )  [static]

Informs the user that time sync is in progress.

For internal use only.

Parameters:
item The network status menu item to work with.
Author:
Jeff Jackowski

Definition at line 133 of file netstat.c.

References COLOR_TEXT, colorFmtInd, FONT_SCORE, RenderItem_t::loc, MenuItem_t::region, STRING_NETSYNC, strings, TEXTITEM_NETOPTS, textItems, and TextRenderString().

Referenced by NetStatUpdate().

Here is the call graph for this function:


Variable Documentation

char statHost[64]

Definition at line 40 of file netstat.c.

Referenced by DiscoverConnectServer(), and NetStatUpdate().


Generated on Mon May 28 04:41:40 2007 for Retro Tank Super Attack by  doxygen 1.5.2