summaryrefslogtreecommitdiff
path: root/proto_lib/packet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto_lib/packet.cpp')
-rw-r--r--proto_lib/packet.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/proto_lib/packet.cpp b/proto_lib/packet.cpp
index 8dc1b12..c4c5da0 100644
--- a/proto_lib/packet.cpp
+++ b/proto_lib/packet.cpp
@@ -349,4 +349,14 @@ svc_cmd packet::serv_extract_command(packet& p)
return c;
}
+unsigned char *packet::buf()
+{
+ if(data.empty())
+ return NULL;
+ unsigned char *b = new unsigned char [data.size()];
+ for(size_t i = 0; i < data.size(); i ++)
+ b[i] = data[i];
+ return b;
+}
+
};