mirror of
https://github.com/ksherlock/marignotti.git
synced 2024-12-13 01:30:43 +00:00
read/write oob.
This commit is contained in:
parent
6ab3356fc2
commit
7bd4d900c7
4
driver.c
4
driver.c
@ -131,6 +131,7 @@ int driver(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PRU_RCVOOB:
|
case PRU_RCVOOB:
|
||||||
|
return mreadoob(e, p1, p2, p3, p4, p5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRU_SEND:
|
case PRU_SEND:
|
||||||
@ -143,6 +144,9 @@ int driver(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PRU_SENDOOB:
|
case PRU_SENDOOB:
|
||||||
|
// OOB is always inline. so there.
|
||||||
|
// this is never called via ReadGS.
|
||||||
|
return mwrite(e, p1, p2, p3, p4, p5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRU_SENSE:
|
case PRU_SENSE:
|
||||||
|
@ -106,6 +106,8 @@ int driver(int, int, void *, void *, void *, void *, void *);
|
|||||||
int mattach(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5);
|
int mattach(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
|
|
||||||
int mread(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
int mread(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
|
int mreadoob(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
|
|
||||||
int mwrite(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
int mwrite(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
int mconnect(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
int mconnect(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
int mbind(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
int mbind(Entry *, void *p1, void *p2, void *p3, void *p4, void *p5);
|
||||||
|
26
mread.c
26
mread.c
@ -158,6 +158,32 @@ static int sock_read(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mreadoob(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||||
|
{
|
||||||
|
// called via recv, recvfrom.
|
||||||
|
// OOB is always inline, therefore an OOB read will
|
||||||
|
// just return 0.
|
||||||
|
// todo -- just treat as regular read?
|
||||||
|
|
||||||
|
char *buffer = (char *)p1;
|
||||||
|
LongWord nbytes = *(LongWord *)p2;
|
||||||
|
xsockaddr *addr = (xsockaddr *)p3;
|
||||||
|
int addrlen = p4 ? *(int *)p4 : 0;
|
||||||
|
|
||||||
|
LongWord *outbytes = (LongWord *)p2;
|
||||||
|
|
||||||
|
*outbytes = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if (Debug > 0)
|
||||||
|
{
|
||||||
|
s16_debug_printf("oob read nbytes = %ld", nbytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// called through ReadGS, recv, recvfrom
|
// called through ReadGS, recv, recvfrom
|
||||||
int mread(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
int mread(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user