.FindDir = SysFS_Comm_FindDir
};
tSysFS_Ent gSysFS_Version_Kernel = {
- NULL, NULL, // Nexts
- &gSysFS_Version, // Parent
- {
+ .Parent = &gSysFS_Version, // Parent
+ .Node = {
.Inode = 1, // File #1
.ImplPtr = NULL,
.ImplInt = (Uint)&gSysFS_Version_Kernel, // Self-Link
.ACLs = &gVFS_ACL_EveryoneRO,
.Type = &gSysFS_FileNodeType
},
- "Kernel"
+ .Name = {"Kernel"}
};
tSysFS_Ent gSysFS_Version = {
- NULL, NULL,
- &gSysFS_Root,
- {
+ .Parent = &gSysFS_Root,
+ .Node = {
.Size = 1,
.ImplPtr = &gSysFS_Version_Kernel,
.ImplInt = (Uint)&gSysFS_Version, // Self-Link
.Flags = VFS_FFLAG_DIRECTORY,
.Type = &gSysFS_DirNodeType
},
- "Version"
+ .Name = {"Version"}
};
// Root of the SysFS tree (just used to keep the code clean)
tSysFS_Ent gSysFS_Root = {
.ImplPtr = &gSysFS_Version,
.ImplInt = (Uint)&gSysFS_Root // Self-Link
},
- "/"
+ {"/"}
};
tDevFS_Driver gSysFS_DriverInfo = {
NULL, "system",
*/
#define DEBUG 0
#include <acess.h>
-#include <threads_int.h>
#include <events.h>
+#include <threads_int.h>
// === CODE ===
void Threads_PostEvent(tThread *Thread, Uint32 EventMask)
Uint16 RouterLifetime; // Seconds, life time as a default router (wtf does that mean?)
Uint32 ReachableTime;
Uint32 RetransTimer; // Miliseconds, time between transmissions of RAs from this router
- Uint8 Options[];
+ Uint8 Options[0];
} PACKED tICMPv6_RA;
typedef struct {
Uint32 Reserved;
tIPv6 TargetAddress;
- Uint8 Options[];
+ Uint8 Options[0];
} PACKED tICMPv6_NS;
typedef struct {
Uint32 Flags;
tIPv6 TargetAddress;
- Uint8 Options[];
+ Uint8 Options[0];
} PACKED tICMPv6_NA;
typedef struct {
Uint32 Reserved;
tIPv6 TargetAddress;
tIPv6 DestinationAddress;
- Uint8 Options[];
+ Uint8 Options[0];
} PACKED tICMPv6_Redirect;
typedef struct {
Uint8 Type; // 1,2
Uint8 Length; // Length of field in units of 8 bytes (incl header), typically 1
- Uint8 Address[];
+ Uint8 Address[0];
} PACKED tICMPv6_Opt_LinkAddr;
typedef struct {
Uint32 ValidLifetime;
Uint32 PreferredLifetime;
Uint32 _reserved2;
- tIPv6 Prefix[];
+ tIPv6 Prefix[0];
} PACKED tICMPv6_Opt_Prefix;
typedef struct {
Uint8 Length;
Uint16 _rsvd1;
Uint32 _rsvd2;
- Uint8 Data[]; // All or part of the redirected message (not exceeding MTU)
+ Uint8 Data[0]; // All or part of the redirected message (not exceeding MTU)
} PACKED tICMPv6_Opt_Redirect;
typedef struct {
Uint8 HopLimit;
tIPv6 Source;
tIPv6 Destination;
- char Data[];
+ char Data[0];
};
#define IPV6_ETHERNET_ID 0x86DD
.PHONY: all clean SyscallList all-user
-SUBMAKE = $(MAKE)
-# --no-print-directory
+SUBMAKE = $(MAKE) --no-print-directory
USRLIBS := crt0.o acess.ld ld-acess.so libc.so libc++.so libposix.so
USRLIBS += libreadline.so libnet.so liburi.so libpsocket.so
#include <sys/select.h>
#include "net.h"
#include <stdint.h>
+#include <unistd.h> // unlink/...
+#include <sys/time.h> // gettimeofday
#define CONNECT_TIMEOUT 10*1000
#define MAX_IFS 4
if( Net_int_EnsureConnected(IfNum) && WaitOnFD(If->FD, false, Timeout) )
{
- size_t rv = recvfrom(If->FD, DestBuf, MaxLen, 0, &If->addr, &If->addrlen);
+ size_t rv = recvfrom(If->FD, DestBuf, MaxLen, 0, (struct sockaddr*)&If->addr, &If->addrlen);
Net_int_SavePacket(If, rv, DestBuf);
return rv;
}
if( !WaitOnFD(If->FD, true, CONNECT_TIMEOUT) )
return ;
Net_int_SavePacket(If, Length, Buf);
- int rv = sendto(If->FD, Buf, Length, 0, &If->addr, If->addrlen);
+ int rv = sendto(If->FD, Buf, Length, 0, (struct sockaddr*)&If->addr, If->addrlen);
if( rv < 0 )
perror("Net_Send - send");
}
extern int Threads_int_ThreadingEnabled(void);
-extern tThread *Proc_GetCurThread(void);
-extern tThread *Threads_RemActive(void);
-extern void Threads_AddActive(tThread *Thread);
+extern struct sThread *Proc_GetCurThread(void);
+extern struct sThread *Threads_RemActive(void);
+extern void Threads_AddActive(struct sThread *Thread);
extern void Threads_int_WaitForStatusEnd(enum eThreadStatus Status);
-extern int Threads_int_Sleep(enum eThreadStatus Status, void *Ptr, int Num, tThread **ListHead, tThread **ListTail, tShortSpinlock *Lock);
-extern void Semaphore_ForceWake(tThread *Thread);
+extern int Threads_int_Sleep(enum eThreadStatus Status, void *Ptr, int Num, struct sThread **ListHead, struct sThread **ListTail, tShortSpinlock *Lock);
+extern void Semaphore_ForceWake(struct sThread *Thread);
extern tThreadIntMutex *Threads_int_MutexCreate(void);
extern void Threads_int_MutexDestroy(tThreadIntMutex *Mutex);