# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-EXCLUDE =
+EXCLUDE = arch/archdoc.h
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
-BUILD_NUM = 1508
+BUILD_NUM = 1510
// === FUNCTIONS ===
extern tPAddr MM_AllocPhys();
extern tPAddr MM_AllocPhysRange(int Pages, int MaxBits);
-extern void MM_RefPhys(tPAddr Addr);
-extern void MM_DerefPhys(tPAddr Addr);
+extern void MM_RefPhys(tPAddr PAddr);
+extern void MM_DerefPhys(tPAddr PAddr);
extern int MM_GetRefCount(tPAddr Addr);
#endif
// === PROTOTYPES ===
tPAddr MM_AllocPhys();
tPAddr MM_AllocPhysRange(int Pages, int MaxBits);
-void MM_RefPhys(tPAddr Addr);
-void MM_DerefPhys(tPAddr Addr);
+void MM_RefPhys(tPAddr PAddr);
+void MM_DerefPhys(tPAddr PAddr);
// === GLOBALS ===
Uint64 giPhysAlloc = 0; // Number of allocated pages
}
/**
- * \fn void MM_RefPhys(tPAddr Addr)
+ * \fn void MM_RefPhys(tPAddr PAddr)
*/
-void MM_RefPhys(tPAddr Addr)
+void MM_RefPhys(tPAddr PAddr)
{
// Get page number
- Addr >>= 12;
+ PAddr >>= 12;
// We don't care about non-ram pages
- if(Addr >= giPageCount) return;
+ if(PAddr >= giPageCount) return;
// Lock Structures
LOCK( &giPhysAlloc );
// Reference the page
if(gaPageReferences)
- gaPageReferences[ Addr ] ++;
+ gaPageReferences[ PAddr ] ++;
// Mark as used
- gaPageBitmap[ Addr / 32 ] |= 1 << (Addr&31);
+ gaPageBitmap[ PAddr / 32 ] |= 1 << (PAddr&31);
// Mark used block
- if(gaPageBitmap[ Addr / 32 ] == -1) gaSuperBitmap[Addr/1024] |= 1 << ((Addr/32)&31);
+ if(gaPageBitmap[ PAddr / 32 ] == -1)
+ gaSuperBitmap[PAddr/1024] |= 1 << ((PAddr/32)&31);
// Release Spinlock
RELEASE( &giPhysAlloc );
}
/**
- * \fn void MM_DerefPhys(Uint32 Addr)
+ * \fn void MM_DerefPhys(tPAddr PAddr)
+ * \brief Dereferences a physical page
*/
-void MM_DerefPhys(tPAddr Addr)
+void MM_DerefPhys(tPAddr PAddr)
{
// Get page number
- Addr >>= 12;
+ PAddr >>= 12;
// We don't care about non-ram pages
- if(Addr >= giPageCount) return;
+ if(PAddr >= giPageCount) return;
// Check if it is freed
- if(gaPageReferences[ Addr ] == 0) {
+ if(gaPageReferences[ PAddr ] == 0) {
Warning("MM_DerefPhys - Non-referenced memory dereferenced");
return;
}
// Lock Structures
LOCK( &giPhysAlloc );
- if( giLastPossibleFree < Addr )
- giLastPossibleFree = Addr;
+ if( giLastPossibleFree < PAddr )
+ giLastPossibleFree = PAddr;
// Dereference
- gaPageReferences[ Addr ] --;
+ gaPageReferences[ PAddr ] --;
// Mark as free in bitmaps
- if( gaPageReferences[ Addr ] == 0 )
+ if( gaPageReferences[ PAddr ] == 0 )
{
- //LOG("Freed 0x%x by %p\n", Addr<<12, __builtin_return_address(0));
- gaPageBitmap[ Addr / 32 ] &= ~(1 << (Addr&31));
- if(gaPageReferences[ Addr ] == 0)
- gaSuperBitmap[ Addr >> 10 ] &= ~(1 << ((Addr >> 5)&31));
+ //LOG("Freed 0x%x by %p\n", PAddr<<12, __builtin_return_address(0));
+ gaPageBitmap[ PAddr / 32 ] &= ~(1 << (PAddr&31));
+ if(gaPageReferences[ PAddr ] == 0)
+ gaSuperBitmap[ PAddr >> 10 ] &= ~(1 << ((PAddr >> 5)&31));
}
// Release spinlock
/**\r
- Acess v1\r
- \file bin_elf.h\r
- \brief ELF Exeutable Loader\r
-*/\r
+ * \file elf.h\r
+ * \brief ELF Exeutable Loader\r
+ */\r
#ifndef _BIN_ELF_H\r
#define _BIN_ELF_H\r
\r
/**\r
- \struct elf_header_s\r
- \brief ELF File Header\r
-*/\r
-struct sElf32_Ehdr {\r
+ * \brief ELF File Header\r
+ */\r
+struct sElf32_Ehdr\r
+{\r
union {\r
char ident[16]; //!< Identifier Bytes\r
struct {\r
} __attribute__ ((packed));\r
\r
/**\r
- \name Executable Types\r
- \{\r
-*/\r
-#define ET_NONE 0 //!< NULL Type\r
-#define ET_REL 1 //!< Relocatable (Object)\r
-#define ET_EXEC 2 //!< Executable\r
-#define ET_DYN 3 //!< Dynamic Library\r
-#define ET_CORE 4 //!< Core?\r
-#define ET_LOPROC 0xFF00 //!< Low Impl Defined\r
-#define ET_HIPROC 0xFFFF //!< High Impl Defined\r
-//! \}\r
+ * \brief Executable Types\r
+ */\r
+enum eElf32_ExecTypes\r
+{\r
+ ET_NONE = 0, //!< NULL Type\r
+ ET_REL = 1, //!< Relocatable (Object)\r
+ ET_EXEC = 2, //!< Executable\r
+ ET_DYN = 3, //!< Dynamic Library\r
+ ET_CORE = 4, //!< Core?\r
+ ET_LOPROC = 0xFF00, //!< Low Impl Defined\r
+ ET_HIPROC = 0xFFFF //!< High Impl Defined\r
+};\r
\r
/**\r
\name Section IDs\r
void Binary_Dereference(tBinary *Info);\r
Uint Binary_Relocate(void *Base);\r
Uint Binary_GetSymbolEx(char *Name, Uint *Value);\r
-Uint Binary_FindSymbol(void *Base, char *Name, Uint *val);\r
+Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val);\r
\r
// === GLOBALS ===\r
int glBinListLock = 0;\r
}\r
\r
/**\r
- \fn tBinary *Binary_GetInfo(char *truePath)\r
- \brief Finds a matching binary entry\r
- \param truePath File Identifier (True path name)\r
-*/\r
-tBinary *Binary_GetInfo(char *truePath)\r
+ * \brief Finds a matching binary entry\r
+ * \param TruePath File Identifier (True path name)\r
+ */\r
+tBinary *Binary_GetInfo(char *TruePath)\r
{\r
tBinary *pBinary;\r
pBinary = glLoadedBinaries;\r
while(pBinary)\r
{\r
- if(strcmp(pBinary->TruePath, truePath) == 0)\r
+ if(strcmp(pBinary->TruePath, TruePath) == 0)\r
return pBinary;\r
pBinary = pBinary->Next;\r
}\r
}\r
\r
/**\r
- \fn char *Binary_RegInterp(char *path)\r
- \brief Registers an Interpreter\r
- \param path Path to interpreter provided by executable\r
-*/\r
-char *Binary_RegInterp(char *path)\r
+ * \fn char *Binary_RegInterp(char *Path)\r
+ * \brief Registers an Interpreter\r
+ * \param Path Path to interpreter provided by executable\r
+ */\r
+char *Binary_RegInterp(char *Path)\r
{\r
int i;\r
// NULL Check Argument\r
- if(path == NULL) return NULL;\r
+ if(Path == NULL) return NULL;\r
// NULL Check the array\r
if(gsaRegInterps == NULL)\r
{\r
giRegInterps = 1;\r
gsaRegInterps = malloc( sizeof(char*) );\r
- gsaRegInterps[0] = malloc( strlen(path) );\r
- strcpy(gsaRegInterps[0], path);\r
+ gsaRegInterps[0] = malloc( strlen(Path) );\r
+ strcpy(gsaRegInterps[0], Path);\r
return gsaRegInterps[0];\r
}\r
\r
// Interpreter is not in list\r
giRegInterps ++;\r
gsaRegInterps = malloc( sizeof(char*)*giRegInterps );\r
- gsaRegInterps[i] = malloc( strlen(path) );\r
- strcpy(gsaRegInterps[i], path);\r
+ gsaRegInterps[i] = malloc( strlen(Path) );\r
+ strcpy(gsaRegInterps[i], Path);\r
return gsaRegInterps[i];\r
}\r
\r
// Kernel Binary Handling\r
// ============\r
/**\r
- * \fn void *Binary_LoadKernel(char *path)\r
+ * \fn void *Binary_LoadKernel(char *File)\r
* \brief Load a binary into kernel space\r
* \note This function shares much with #Binary_Load, but does it's own mapping\r
+ * \param File File to load into the kernel\r
*/\r
-void *Binary_LoadKernel(char *file)\r
+void *Binary_LoadKernel(char *File)\r
{\r
char *sTruePath;\r
tBinary *pBinary;\r
}\r
\r
/**\r
- * \fn Uint Binary_GetSymbolBin(void *Base, char *Name, Uint *val)\r
+ * \fn Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val)\r
* \brief Get a symbol from the specified library\r
* \param Base Base address\r
* \param Name Name of symbol to find\r
- * \param val Pointer to place final value\r
+ * \param Val Pointer to place final value\r
*/\r
-Uint Binary_FindSymbol(void *Base, char *Name, Uint *val)\r
+Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val)\r
{\r
Uint32 ident = *(Uint32*) Base;\r
tBinaryType *bt = gRegBinTypes;\r
for(; bt; bt = bt->Next)\r
{\r
if( (ident & bt->Mask) == (Uint)bt->Ident )\r
- return bt->GetSymbol(Base, Name, val);\r
+ return bt->GetSymbol(Base, Name, Val);\r
}\r
\r
Warning("[BIN ] 0x%x is an unknown file type. (0x%x 0x%x 0x%x 0x%x)",\r
}
/**
- * \fn void FIFO_Close(vfs_node *Node)
+ * \fn void FIFO_Close(tVFS_Node *Node)
+ * \brief Close a FIFO end
*/
void FIFO_Close(tVFS_Node *Node)
{
#define MAX_INPUT_CHARS32 64
#define MAX_INPUT_CHARS8 (MAX_INPUT_CHARS32*4)
#define VT_SCROLLBACK 1 // 2 Screens of text
-//#define DEFAULT_OUTPUT "VGA"
-#define DEFAULT_OUTPUT "BochsGA"
+#define DEFAULT_OUTPUT "VGA"
+//#define DEFAULT_OUTPUT "BochsGA"
#define DEFAULT_INPUT "PS2Keyboard"
#define DEFAULT_WIDTH 80
#define DEFAULT_HEIGHT 25
/**
* \fn void VT_KBCallBack(Uint32 Codepoint)
* \brief Called on keyboard interrupt
+ * \param Codepoint Pseudo-UTF32 character
+ *
+ * Handles a key press and sends the key code to the user's buffer.
+ * If the code creates a kernel-magic sequence, it is not passed to the
+ * user and is handled in-kernel.
*/
void VT_KBCallBack(Uint32 Codepoint)
{
*/
extern int MM_Map(tVAddr VAddr, tPAddr PAddr);
/**
- * \brief Get the physical address of \a VAddr
- * \param VAddr Address of the page to get the physical address of
- * \return Physical page mapped at \a VAddr
+ * \brief Get the physical address of \a Addr
+ * \param Addr Address of the page to get the physical address of
+ * \return Physical page mapped at \a Addr
*/
-extern tPAddr MM_GetPhysAddr(tVAddr VAddr);
+extern tPAddr MM_GetPhysAddr(tVAddr Addr);
/**
* \brief Checks is a memory range is user accessable
* \param VAddr Base address to check
* \file apidoc_mainpage.h
* \brief API Documentation Home Page
* \author John Hodge (thePowersGang)
- */
-
-/**
+ *
* \mainpage Acess 2 Kernel API Documentation
*
* \section intro Introduction
#define _BINARY_H
// === TYPES ===
+/**
+ * \brief Representation of a page in a binary file
+ *
+ * Tells the binary loader where the page data resides on disk and where
+ * to load it to (relative to the binary base). Once the data is read,
+ * the \a Physical field contains the physical address of the page.
+ */
typedef struct sBinaryPage
{
/**
*/
extern char *Binary_RegInterp(char *Path);
+/**
+ * \brief Registers a binary type with the kernel's loader
+ * \param Type Pointer to the loader's type structure
+ * \return Boolean success
+ * \note The structure \a Type must be persistant (usually it will be a
+ * constant global variable)
+ *
+ * This function tells the binary loader about a new file type, and gives
+ * it the functions to read the type into a ::tBinary structure, relocate
+ * it and to find the value of symbols defined within the binary.
+ */
extern int Binary_RegisterType(tBinaryType *Type);
#endif
extern Uint Binary_Relocate(void *Mem);
extern void Binary_Unload(void *Base);
extern int Binary_GetSymbol(char *Name, Uint *Dest);
-extern Uint Binary_FindSymbol(void *Base, char *Name, Uint *Dest);
+extern Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val);
#endif
DRV_IOCTL_LOOKUP
};
-//! \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls
-//! These are the official lookup names of the core calls
+/**
+ * \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls
+ * These are the official lookup names of the core calls
+ */
#define DRV_IOCTLNAMES "type", "ident", "version", "lookup"
+/**
+ * \brief Helper macro for the base IOCtl calls
+ * \param _type Type number from eTplDrv_Type to return
+ * \param _ident String of max 32-characters that identifies this driver
+ * \param _version Driver's 8.8.8 BCD version number
+ * \param _ioctls Pointer to the IOCtls string array
+ * \warning If you have DEBUG enabled in the calling file, this function
+ * will do LEAVE()s before returning, so make sure that the
+ * IOCtl function is ENTER()ed when using debug with this macro
+ *
+ * Usage: (Id is the IOCtl call ID)
+ * \code
+ * switch(Id)
+ * {
+ * BASE_IOCTLS(DRV_TYPE_MISC, "Ident", 0x100, csaIOCtls)
+ * // Your IOCtls go here, starting at index 4
+ * }
+ * \endcode
+ */
#define BASE_IOCTLS(_type, _ident, _version, _ioctls) \
case DRV_IOCTL_TYPE: LEAVE('i', (_type)); return (_type);\
case DRV_IOCTL_IDENT: {\
*/\r
TERM_MODE_FB,\r
\r
+ /**\r
+ * \brief 32bpp 2D Accellerated mode\r
+ * Writes to the terminal file will be read as a command stream\r
+ * defined in ::eTplTerminal_2D_Commands\r
+ */\r
TERM_MODE_2DACCEL,\r
\r
/**\r
NUM_TERM_MODES\r
};\r
\r
+/**\r
+ * \brief 2D Command IDs\r
+ * \todo Complete this structure\r
+ * \r
+ * Command IDs for when the terminal type is eTplTerminal_Modes.TERM_MODE_2DACCEL\r
+ */\r
enum eTplTerminal_2D_Commands\r
{\r
+ /**\r
+ * \brief No Operation - Used for padding\r
+ */\r
TERM_2DCMD_NOP,\r
\r
/**\r
* (Uint16 X, Y, W, H, Uint32 Data[])\r
+ * \brief Blits a bitmap to the display\r
* \param X,Y Coordinates of Top-Left corner\r
* \param W,H Dimensions\r
* \param Data 32-bpp pixel data\r
*/\r
- TERM_2DCMD_PUSH,\r
+ TERM_2DCMD_PUSH\r
};\r
\r
#endif\r
#define _VFS_EXT_H
// === CONSTANTS ===
-//! maximum size of a Memory Path generated by VFS_GetMemPath
+//! Maximum size of a Memory Path generated by VFS_GetMemPath
#define VFS_MEMPATH_SIZE (3 + (BITS/8)*2)
/**
* \name Flags for VFS_Open
* \brief Change the location of the current file pointer
* \param FD File handle returned by ::VFS_Open
* \param Offset Offset within the file to go to
- * \param Whence A direction from ::eVFS_SeekDirs
+ * \param Direction A direction from ::eVFS_SeekDirs
* \return Boolean success
*/
extern int VFS_Seek(int FD, Sint64 Offset, int Direction);
}
/**
- * \fn int strucmp(char *Str1, char *Str2)
+ * \fn int strucmp(const char *Str1, const char *Str2)
* \brief Compare \a Str1 and \a Str2 case-insensitively
*/
int strucmp(const char *Str1, const char *Str2)
}
/**
- * \fn char *strcpy(const char *__str1, const char *__str2)
+ * \fn char *strcpy(char *__str1, const char *__str2)
* \brief Copy a string to a new location
*/
char *strcpy(char *__str1, const char *__str2)
}
/**
- * \fn char *strcpy(const char *__str1, const char *__str2)
+ * \fn char *strncpy(char *__str1, const char *__str2, size_t max)
* \brief Copy a string to a new location
*/
char *strncpy(char *__str1, const char *__str2, size_t max)
* FAT12/16/32 Driver\r
* vfs/fs/fs_fat.h\r
*/\r
+#ifndef _FS_FAT_H_\r
+#define _FS_FAT_H_\r
\r
// === On Disk Structures ===\r
/**\r
- \struct fat_bootsect_s\r
- \brief Bootsector format\r
-*/\r
-struct fat_bootsect_s {\r
+ * \struct fat_bootsect_s\r
+ * \brief Bootsector format\r
+ */\r
+struct fat_bootsect_s\r
+{\r
Uint8 jmp[3]; //!< Jump Instruction\r
char oemname[8]; //!< OEM Name. Typically MSDOS1.1\r
Uint16 bps; //!< Bytes per Sector. Assumed to be 512\r
*/\r
struct fat_filetable_s {\r
char name[11]; //!< 8.3 Name\r
- //char ext[3]; //!< Extention\r
Uint8 attrib; //!< File Attributes.\r
Uint8 ntres; //!< Reserved for NT - Set to 0\r
Uint8 ctimems; //!< 10ths of a second ranging from 0-199 (2 seconds)\r
Uint16 name3[2]; //!< Last 2 characters of name\r
} __attribute__((packed));\r
\r
-#define ATTR_READONLY 0x01\r
-#define ATTR_HIDDEN 0x02\r
-#define ATTR_SYSTEM 0x04\r
-#define ATTR_VOLUMEID 0x08\r
-#define ATTR_DIRECTORY 0x10\r
+/**\r
+ * \name File Attributes\r
+ * \brief Flag values for ::fat_filetable_s.attrib\r
+ * \{\r
+ */\r
+#define ATTR_READONLY 0x01 //!< Read-only file\r
+#define ATTR_HIDDEN 0x02 //!< Hidden File\r
+#define ATTR_SYSTEM 0x04 //!< System File\r
+#define ATTR_VOLUMEID 0x08 //!< Volume ID (Deprecated)\r
+#define ATTR_DIRECTORY 0x10 //!< Directory\r
+/**\r
+ * \brief File needs archiving\r
+ * \note User set flag, no significance to the FS driver\r
+ */\r
#define ATTR_ARCHIVE 0x20\r
+/**\r
+ * \brief Meta Attribute \r
+ * \r
+ * If ::fat_filetable_s.attrib equals ATTR_LFN the file is a LFN entry\r
+ */\r
#define ATTR_LFN (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUMEID)\r
+/**\r
+ * \}\r
+ */\r
\r
/**\r
- \enum eFatType\r
- \brief Internal Ids for FAT types\r
-*/\r
-enum eFatType {\r
-// FAT_NULL, //!< NULL Entry\r
+ * \brief Internal IDs for FAT types\r
+ */\r
+enum eFatType\r
+{\r
FAT12, //!< FAT12 Volume\r
FAT16, //!< FAT16 Volume\r
FAT32, //!< FAT32 Volume\r
-// FAT_LAST //!< LAST Entry. Unused\r
};\r
\r
-#define EOC_FAT12 0x0FFF\r
-#define EOC_FAT16 0xFFFF\r
-#define EOC_FAT32 0x0FFFFFF\r
+/**\r
+ * \name End of Cluster marks\r
+ * \brief FAT values that indicate the end of a cluster chain in\r
+ * different versions.\r
+ * \{\r
+ */\r
+#define EOC_FAT12 0x0FFF //!< FAT-12 Mark\r
+#define EOC_FAT16 0xFFFF //!< FAT-16 Mark\r
+#define EOC_FAT32 0x0FFFFFF //!< FAT-32 Mark\r
+/**\r
+ * \}\r
+ */\r
\r
typedef struct fat_bootsect_s fat_bootsect;\r
typedef struct fat_filetable_s fat_filetable;\r
\r
// === Memory Structures ===\r
/**\r
- \struct drv_fat_volinfo_s\r
- \brief Representation of a volume in memory\r
-*/\r
-struct drv_fat_volinfo_s {\r
+ * \struct drv_fat_volinfo_s\r
+ * \brief Representation of a volume in memory\r
+ */\r
+struct drv_fat_volinfo_s\r
+{\r
int fileHandle; //!< File Handle\r
int type; //!< FAT Type. See eFatType\r
char name[12]; //!< Volume Name (With NULL Terminator)\r
};\r
\r
typedef struct drv_fat_volinfo_s tFAT_VolInfo;\r
+\r
+#endif\r
extern char *gsVFS_MountFile;
// === PROTOTYPES ===
- int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString);
+ int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options);
void VFS_UpdateMountFile();
// === GLOBALS ===
// === CODE ===
/**
- * \fn int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
* \brief Mount a device
* \param Device Device string to mount
* \param MountPoint Destination for the mount
* \param Filesystem Filesystem to use for the mount
* \param Options Options to be passed to the filesystem
* \return -1 on Invalid FS, -2 on No Mem, 0 on success
+ *
+ * Mounts the filesystem on \a Device at \a MountPoint using the driver
+ * \a Filesystem. The options in the string \a Options is passed to the
+ * driver's mount.
*/
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
{
}
/**
- * \fn void VFS_UpdateMountFile()
* \brief Updates the mount file buffer
+ *
+ * Updates the ProcFS mounts file buffer to match the current mounts list.
*/
void VFS_UpdateMountFile()
{
// === CODE ===
/**
- * \fn void TCP_Initialise()
* \brief Initialise the TCP Layer
+ *
+ * Registers the client and server files and the GetPacket callback
*/
void TCP_Initialise()
{
/**
* \brief Open a connection to another host using TCP
+ * \param Conn Connection structure
*/
void TCP_StartConnection(tTCPConnection *Conn)
{
hdr.WindowSize = 0; // TODO
hdr.Checksum = 0; // TODO
hdr.UrgentPointer = 0;
- // SEND PACKET
+
TCP_SendPacket( Conn, sizeof(tTCPHeader), &hdr );
return ;
}
* \brief Sends a packet from the specified connection, calculating the checksums
* \param Conn Connection
* \param Length Length of data
- * \param Data Packet data
+ * \param Data Packet data (cast as a TCP Header)
*/
void TCP_SendPacket( tTCPConnection *Conn, size_t Length, tTCPHeader *Data )
{
}
/**
- * \fn void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer)
* \brief Handles a packet from the IP Layer
+ * \param Interface Interface the packet arrived from
+ * \param Address Pointer to the addres structure
+ * \param Length Size of packet in bytes
+ * \param Buffer Packet data
*/
void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer)
{
}
conn->NextSequenceRcv = ntohl( hdr->SequenceNumber ) + 1;
- // + (Length-(hdr->DataOffset>>4)*4);
conn->NextSequenceSend = rand();
// Create node
/**
* \brief Handles a packet sent to a specific connection
+ * \param Connection TCP Connection pointer
+ * \param Header TCP Packet pointer
+ * \param Length Length of the packet
*/
void TCP_INT_HandleConnectionPacket(tTCPConnection *Connection, tTCPHeader *Header, int Length)
{
/**
* \brief Appends a packet to the recieved list
+ * \param Connection Connection structure
+ * \param Pkt Packet structure on heap
*/
void TCP_INT_AppendRecieved(tTCPConnection *Connection, tTCPStoredPacket *Pkt)
{
/**
* \brief Updates the connections recieved list from the future list
+ * \param Connection Connection structure
+ *
+ * Updates the recieved packets list with packets from the future (out
+ * of order) packets list that are now able to be added in direct
+ * sequence.
*/
void TCP_INT_UpdateRecievedFromFuture(tTCPConnection *Connection)
{