-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathlibfluid_msg_of10.i
More file actions
67 lines (54 loc) · 1.69 KB
/
libfluid_msg_of10.i
File metadata and controls
67 lines (54 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* File: example.i */
%module(directors="1") libfluid_msg_of13
#pragma SWIG nowarn=362,503,509
%{
/* Includes the header in the wrapper code */
typedef unsigned int of_error;
#include <fluid/of13msg.hh>
%}
%include "stdint.i"
%include "cdata.i"
%include "various.i"
%include "std_vector.i"
%typemap(jni) (uint8_t *) "jbyteArray"
%typemap(jni) (void *) "jbyteArray"
%typemap(jtype) (uint8_t *) "byte[]"
%typemap(jtype) (void *) "byte[]"
%typemap(jstype) (uint8_t *) "byte[]"
%typemap(jstype) (void *) "byte[]"
%template(Ports_) std::vector<fluid_msg::of13::Port>;
%typemap(in) void* {
$1 = (void *) JCALL2(GetByteArrayElements, jenv, $input, 0);
}
%typemap(in) uint8_t* {
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, 0);
}
%typemap(javain) (uint8_t *) "$javainput"
%typemap(javain) (void *) "$javainput"
%typemap(out, descriptor="[B") void* data() {
$result = (jenv)->NewByteArray(arg1->data_len());
(jenv)->SetByteArrayRegion($result, 0, arg1->data_len(), (jbyte*) $1);
}
%typemap(out, descriptor="[B") uint8_t* {
int len = htons(*((uint16_t*) $1 + 1));
$result = (jenv)->NewByteArray(len);
(jenv)->SetByteArrayRegion($result, 0, len, (jbyte*) $1);
}
%typemap(javaout) (uint8_t *) {
return $jnicall;
}
%typemap(javaout) (void *) {
return $jnicall;
}
%include "fluid/util/ethaddr.hh"
%include "fluid/util/ipaddr.hh"
%include "fluid/ofcommon/action.hh"
%include "fluid/ofcommon/common.hh"
%include "fluid/ofcommon/msg.hh"
%include "fluid/of13/of13match.hh"
%include "fluid/of13/of13instruction.hh"
%include "fluid/of13/of13action.hh"
%include "fluid/of13/of13common.hh"
%include "fluid/of13/of13meter.hh"
%include "fluid/of13msg.hh"
typedef unsigned int of_error;