Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
mapi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arne Øslebø
mapi
Commits
651fae76
Commit
651fae76
authored
May 05, 2006
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase a buffer size
git-svn-id:
file:///home/svn/mapi/trunk@474
8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent
94b6ed1b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
agent/agent.c
agent/agent.c
+7
-7
dimapi_tests/test_top.c
dimapi_tests/test_top.c
+2
-2
mapi.h
mapi.h
+1
-1
mapiipc.c
mapiipc.c
+2
-2
mapiipc.h
mapiipc.h
+1
-1
No files found.
agent/agent.c
View file @
651fae76
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* memset */
#include <unistd.h>
/* close, read, write */
#include <ctype.h>
/* toupper */
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <pthread.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
/* for sockaddr_in and inet_ntoa() */
#include <arpa/inet.h>
#include <sys/time.h>
#include "mapi.h"
#include "mapiipc.h"
...
...
@@ -126,7 +126,7 @@ void *handle_request(void *arg) {
int
sock
;
int
recv_bytes
;
char
buffer
[
MAX_SEND
_SIZE
];
char
buffer
[
DIMAPI_DATA
_SIZE
];
struct
dmapiipcbuf
*
dbuf
=
NULL
;
int
mapid_result
;
void
*
result
;
...
...
@@ -155,7 +155,7 @@ void *handle_request(void *arg) {
if
(
dbuf_bytes
==
0
||
dbuf_bytes
<
((
struct
dmapiipcbuf
*
)
buffer
)
->
length
){
recv_bytes
=
recv
(
sock
,
(
char
*
)
buffer
+
dbuf_bytes
,
MAX_SEND
_SIZE
,
0
);
recv_bytes
=
recv
(
sock
,
(
char
*
)
buffer
+
dbuf_bytes
,
DIMAPI_DATA
_SIZE
,
0
);
if
(
recv_bytes
==
0
)
{
/* the peer has gone */
printf
(
"Peer has gone
\n
"
);
...
...
@@ -224,7 +224,7 @@ void *handle_request(void *arg) {
dbuf
->
length
=
BASIC_SIZE
;
break
;
case
APPLY_FUNCTION
:
fprintf
(
stdout
,
"APPLY_FUNCTION
:
"
);
fprintf
(
stdout
,
"APPLY_FUNCTION
\n
"
);
if
(((
dbuf
->
fid
=
getfid
(
dbuf
))
!=-
1
)){
dbuf
->
cmd
=
APPLY_FUNCTION_ACK
;
}
...
...
dimapi_tests/test_top.c
View file @
651fae76
...
...
@@ -25,8 +25,8 @@ int main(MAPI_UNUSED int argc, char *argv[])
fd
=
mapi_create_flow
(
argv
[
1
]);
fid
=
mapi_apply_function
(
fd
,
"TOP"
,
10
,
TOPX_TCP
,
TOPX_TCP_DSTPORT
);
fid
=
mapi_apply_function
(
fd
,
"TOP"
,
10
,
TOPX_TCP
,
TOPX_TCP_DSTPORT
,
100
);
mapi_connect
(
fd
);
while
(
1
)
...
...
mapi.h
View file @
651fae76
...
...
@@ -108,7 +108,7 @@ struct mapipkt {
#ifdef DIMAPI
#define HOST_DEV_SIZE 256
#define MAX_RESULT_SZ
1
000
#define MAX_RESULT_SZ
50
000
//struct returned by read_results in dimapi
struct
dmapi_results
{
unsigned
char
first_res
[
MAX_RESULT_SZ
];
//only for compatibility reasons
...
...
mapiipc.c
View file @
651fae76
...
...
@@ -124,7 +124,7 @@ void mapiipc_remote_write_to_all(remote_flowdescr_t* rflow)
void
*
mapiipc_comm_thread
(
void
*
host
)
{
//Reads an IPC message. Blocking call
char
buffer
[
MAX_SEND
_SIZE
];
char
buffer
[
DIMAPI_DATA
_SIZE
];
struct
dmapiipcbuf
*
dbuf
;
remote_flowdescr_t
*
rflow
;
host_flow
*
hflow
;
...
...
@@ -137,7 +137,7 @@ void *mapiipc_comm_thread(void *host) {
while
(
1
)
{
if
(
dbuf_bytes
==
0
||
dbuf_bytes
<
dbuf
->
length
)
{
if
(
(
recv_bytes
=
recv
(((
struct
host
*
)
host
)
->
sockfd
,
(
char
*
)
&
buffer
+
dbuf_bytes
,
MAX_SEND
_SIZE
,
0
))
==
-
1
)
{
if
(
(
recv_bytes
=
recv
(((
struct
host
*
)
host
)
->
sockfd
,
(
char
*
)
&
buffer
+
dbuf_bytes
,
DIMAPI_DATA
_SIZE
,
0
))
==
-
1
)
{
//ERROR_CMD(printf("recv: %s [%s:%d]\n",strerror(errno),__FILE__,__LINE__));
exit
(
1
);
//printf("error 1\n");
...
...
mapiipc.h
View file @
651fae76
...
...
@@ -143,7 +143,7 @@ struct dmapiipcbuf {
char
data
[
DIMAPI_DATA_SIZE
];
};
#define BASIC_SIZE (sizeof(struct dmapiipcbuf) - DATA_SIZE)
#define BASIC_SIZE (sizeof(struct dmapiipcbuf) - D
IMAPI_D
ATA_SIZE)
#define PKT_LENGTH 1600 //pkt info and actual pkt
typedef
struct
host_flow
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment