Mercurial > hg > quicktun
comparison src/proto.raw.c @ 27:5ba185ca7102
Fixed error checking during initialization, restructured code a bit to make it even simpler
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Sat, 09 Apr 2011 17:36:48 +0200 |
parents | 65c01f57bdce |
children | d9f5caa13898 |
comparison
equal
deleted
inserted
replaced
26:68c67c6d2080 | 27:5ba185ca7102 |
---|---|
33 static int decode(struct qtsession* sess, char* enc, char* raw, int len) { | 33 static int decode(struct qtsession* sess, char* enc, char* raw, int len) { |
34 memcpy(raw, enc, len); | 34 memcpy(raw, enc, len); |
35 return len; | 35 return len; |
36 } | 36 } |
37 | 37 |
38 #ifdef COMBINED_BINARY | 38 struct qtproto qtproto_raw = { |
39 int tunmain_raw() { | 39 0, |
40 #else | 40 MAX_PACKET_LEN, |
41 int tunmain() { | 41 MAX_PACKET_LEN, |
42 #endif | 42 0, |
43 struct qtproto p = { | 43 0, |
44 0, | 44 decode, |
45 MAX_PACKET_LEN, | 45 encode, |
46 MAX_PACKET_LEN, | 46 NULL, |
47 0, | 47 0, |
48 0, | 48 }; |
49 decode, | |
50 encode, | |
51 NULL, | |
52 0, | |
53 }; | |
54 return qtrun(&p); | |
55 } | |
56 | 49 |
57 #ifndef COMBINED_BINARY | 50 #ifndef COMBINED_BINARY |
58 int main() { | 51 int main() { |
59 print_header(); | 52 print_header(); |
60 return tunmain(); | 53 return qtrun(&qtproto_raw); |
61 } | 54 } |
62 #endif | 55 #endif |