Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

LoginPacket Class Reference

Inheritance diagram for LoginPacket:
[legend]
Collaboration diagram for LoginPacket:
[legend]
List of all members.

Detailed Description

Packets holding login information Packet format: :[TYPE][ID][TIME][USER][PASSWORD].

Definition at line 14 of file LoginPacket.h.

Public Types

enum  {
  USERNAME = 21,
  PASSWORD = 21,
  MESSAGELEN = USERNAME + PASSWORD,
  TOTLEN = MESSAGELEN + IDLEN + TIMELEN + TYPELEN
}
 enumeration for Login packet data More...


Public Member Functions

 LoginPacket ()
 Constructor that should be used to create a new packet.

 LoginPacket (char *data)
 Constructor that should be used to create an incomming packet.

 ~LoginPacket ()
 Destructor for a packet.

void printPacket ()
 print out a packet

int setLogin (char *newLog)
 set the login for a packet

int setPassword (char *newPass)
 set the password for a packet

char * getLogin ()
 get the Login

char * getPassword ()
 get the password

virtual void registerPacket ()
 register the packet in the netmanager so it will be sent out

virtual int sendPacket (int fd)
 send the packet out over a file descriptor


Private Attributes

char * user
 user name for the packet

char * pass
 password for the packet


Member Enumeration Documentation

anonymous enum
 

enumeration for Login packet data

Enumeration values:
USERNAME  username
PASSWORD  password len
MESSAGELEN  message length

Definition at line 19 of file LoginPacket.h.


Member Function Documentation

char* LoginPacket::getLogin  ) 
 

get the Login

Return values:
the login

char* LoginPacket::getPassword  ) 
 

get the password

Return values:
the password

virtual int LoginPacket::sendPacket int  fd  )  [virtual]
 

send the packet out over a file descriptor

Parameters:
fd to send the packet over
Return values:
1 on success -1 on error

Implements Packet.

int LoginPacket::setLogin char *  newLog  ) 
 

set the login for a packet

Parameters:
newLog to set the login to
Return values:
1 on success -1 on error

int LoginPacket::setPassword char *  newPass  ) 
 

set the password for a packet

Parameters:
newPass to set the password to
Return values:
1 on success -1 on error


The documentation for this class was generated from the following file:
Generated on Fri Mar 25 23:48:46 2005 for CS498EmbeddedSystemsProgramming by doxygen 1.3.6