Compare commits
1865 Commits
cvs-reposi
...
STABLE-2_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33955c636d | ||
|
|
2e05856f90 | ||
|
|
30e6f908ee | ||
|
|
e653ac9db7 | ||
|
|
21354af674 | ||
|
|
c981b726f8 | ||
|
|
21e6e1c824 | ||
|
|
b07031479c | ||
|
|
475be665ff | ||
|
|
3d38af5174 | ||
|
|
b28a80375b | ||
|
|
a5d4a27ae1 | ||
|
|
afd9ee9147 | ||
|
|
afd1bb938e | ||
|
|
025d5591eb | ||
|
|
7d77a52ea5 | ||
|
|
2b5250dd9d | ||
|
|
8ce49499ae | ||
|
|
5a123a3405 | ||
|
|
0d0b935d3d | ||
|
|
2be86fbc3e | ||
|
|
bb908366a5 | ||
|
|
73d8f14ebd | ||
|
|
ffa340a68c | ||
|
|
b8b83c2994 | ||
|
|
4d1a2e6699 | ||
|
|
15fbfb7363 | ||
|
|
54f7cae12c | ||
|
|
76d25befb4 | ||
|
|
749f7fae1a | ||
|
|
61d07f88f0 | ||
|
|
8ac1b4825a | ||
|
|
87354abf0f | ||
|
|
0b6370b9b8 | ||
|
|
92f5da8412 | ||
|
|
309e072238 | ||
|
|
ab2c65549d | ||
|
|
ca1b8288de | ||
|
|
8c7f513f4d | ||
|
|
16c70dd60e | ||
|
|
03e9c88488 | ||
|
|
0731eda0b3 | ||
|
|
083c6123d6 | ||
|
|
12a4cae404 | ||
|
|
3a26e8b6cc | ||
|
|
28652d4d51 | ||
|
|
b67427bd3b | ||
|
|
3a7c998f91 | ||
|
|
141aeaab3d | ||
|
|
c8b65f6c1d | ||
|
|
d70d9bf866 | ||
|
|
4bd57882b0 | ||
|
|
52fdc6bb3e | ||
|
|
d0c3baf340 | ||
|
|
6f43057662 | ||
|
|
d8784a77b7 | ||
|
|
27f03798b9 | ||
|
|
5b0a47ca87 | ||
|
|
9b0a0841e9 | ||
|
|
0b4bc5ea31 | ||
|
|
cab341976e | ||
|
|
52a3bf5d43 | ||
|
|
63c2dc926e | ||
|
|
cc477361ad | ||
|
|
377885581f | ||
|
|
7321420d8c | ||
|
|
9466d64a9a | ||
|
|
d929a4b17e | ||
|
|
945607e094 | ||
|
|
7721b20179 | ||
|
|
c6b742812d | ||
|
|
85d5fbdc7f | ||
|
|
449fc98a55 | ||
|
|
7e7f2f31ff | ||
|
|
a1fc91afa8 | ||
|
|
c39ef75cb3 | ||
|
|
7bda462031 | ||
|
|
f97bf85fd6 | ||
|
|
a9c7ead6b7 | ||
|
|
dd80759bb9 | ||
|
|
a1c78ea7bf | ||
|
|
5794ac2340 | ||
|
|
44e1a2d8e2 | ||
|
|
3a62a45bcd | ||
|
|
149bb36805 | ||
|
|
93ccba9bcb | ||
|
|
b24e5cd1c8 | ||
|
|
7fbb5fc82a | ||
|
|
464a8c9794 | ||
|
|
7aea739f87 | ||
|
|
852d5b9c80 | ||
|
|
b4d7238eb8 | ||
|
|
ee87d28252 | ||
|
|
6ffe12cede | ||
|
|
d6adc1f6cb | ||
|
|
5f8b5cbb20 | ||
|
|
7b9cb98bbb | ||
|
|
222eb25eb5 | ||
|
|
dbfdb13166 | ||
|
|
d38cdccbcd | ||
|
|
2575c7fb5f | ||
|
|
ea174560b1 | ||
|
|
bc51dddcaf | ||
|
|
f09dec5fb7 | ||
|
|
8e8571da6a | ||
|
|
0d576aa521 | ||
|
|
0e1b401abe | ||
|
|
bf7fc41e0f | ||
|
|
90bc1da434 | ||
|
|
dc98e31e4d | ||
|
|
1d7996dc47 | ||
|
|
2b3db52c70 | ||
|
|
b65a22b32a | ||
|
|
b849e52c17 | ||
|
|
588b11185a | ||
|
|
dfc963880a | ||
|
|
00975769a0 | ||
|
|
f7a3d6cca5 | ||
|
|
8f71795844 | ||
|
|
8106413644 | ||
|
|
5e472badf1 | ||
|
|
2a2f92f7c2 | ||
|
|
f3b7bca3cf | ||
|
|
9fbf5a4004 | ||
|
|
5d637360cc | ||
|
|
7d8f0c781f | ||
|
|
a212210c35 | ||
|
|
ba40925335 | ||
|
|
eab92ccb03 | ||
|
|
fc17d02451 | ||
|
|
37d514c949 | ||
|
|
a4297ef0fd | ||
|
|
c65eca58c9 | ||
|
|
18bb74e5c5 | ||
|
|
af1978fa4e | ||
|
|
5cf802eda0 | ||
|
|
80cc988f2f | ||
|
|
076795562e | ||
|
|
f5fef6eebc | ||
|
|
375ec36246 | ||
|
|
b00a17059a | ||
|
|
bcab7fef84 | ||
|
|
d2bb569ee4 | ||
|
|
52b426a343 | ||
|
|
f4fbc90217 | ||
|
|
e0ab8c581d | ||
|
|
094cdf1c7b | ||
|
|
814577fcc6 | ||
|
|
15925b66c6 | ||
|
|
925b280fd2 | ||
|
|
6b405eccd0 | ||
|
|
15326cdbad | ||
|
|
bd0b51c9ef | ||
|
|
9a4c66006e | ||
|
|
1c52780b62 | ||
|
|
bee5515e9a | ||
|
|
0a7f404d09 | ||
|
|
1dea649cff | ||
|
|
7396d8818b | ||
|
|
2d80af1dcb | ||
|
|
b5cd90a342 | ||
|
|
5358380c5f | ||
|
|
eead3a7038 | ||
|
|
ce370ec48f | ||
|
|
24ebf6bd6f | ||
|
|
b0d4386744 | ||
|
|
0c673b6a44 | ||
|
|
e89b48d23f | ||
|
|
f9ce31f98b | ||
|
|
bd131e5e4b | ||
|
|
f3132c5290 | ||
|
|
babb247e2a | ||
|
|
cc4f94f415 | ||
|
|
9885d5d9f5 | ||
|
|
8e5663a32f | ||
|
|
4bbfc3857a | ||
|
|
5404ce3c0a | ||
|
|
2289673a30 | ||
|
|
6aed6e659f | ||
|
|
42c92f80f1 | ||
|
|
fa16ee8dcb | ||
|
|
70f3e5ed05 | ||
|
|
2dc8f59bf4 | ||
|
|
d5778bad2f | ||
|
|
81c8121551 | ||
|
|
97b7555119 | ||
|
|
a5214abd04 | ||
|
|
bf8bcfafe2 | ||
|
|
8cb64698aa | ||
|
|
163d7f9791 | ||
|
|
a649a3eb50 | ||
|
|
2a8398dfb8 | ||
|
|
fd891081c4 | ||
|
|
953b7bdd59 | ||
|
|
1dde3d6e56 | ||
|
|
ec49b68b38 | ||
|
|
68590c2b27 | ||
|
|
ac4b089b18 | ||
|
|
005c196ed8 | ||
|
|
3b5803ec9a | ||
|
|
fd4a109ffa | ||
|
|
481d350bf3 | ||
|
|
d121ea84d0 | ||
|
|
a5ac41c203 | ||
|
|
e4457335b8 | ||
|
|
680f8f31ab | ||
|
|
6650eb4cd2 | ||
|
|
799fe7a5ba | ||
|
|
9a4d7b9956 | ||
|
|
fe8d2ba72f | ||
|
|
e90591bb78 | ||
|
|
e2a3565971 | ||
|
|
aeab047ede | ||
|
|
777e667f08 | ||
|
|
fa6f068fd1 | ||
|
|
439ae629e0 | ||
|
|
17fad79f71 | ||
|
|
d8531a2407 | ||
|
|
c805843e64 | ||
|
|
880f1008d6 | ||
|
|
be9cd800b0 | ||
|
|
0106cf7ae0 | ||
|
|
50303eea23 | ||
|
|
339e82d7aa | ||
|
|
5a25652c21 | ||
|
|
8f675c37fc | ||
|
|
5809b01388 | ||
|
|
f104d68569 | ||
|
|
10edba936b | ||
|
|
bbb5e99f25 | ||
|
|
ea94549cb2 | ||
|
|
9a97a80efc | ||
|
|
e4cac595c2 | ||
|
|
cf3d7def33 | ||
|
|
24bc77a935 | ||
|
|
9dd1c81d41 | ||
|
|
cddd3b552a | ||
|
|
5aa5563622 | ||
|
|
09b850cc6f | ||
|
|
273d609bac | ||
|
|
288b4564e4 | ||
|
|
78a36df901 | ||
|
|
1c1587eef6 | ||
|
|
11b810721a | ||
|
|
e5eba61cf0 | ||
|
|
54a2c13b2e | ||
|
|
b2410e428a | ||
|
|
208f24a20c | ||
|
|
8cd33a5e41 | ||
|
|
905a434179 | ||
|
|
222155d7e2 | ||
|
|
28549e35fe | ||
|
|
8f6cfa8769 | ||
|
|
f411a34af5 | ||
|
|
1de8d432d4 | ||
|
|
515a4cad73 | ||
|
|
4beacc4ca0 | ||
|
|
9c7231ee75 | ||
|
|
e31902dc4c | ||
|
|
53853a25b0 | ||
|
|
858bce7b4e | ||
|
|
77d355560f | ||
|
|
733758a909 | ||
|
|
90df2111b7 | ||
|
|
31732631fc | ||
|
|
c4d78e6422 | ||
|
|
52463fa25b | ||
|
|
96373f6959 | ||
|
|
0a67c06b51 | ||
|
|
babce70c95 | ||
|
|
4cf509989f | ||
|
|
6185bf6f61 | ||
|
|
2c31beb6e7 | ||
|
|
9f3270afaf | ||
|
|
fe2cfe2dba | ||
|
|
1ee574944c | ||
|
|
80375e68dd | ||
|
|
289d1dd7f3 | ||
|
|
f2c7e9c939 | ||
|
|
dc36dbac27 | ||
|
|
d9534325cf | ||
|
|
c221361874 | ||
|
|
70ebeda7ed | ||
|
|
11faa8149e | ||
|
|
70487a43d4 | ||
|
|
a93ae2558f | ||
|
|
c2ba9129ad | ||
|
|
c2a74b767b | ||
|
|
123c8dbd6a | ||
|
|
40ff62fa60 | ||
|
|
84397ef013 | ||
|
|
a2b7cec17b | ||
|
|
e80e7a10d4 | ||
|
|
8c4d1909f4 | ||
|
|
bb8ecd7e08 | ||
|
|
a7e1c730b2 | ||
|
|
6f1fc6c403 | ||
|
|
9f3aab6a62 | ||
|
|
44256740bd | ||
|
|
156ad0dbf5 | ||
|
|
5056d375f2 | ||
|
|
b68e801975 | ||
|
|
987f0e3016 | ||
|
|
713deba83f | ||
|
|
b9d0d80946 | ||
|
|
84cd489d24 | ||
|
|
708beb4874 | ||
|
|
4e8574bd23 | ||
|
|
fbdfba2509 | ||
|
|
e033866651 | ||
|
|
76094b8c7e | ||
|
|
e336f877c2 | ||
|
|
7f699b36ff | ||
|
|
e041b9a51c | ||
|
|
0a222a2ff7 | ||
|
|
031de097db | ||
|
|
d4361fc7d7 | ||
|
|
44617bfa9b | ||
|
|
6352106aaa | ||
|
|
7412a0e74e | ||
|
|
19d17adcfb | ||
|
|
e1e7a704e1 | ||
|
|
19dd6c391f | ||
|
|
c5cab4e719 | ||
|
|
b48f6d1405 | ||
|
|
c466f8824f | ||
|
|
2b16cd93bf | ||
|
|
0c39165701 | ||
|
|
9d1234d83a | ||
|
|
dfaa979b99 | ||
|
|
611966de63 | ||
|
|
4341df4094 | ||
|
|
83f8ec1397 | ||
|
|
fdd98879bf | ||
|
|
406f707d9a | ||
|
|
5e34b8736a | ||
|
|
7b946fa9b1 | ||
|
|
0178d1d2ee | ||
|
|
0c06f09d6d | ||
|
|
a82c6122d5 | ||
|
|
2e56f2d780 | ||
|
|
2562d637cd | ||
|
|
f69b1841e0 | ||
|
|
a3bccae173 | ||
|
|
a21144b834 | ||
|
|
7f92660598 | ||
|
|
3b60c855e1 | ||
|
|
a709041b8b | ||
|
|
8bb27ba8c4 | ||
|
|
bd4c4b5959 | ||
|
|
fb6d0f9006 | ||
|
|
6e863ecb50 | ||
|
|
764bf251cd | ||
|
|
91586bc6f6 | ||
|
|
f971fb921e | ||
|
|
c730e45f0c | ||
|
|
5c27429958 | ||
|
|
8010d6706e | ||
|
|
9c6708513a | ||
|
|
21b9b5e741 | ||
|
|
3f49b85680 | ||
|
|
65bb7a623c | ||
|
|
4293c1e138 | ||
|
|
b8e94ec066 | ||
|
|
e15872982e | ||
|
|
e4f7ddacb3 | ||
|
|
c69dede728 | ||
|
|
39370db55d | ||
|
|
73bb986737 | ||
|
|
98b9d31f24 | ||
|
|
ecf9d25ed0 | ||
|
|
668d461104 | ||
|
|
29553ba7a1 | ||
|
|
cacbd596c9 | ||
|
|
6203737093 | ||
|
|
5f642eb3e3 | ||
|
|
92a241a29e | ||
|
|
c838e1ed5b | ||
|
|
d38db89626 | ||
|
|
3f0b1e2cdc | ||
|
|
f518c6578c | ||
|
|
2dec8f449a | ||
|
|
1ef913cd36 | ||
|
|
affc6d61ca | ||
|
|
f278b27119 | ||
|
|
37bb0b89f0 | ||
|
|
02bddd251a | ||
|
|
c12fa7b4c4 | ||
|
|
b32751a693 | ||
|
|
fc1db87318 | ||
|
|
365f3fb651 | ||
|
|
a7ee681515 | ||
|
|
b02bcde8e0 | ||
|
|
bef5ccda0b | ||
|
|
a2cd2ae5a8 | ||
|
|
698e20a990 | ||
|
|
b6ad76fe1a | ||
|
|
22957a8082 | ||
|
|
8dfd5e82cb | ||
|
|
65efeec4e9 | ||
|
|
15bb334e81 | ||
|
|
77f906376e | ||
|
|
9b22f167f1 | ||
|
|
b401f42520 | ||
|
|
2949449e25 | ||
|
|
2b971400fa | ||
|
|
22df34fc70 | ||
|
|
490581a0eb | ||
|
|
0737cfb84e | ||
|
|
58895c3cf6 | ||
|
|
7fb832aa4e | ||
|
|
673c6505ae | ||
|
|
1fef434f01 | ||
|
|
495fc61a34 | ||
|
|
f80d0dab08 | ||
|
|
fb1ac8d766 | ||
|
|
bc47bd28ab | ||
|
|
5cf4771397 | ||
|
|
8891b277c6 | ||
|
|
e4abd4234d | ||
|
|
fe33fd6d86 | ||
|
|
bf75ace695 | ||
|
|
5b1b430403 | ||
|
|
424bd7e38c | ||
|
|
180ed573a5 | ||
|
|
a9b6b5b704 | ||
|
|
064d171332 | ||
|
|
30445712a5 | ||
|
|
91b6d45178 | ||
|
|
3312983b27 | ||
|
|
fecd1bde83 | ||
|
|
0176e03e36 | ||
|
|
8c35429ba3 | ||
|
|
9957cd4a2a | ||
|
|
ae7eeda88a | ||
|
|
3f4d75c8d6 | ||
|
|
1bcd361456 | ||
|
|
7962b21c00 | ||
|
|
59002d5081 | ||
|
|
ce883d2041 | ||
|
|
96847c1199 | ||
|
|
df1f12778f | ||
|
|
dff234112b | ||
|
|
e18e08ff08 | ||
|
|
f3ed562983 | ||
|
|
969fb4c981 | ||
|
|
82fcc307ef | ||
|
|
1fdab5ac0e | ||
|
|
389831218e | ||
|
|
7b5ef3ae58 | ||
|
|
9d28549f32 | ||
|
|
6cdea62638 | ||
|
|
3dd0977635 | ||
|
|
ba71ac78d9 | ||
|
|
373714c02f | ||
|
|
927b72abd2 | ||
|
|
f89e859415 | ||
|
|
dae73e21b8 | ||
|
|
f950bf4362 | ||
|
|
0621e8d1b1 | ||
|
|
5a185a0fbd | ||
|
|
45fd622491 | ||
|
|
5e7a74e2e7 | ||
|
|
94625a8fa8 | ||
|
|
dbe703cfb0 | ||
|
|
bc30899168 | ||
|
|
ce98bc9437 | ||
|
|
d39f929675 | ||
|
|
b589864144 | ||
|
|
9e0202b38f | ||
|
|
ba41685353 | ||
|
|
bb91bd2279 | ||
|
|
8b2c73de4e | ||
|
|
715d8d3881 | ||
|
|
5ad743e182 | ||
|
|
b0917d987a | ||
|
|
99d2e5233d | ||
|
|
e11e12f01d | ||
|
|
c71723101a | ||
|
|
262a641396 | ||
|
|
4d2f4ce78c | ||
|
|
51ce505d7d | ||
|
|
f85737bf29 | ||
|
|
ed4130bd2f | ||
|
|
0fbdd5e56e | ||
|
|
cc4d09423a | ||
|
|
db76671d4d | ||
|
|
05e6f06b62 | ||
|
|
f36adac8ab | ||
|
|
121268d320 | ||
|
|
e6b6543c33 | ||
|
|
e00e4a6c13 | ||
|
|
e588dfdbce | ||
|
|
2f40d19193 | ||
|
|
7a485b1a71 | ||
|
|
abc74464a0 | ||
|
|
9882dd5eff | ||
|
|
bb92a059b6 | ||
|
|
47a579f54f | ||
|
|
6746f1d13c | ||
|
|
74939c20c4 | ||
|
|
b9b31a5e72 | ||
|
|
8eab90418a | ||
|
|
83cddd8941 | ||
|
|
e8c0ba2a47 | ||
|
|
cb6adc643b | ||
|
|
0454950564 | ||
|
|
4f9bcc5ecc | ||
|
|
39e32ea7c1 | ||
|
|
2f3dcf7a16 | ||
|
|
6f0dceee09 | ||
|
|
9614c60cf6 | ||
|
|
cca758d332 | ||
|
|
52a4ca99a8 | ||
|
|
72b3f3f612 | ||
|
|
f62022cdf3 | ||
|
|
726af89168 | ||
|
|
c1c1754171 | ||
|
|
68a1ec2eb1 | ||
|
|
b85b554db1 | ||
|
|
dc04118469 | ||
|
|
7276f49f54 | ||
|
|
4704c9a0ad | ||
|
|
c15b357889 | ||
|
|
46204a9f86 | ||
|
|
5b07569eb9 | ||
|
|
b55412a0c4 | ||
|
|
81d3337681 | ||
|
|
41ee45d9f7 | ||
|
|
79e7201854 | ||
|
|
ddf899ad1e | ||
|
|
7702ed66a0 | ||
|
|
b8d7a2b8e6 | ||
|
|
8a0fb03e21 | ||
|
|
1e4f312352 | ||
|
|
77270adb96 | ||
|
|
42170e4e57 | ||
|
|
318ba1decd | ||
|
|
1fbbf0e837 | ||
|
|
6795590603 | ||
|
|
196120fabd | ||
|
|
dd3725a452 | ||
|
|
c8cd67c989 | ||
|
|
aea87a9a2f | ||
|
|
aa0e41c389 | ||
|
|
c4a1cad81b | ||
|
|
0f3fbb267b | ||
|
|
a17b3fc838 | ||
|
|
dd8feb49aa | ||
|
|
b572028e95 | ||
|
|
a01a1b4556 | ||
|
|
3121b34d17 | ||
|
|
36305e5bd8 | ||
|
|
541e3b6eb4 | ||
|
|
a24f4421d6 | ||
|
|
e8399416ae | ||
|
|
d0fa8acf86 | ||
|
|
ced7bef274 | ||
|
|
311644f39b | ||
|
|
91e40e668c | ||
|
|
987f6237c4 | ||
|
|
b9a8310f4b | ||
|
|
ddba4b90c3 | ||
|
|
98f98048bc | ||
|
|
367ac04ed8 | ||
|
|
43b18b20cc | ||
|
|
06d8dba4a0 | ||
|
|
b79c3aadd2 | ||
|
|
46985bf750 | ||
|
|
36b3878a45 | ||
|
|
bc8120c864 | ||
|
|
8b6d9d8216 | ||
|
|
413bf85dde | ||
|
|
97ef85c9aa | ||
|
|
f649172580 | ||
|
|
aad76acb68 | ||
|
|
5eb1c411a5 | ||
|
|
0d6001a196 | ||
|
|
0ab21da820 | ||
|
|
204bd29e52 | ||
|
|
fd8b37dc14 | ||
|
|
94550682d7 | ||
|
|
7754f96549 | ||
|
|
ee2d01ed88 | ||
|
|
e97f9fca22 | ||
|
|
177c06b1f1 | ||
|
|
cc348dcca2 | ||
|
|
8622af77c1 | ||
|
|
3b21f469ca | ||
|
|
82033d5029 | ||
|
|
da5ccbf7d1 | ||
|
|
a22a92b481 | ||
|
|
5bd262f9e9 | ||
|
|
2b93ef1d75 | ||
|
|
05abfc8ded | ||
|
|
de8e810792 | ||
|
|
cb28380f47 | ||
|
|
d104335501 | ||
|
|
7263cc675b | ||
|
|
d850efdd08 | ||
|
|
a6bd0944db | ||
|
|
7df2dd67bd | ||
|
|
5be95aa377 | ||
|
|
c2f978bd1e | ||
|
|
21815a1427 | ||
|
|
877fcb35f4 | ||
|
|
c2f7e166a0 | ||
|
|
e171b4e3f0 | ||
|
|
2a6f31a84e | ||
|
|
bc4473b275 | ||
|
|
43c38a5aeb | ||
|
|
6e5ff1dbe8 | ||
|
|
4edade8079 | ||
|
|
9352988c44 | ||
|
|
e5e0a21fc6 | ||
|
|
fb456e00ac | ||
|
|
851e03966d | ||
|
|
38e3299675 | ||
|
|
dbdeca3032 | ||
|
|
a78e4c6cf3 | ||
|
|
76e785dd5e | ||
|
|
767d0d9046 | ||
|
|
145efb1a33 | ||
|
|
22d2af2a29 | ||
|
|
13801ebd74 | ||
|
|
614fa7b853 | ||
|
|
4b815eece9 | ||
|
|
11f350e63f | ||
|
|
4dc3c7a6a0 | ||
|
|
d106053e4c | ||
|
|
5315751dc9 | ||
|
|
e448a9a4a9 | ||
|
|
5b0d9338fd | ||
|
|
409d7a99f9 | ||
|
|
f77e581468 | ||
|
|
d3217718a9 | ||
|
|
7e76480db4 | ||
|
|
7856141fc4 | ||
|
|
232cf8c28b | ||
|
|
b51805b87e | ||
|
|
392ef77bc5 | ||
|
|
de83c3e9e0 | ||
|
|
050d233e10 | ||
|
|
8c1f834a4a | ||
|
|
cbeb5ab960 | ||
|
|
33a51a1bdc | ||
|
|
73660f779b | ||
|
|
2c79332de7 | ||
|
|
2aec025e16 | ||
|
|
24f486261a | ||
|
|
f0c4944e2c | ||
|
|
cf15872b8d | ||
|
|
78e1b9b7c1 | ||
|
|
967a8d0678 | ||
|
|
fa44cef27b | ||
|
|
29ba3df717 | ||
|
|
aacc222b7d | ||
|
|
341f0bf9e3 | ||
|
|
091c6a3bda | ||
|
|
fd53cad208 | ||
|
|
1b6d6d0dc0 | ||
|
|
40c671b1a5 | ||
|
|
0a8b1c199d | ||
|
|
3a3c823ddb | ||
|
|
900f3c9a09 | ||
|
|
8fe2f747f4 | ||
|
|
adaeff5540 | ||
|
|
d0f91c00cb | ||
|
|
e20a071977 | ||
|
|
737a6921c3 | ||
|
|
44af6978db | ||
|
|
acbdf63a48 | ||
|
|
e59beeb625 | ||
|
|
f01dc8cc34 | ||
|
|
89f0e45b50 | ||
|
|
3f83556128 | ||
|
|
1cdafabc7c | ||
|
|
f9965b4967 | ||
|
|
0de0942f9c | ||
|
|
00a46f104a | ||
|
|
009755ba01 | ||
|
|
53a96f69ef | ||
|
|
e60bc69515 | ||
|
|
fbadb8354f | ||
|
|
02dee05c16 | ||
|
|
b16316ae37 | ||
|
|
f5077dc982 | ||
|
|
634c438b50 | ||
|
|
f468c492b9 | ||
|
|
5410838793 | ||
|
|
91c2618f21 | ||
|
|
beabd3c6b7 | ||
|
|
a81c7bf04b | ||
|
|
a6c3bb4c6d | ||
|
|
902d190a11 | ||
|
|
0142f113a3 | ||
|
|
fe195a86cd | ||
|
|
11845cedd6 | ||
|
|
5e43e2d333 | ||
|
|
15cc47334e | ||
|
|
5989c1883e | ||
|
|
632de523de | ||
|
|
2db7513590 | ||
|
|
ced24f9215 | ||
|
|
b302cad46d | ||
|
|
33838b8c1c | ||
|
|
42fb74ce22 | ||
|
|
74670ec07f | ||
|
|
3450a78992 | ||
|
|
f4ef6180b8 | ||
|
|
f0c25aaa60 | ||
|
|
0f63c1ef8f | ||
|
|
b27966860e | ||
|
|
51566d43bd | ||
|
|
71d085bd13 | ||
|
|
ffb10e7aac | ||
|
|
a5503df32b | ||
|
|
c8db96705f | ||
|
|
f94efab6c3 | ||
|
|
4c0af0f79e | ||
|
|
fc7e327d19 | ||
|
|
045f44c7f9 | ||
|
|
867d13b007 | ||
|
|
40991b93a2 | ||
|
|
949d76b328 | ||
|
|
210a2ccfdf | ||
|
|
3862aad2f7 | ||
|
|
2a005c2f11 | ||
|
|
ab46ac9bd8 | ||
|
|
c51ed84fd8 | ||
|
|
74054ea907 | ||
|
|
f79bc03360 | ||
|
|
b553df860c | ||
|
|
f753a728dd | ||
|
|
3f2e8ebcdf | ||
|
|
a1fe83c070 | ||
|
|
879c94b01e | ||
|
|
da40445d75 | ||
|
|
6235e1ae57 | ||
|
|
3618432107 | ||
|
|
f1cba8a0ea | ||
|
|
489760d2e3 | ||
|
|
caf9fc5687 | ||
|
|
dc93c2afec | ||
|
|
9164c4f309 | ||
|
|
e241f880e8 | ||
|
|
662f1355de | ||
|
|
c865211c2f | ||
|
|
6324068d34 | ||
|
|
e77e18f8c4 | ||
|
|
69c337b31d | ||
|
|
bc99f75b53 | ||
|
|
421582d747 | ||
|
|
ab1606a0f6 | ||
|
|
bcfaeca373 | ||
|
|
5f0e261f2d | ||
|
|
0e1aec4348 | ||
|
|
c1c65777b6 | ||
|
|
89d666155d | ||
|
|
4d6d65ee33 | ||
|
|
dcdb360a19 | ||
|
|
8a73990f51 | ||
|
|
efe229a54b | ||
|
|
d6fdf7d4b1 | ||
|
|
cf180b651b | ||
|
|
2e649e1843 | ||
|
|
1985579148 | ||
|
|
d31dbc6798 | ||
|
|
ffd45a2261 | ||
|
|
135631d29d | ||
|
|
ce7e31cd04 | ||
|
|
4ff1eb1890 | ||
|
|
7c47c917b5 | ||
|
|
7285459375 | ||
|
|
52b7ebd4e7 | ||
|
|
ea6f624b58 | ||
|
|
3cf3b78192 | ||
|
|
cdc2d034de | ||
|
|
cd8a17d644 | ||
|
|
57e3e7f150 | ||
|
|
c759639603 | ||
|
|
a6c101aeb8 | ||
|
|
7ea8a754c1 | ||
|
|
d5667343cb | ||
|
|
0bfe435c4f | ||
|
|
cd39843c75 | ||
|
|
f9ae65acd8 | ||
|
|
cfd930cae7 | ||
|
|
0b7e3610ac | ||
|
|
10946e7669 | ||
|
|
2dcd8c2729 | ||
|
|
dcde1c2a8f | ||
|
|
0810384555 | ||
|
|
434fb1e0da | ||
|
|
435a0b98ac | ||
|
|
05eda236cc | ||
|
|
c998faeeab | ||
|
|
f967933e8b | ||
|
|
8862a1ac8f | ||
|
|
ad56a115be | ||
|
|
c8ed013600 | ||
|
|
c49fc8db72 | ||
|
|
93fa268db1 | ||
|
|
521c92764d | ||
|
|
71d121fab2 | ||
|
|
86970a01d7 | ||
|
|
210496f0ca | ||
|
|
2eb0386c2a | ||
|
|
440c99100b | ||
|
|
33d5e646e5 | ||
|
|
c00a62d37f | ||
|
|
17486408b4 | ||
|
|
c17594c1d0 | ||
|
|
4463239d6e | ||
|
|
45d82c8d99 | ||
|
|
3e302e8683 | ||
|
|
d6620f0f3a | ||
|
|
f7a5b71dba | ||
|
|
a4d14fc987 | ||
|
|
c8587e1242 | ||
|
|
4e62a88870 | ||
|
|
32f6e7e231 | ||
|
|
94f7bcef67 | ||
|
|
36e90a1bd5 | ||
|
|
9fbe900949 | ||
|
|
73f1511ac2 | ||
|
|
5937932370 | ||
|
|
794c93b540 | ||
|
|
b92ac33022 | ||
|
|
90bbcbf994 | ||
|
|
151995f88c | ||
|
|
611b3c4c2c | ||
|
|
2a6104ab17 | ||
|
|
1dcd4cc220 | ||
|
|
7174578ac3 | ||
|
|
10d09049bb | ||
|
|
98c6a4e86e | ||
|
|
3bd52891c5 | ||
|
|
ee752ab1ce | ||
|
|
9eb900c448 | ||
|
|
0e919d25e9 | ||
|
|
4ed34d2c6f | ||
|
|
c893b44da2 | ||
|
|
d06a736f41 | ||
|
|
b135a0aa49 | ||
|
|
c73daef2a1 | ||
|
|
bc08c1d2b7 | ||
|
|
8451feaa7a | ||
|
|
e30823769c | ||
|
|
12e3b52f4d | ||
|
|
5812b22662 | ||
|
|
f139b14a3c | ||
|
|
291f1382c5 | ||
|
|
e0fe83740a | ||
|
|
9012ec5310 | ||
|
|
c37ecb1552 | ||
|
|
59d8e76081 | ||
|
|
5097ac05bf | ||
|
|
a9c154691b | ||
|
|
d628a9bc78 | ||
|
|
2fb1859732 | ||
|
|
5f5d16c698 | ||
|
|
f666e772a2 | ||
|
|
8974b12af5 | ||
|
|
f96d5c9633 | ||
|
|
50336aaedd | ||
|
|
6a04357547 | ||
|
|
0da64f430e | ||
|
|
e27ab3a24f | ||
|
|
121de4ef47 | ||
|
|
77f7d99048 | ||
|
|
4b035b9902 | ||
|
|
9778b1411c | ||
|
|
636ff411f1 | ||
|
|
02598d1e91 | ||
|
|
31aea3c996 | ||
|
|
a60f2588d6 | ||
|
|
d518f5f307 | ||
|
|
d5cbacba50 | ||
|
|
ab0f3da650 | ||
|
|
52de24b95b | ||
|
|
70b60bbe16 | ||
|
|
aff890bce8 | ||
|
|
905f1609b3 | ||
|
|
c978b25f7f | ||
|
|
2b526756f0 | ||
|
|
8a436d5103 | ||
|
|
1dd050aaca | ||
|
|
99bcce7892 | ||
|
|
0e2ea94f5e | ||
|
|
9cd7abdd6e | ||
|
|
dbacfe0a1d | ||
|
|
d50494f274 | ||
|
|
4b5e867a69 | ||
|
|
969306f0f1 | ||
|
|
af722a2978 | ||
|
|
7fce9346dc | ||
|
|
b23a6172ed | ||
|
|
ea58a8103c | ||
|
|
7857c22277 | ||
|
|
b3c7e948be | ||
|
|
c966a538fb | ||
|
|
3027a7d7e2 | ||
|
|
dd22176935 | ||
|
|
dbf9d0f094 | ||
|
|
b3218d45f3 | ||
|
|
3ca5184998 | ||
|
|
007ab69777 | ||
|
|
12d374d4b7 | ||
|
|
0ddd7de1ba | ||
|
|
f385193a89 | ||
|
|
ff078920bc | ||
|
|
b62f443be5 | ||
|
|
553c4203ab | ||
|
|
df16a7c4f3 | ||
|
|
896535fe87 | ||
|
|
89434f6a2f | ||
|
|
4e520cdd30 | ||
|
|
72dcdb7655 | ||
|
|
db5510b866 | ||
|
|
61e0efa0c7 | ||
|
|
12514c09b2 | ||
|
|
90a0590de1 | ||
|
|
b09c891290 | ||
|
|
d28bb04a9c | ||
|
|
9de1c71ff7 | ||
|
|
3ce6dd166c | ||
|
|
684bef066f | ||
|
|
52f2221be9 | ||
|
|
1bee131d52 | ||
|
|
2731976a95 | ||
|
|
f7d5e81130 | ||
|
|
371bc91d73 | ||
|
|
89771de6d0 | ||
|
|
71b213df63 | ||
|
|
7f3913ff58 | ||
|
|
d884034c9f | ||
|
|
bec199c4a2 | ||
|
|
3686110ed2 | ||
|
|
708e421ec3 | ||
|
|
5ae7ee5276 | ||
|
|
65493b421a | ||
|
|
301511a840 | ||
|
|
e86a0a4325 | ||
|
|
8d05279599 | ||
|
|
587e0e3e0c | ||
|
|
2315f32ca0 | ||
|
|
5a71509353 | ||
|
|
a310bc19a7 | ||
|
|
0647533f8c | ||
|
|
99dd78964a | ||
|
|
0d1606ff23 | ||
|
|
a6a92d42f9 | ||
|
|
2aabe16163 | ||
|
|
5984c996a8 | ||
|
|
c8d126f6ef | ||
|
|
9004554da3 | ||
|
|
4eb9efdd33 | ||
|
|
83740d81f2 | ||
|
|
c8581e4cd9 | ||
|
|
612e33c499 | ||
|
|
3e8ac30940 | ||
|
|
4bcddd72e6 | ||
|
|
00bb70a62d | ||
|
|
b4990b5bb4 | ||
|
|
65095253a9 | ||
|
|
c87efb77bc | ||
|
|
03159254ce | ||
|
|
ec5cf8593e | ||
|
|
9f065c0ea5 | ||
|
|
df3f05e824 | ||
|
|
9a10afbbc6 | ||
|
|
8d916b8573 | ||
|
|
653657ae43 | ||
|
|
b0b7240022 | ||
|
|
1e82003bf9 | ||
|
|
4be7fccad3 | ||
|
|
b040ace4c2 | ||
|
|
ab572ce5b9 | ||
|
|
ded77f59cd | ||
|
|
a1c5415f8f | ||
|
|
00e8988b52 | ||
|
|
5680808fb6 | ||
|
|
814bcc04ad | ||
|
|
a8cbff08ef | ||
|
|
ee8a05c3c7 | ||
|
|
46d7f6f95d | ||
|
|
30c89310a6 | ||
|
|
d6e1b86147 | ||
|
|
a8e973f5d7 | ||
|
|
c4d1354c54 | ||
|
|
dc2e700057 | ||
|
|
bfe0c3a8e0 | ||
|
|
a387270b76 | ||
|
|
59b659b027 | ||
|
|
973472c51e | ||
|
|
9052511c86 | ||
|
|
f57d4818a4 | ||
|
|
c5973dd411 | ||
|
|
e5f38bf391 | ||
|
|
6b4db944dd | ||
|
|
0a761d238a | ||
|
|
c8f026c382 | ||
|
|
2c70c12814 | ||
|
|
b31f6eb45f | ||
|
|
d387c1c83a | ||
|
|
7a1a2b9aa6 | ||
|
|
444da3ecec | ||
|
|
1918914598 | ||
|
|
29f3f2e1d8 | ||
|
|
759d11ce1a | ||
|
|
729e24da78 | ||
|
|
ec362536f5 | ||
|
|
b92fe3eecb | ||
|
|
985de035bc | ||
|
|
2e40ceaaa4 | ||
|
|
02a797f9f9 | ||
|
|
b938154f6b | ||
|
|
e312ebcb57 | ||
|
|
02cf50063e | ||
|
|
f511bec26c | ||
|
|
9f93c16bbf | ||
|
|
892e75ca92 | ||
|
|
5e73068e09 | ||
|
|
b71d9ce3f6 | ||
|
|
730529353d | ||
|
|
101f57d5e0 | ||
|
|
2cfc9e286e | ||
|
|
998ed99288 | ||
|
|
9048a7f021 | ||
|
|
1c91bb5a20 | ||
|
|
b957a81ea5 | ||
|
|
19fdeae4ba | ||
|
|
50ecd2c12c | ||
|
|
07f9212799 | ||
|
|
8a8cba75a2 | ||
|
|
1ae3808e13 | ||
|
|
ee2936ffbf | ||
|
|
5b29f1cdec | ||
|
|
bce29ac353 | ||
|
|
f7584fa883 | ||
|
|
18074ff98f | ||
|
|
4ad60b477c | ||
|
|
69469496e2 | ||
|
|
baaa2592a6 | ||
|
|
ecb8aa6fc1 | ||
|
|
34210901bf | ||
|
|
7132893863 | ||
|
|
cfe04d4453 | ||
|
|
f98f2890f3 | ||
|
|
d93c21349f | ||
|
|
9358dbbd99 | ||
|
|
2b9d304816 | ||
|
|
e6465a6f44 | ||
|
|
4aa9244b92 | ||
|
|
1ac4d1b793 | ||
|
|
ea205f2fcd | ||
|
|
9c15ffbb74 | ||
|
|
09b4485870 | ||
|
|
19282d6d6c | ||
|
|
ee85aaccd2 | ||
|
|
0afc34f6fc | ||
|
|
45bfccfddc | ||
|
|
f8501478f6 | ||
|
|
a5582e0960 | ||
|
|
b4fe72c4a2 | ||
|
|
48f7678771 | ||
|
|
808098413c | ||
|
|
74fd2dc9ad | ||
|
|
443b2551c7 | ||
|
|
7b681bc94a | ||
|
|
bd29f7168c | ||
|
|
c8c0dc2f53 | ||
|
|
17c6be6a9b | ||
|
|
318e752fd6 | ||
|
|
3dcfd7ba41 | ||
|
|
604a92dc3d | ||
|
|
b146ae96a7 | ||
|
|
0963e91c34 | ||
|
|
5d13b5a2fb | ||
|
|
90db821036 | ||
|
|
99d1fdd270 | ||
|
|
10ab72855d | ||
|
|
0d18516af8 | ||
|
|
e22c815444 | ||
|
|
e579e98469 | ||
|
|
723eaa1f40 | ||
|
|
4ebeeaf1e0 | ||
|
|
2c9ceea3cf | ||
|
|
c289872ab7 | ||
|
|
9469bdc93e | ||
|
|
9b4564d7f3 | ||
|
|
b5b5844119 | ||
|
|
6ef7563f53 | ||
|
|
e3e3200f95 | ||
|
|
7a0f814043 | ||
|
|
80b62df0a9 | ||
|
|
81d4e201bb | ||
|
|
8155b8cfb3 | ||
|
|
276e35ecfb | ||
|
|
7d8657287e | ||
|
|
f7905582db | ||
|
|
f12e6837be | ||
|
|
3870031c6e | ||
|
|
060a1fc727 | ||
|
|
28783abbe2 | ||
|
|
974a853f40 | ||
|
|
7ff9825f55 | ||
|
|
04b4971d8c | ||
|
|
6c3f6cfd89 | ||
|
|
ee833ea594 | ||
|
|
338feef70e | ||
|
|
ec68aaf43b | ||
|
|
24df78bcbc | ||
|
|
e926a93568 | ||
|
|
28476e3b7b | ||
|
|
05aa0ad114 | ||
|
|
5ceaed291f | ||
|
|
48934414b2 | ||
|
|
c1804810d8 | ||
|
|
69ee35c909 | ||
|
|
5d2e93e5f0 | ||
|
|
1cbd2121e2 | ||
|
|
c0d9e3231b | ||
|
|
2775fb5a45 | ||
|
|
6ca8bc4037 | ||
|
|
5dd6b1effc | ||
|
|
369e9fbf08 | ||
|
|
e39d012312 | ||
|
|
7d077a2260 | ||
|
|
b30faa577d | ||
|
|
91356d2d03 | ||
|
|
61f0231ce0 | ||
|
|
482a18e6de | ||
|
|
382ddac1a1 | ||
|
|
2b3e020152 | ||
|
|
01391f0234 | ||
|
|
32c6f96000 | ||
|
|
a883fe7b8e | ||
|
|
5d74d97fe1 | ||
|
|
db4844e3f0 | ||
|
|
7ca4fd817e | ||
|
|
8e13bcd43d | ||
|
|
cacdbb5262 | ||
|
|
35729f0870 | ||
|
|
0ff98eb2f5 | ||
|
|
dbe33783c9 | ||
|
|
f38352f1af | ||
|
|
1bf2e313f6 | ||
|
|
ca26fd17a7 | ||
|
|
4085a3fad4 | ||
|
|
36f470383b | ||
|
|
52dc9ef418 | ||
|
|
bada7e0f92 | ||
|
|
ec93b03d8d | ||
|
|
a5e748de84 | ||
|
|
2809405164 | ||
|
|
79ecf2edb7 | ||
|
|
c2ebf5544b | ||
|
|
d6fbe2a5ad | ||
|
|
b89e10c3e6 | ||
|
|
5a6c64cc28 | ||
|
|
aecbce283d | ||
|
|
60f920df0e | ||
|
|
da19974e81 | ||
|
|
ab9feb2e35 | ||
|
|
b8d798158b | ||
|
|
82d7c78b0c | ||
|
|
0074b7becb | ||
|
|
33237419c1 | ||
|
|
aa6f6bc3aa | ||
|
|
f1e023af85 | ||
|
|
f71a590375 | ||
|
|
9f48488d87 | ||
|
|
085c1594de | ||
|
|
56c6301089 | ||
|
|
e303f30d10 | ||
|
|
4b9883a573 | ||
|
|
9fb46e1206 | ||
|
|
8216303524 | ||
|
|
6c7357bbf9 | ||
|
|
13add693db | ||
|
|
a491aa0f6a | ||
|
|
e8f49f1b95 | ||
|
|
0a8c53575c | ||
|
|
3c40d93f36 | ||
|
|
4335e99f2e | ||
|
|
1fd4b851f5 | ||
|
|
142cc8fe2a | ||
|
|
5c37c63cef | ||
|
|
39caf630a9 | ||
|
|
b0502d1f3b | ||
|
|
7c9b545b30 | ||
|
|
678dcc2ca5 | ||
|
|
54d4d9a881 | ||
|
|
a5e06ed5b7 | ||
|
|
63038e0305 | ||
|
|
7cea4d7df6 | ||
|
|
936066aa03 | ||
|
|
e7f3224091 | ||
|
|
974f6982a1 | ||
|
|
7fe7e1e984 | ||
|
|
9148ab79f3 | ||
|
|
1204f15bfa | ||
|
|
f1c7e73bef | ||
|
|
c18abd4fbe | ||
|
|
c3ac875055 | ||
|
|
dbd125c714 | ||
|
|
695e001984 | ||
|
|
33b42872e5 | ||
|
|
8bb7602145 | ||
|
|
d9e2edd1df | ||
|
|
f9d80d5bd2 | ||
|
|
406874b6c2 | ||
|
|
e4ddd6cb6d | ||
|
|
a7745e9a86 | ||
|
|
3fd7bc8058 | ||
|
|
25e398a8f0 | ||
|
|
c31b03327f | ||
|
|
f6d56e2937 | ||
|
|
ca7769e041 | ||
|
|
c0aef7dd6b | ||
|
|
4283ecf774 | ||
|
|
88a57dc98d | ||
|
|
035ecef8a5 | ||
|
|
4c3b6814dc | ||
|
|
3f016fcc5a | ||
|
|
be75c483d0 | ||
|
|
08dd32d32d | ||
|
|
b49584457a | ||
|
|
40d25adb88 | ||
|
|
a38e5a44ec | ||
|
|
3fceef0936 | ||
|
|
c065427ebe | ||
|
|
c82f04f54c | ||
|
|
d9d0c52770 | ||
|
|
c60635855d | ||
|
|
2666d6df90 | ||
|
|
8558fa0bcf | ||
|
|
f36d6b7ef5 | ||
|
|
e9908048ec | ||
|
|
dceed2ea5c | ||
|
|
7b63878926 | ||
|
|
01ecd3517e | ||
|
|
fbdea8dc71 | ||
|
|
58d0e8b28f | ||
|
|
07fbe82305 | ||
|
|
05a967564a | ||
|
|
75ef1278e6 | ||
|
|
fc158ad5c0 | ||
|
|
4d69d0eda5 | ||
|
|
d7ba4bbb9b | ||
|
|
2225b8add7 | ||
|
|
9572db262c | ||
|
|
515e4b9187 | ||
|
|
c1dc1a20d6 | ||
|
|
a58083b11e | ||
|
|
0f24fba28a | ||
|
|
4d774e275d | ||
|
|
a2d6a50dff | ||
|
|
08b56e8180 | ||
|
|
7a77917df6 | ||
|
|
e432014a88 | ||
|
|
a89db9872d | ||
|
|
6dcc85dcf4 | ||
|
|
a375ea4ee2 | ||
|
|
d74464e091 | ||
|
|
e2c2afbbe0 | ||
|
|
cffe54d094 | ||
|
|
2f02120fee | ||
|
|
c0b534e531 | ||
|
|
5eaef50a77 | ||
|
|
a80c4d147c | ||
|
|
ad66b2bf13 | ||
|
|
ef6ec9de01 | ||
|
|
751deac9d1 | ||
|
|
406da499ff | ||
|
|
a6b48d5273 | ||
|
|
6272b5c58c | ||
|
|
8c9b99458d | ||
|
|
3273c68b63 | ||
|
|
a44e2190d6 | ||
|
|
2dab478c3f | ||
|
|
a32afb28c0 | ||
|
|
d2a89b424b | ||
|
|
9502cd7047 | ||
|
|
cd02450095 | ||
|
|
03a3412e62 | ||
|
|
33086e6db0 | ||
|
|
d7a951996b | ||
|
|
38bfe50508 | ||
|
|
a70567e74f | ||
|
|
db472c73c1 | ||
|
|
29824f9baa | ||
|
|
32b1a9fc8a | ||
|
|
018719d9d3 | ||
|
|
8ae472821f | ||
|
|
26911ff21c | ||
|
|
5070cc07be | ||
|
|
1e65eb4936 | ||
|
|
13e40f754c | ||
|
|
87cfd930e4 | ||
|
|
8b63a89267 | ||
|
|
94eff945b4 | ||
|
|
039737ffc2 | ||
|
|
08370c7230 | ||
|
|
2f9b28c0fc | ||
|
|
4e1320d480 | ||
|
|
e6202cfa97 | ||
|
|
a15b28a24e | ||
|
|
9975dbeded | ||
|
|
2cf5eec62f | ||
|
|
51012d07cc | ||
|
|
252abbeb8d | ||
|
|
357b28f675 | ||
|
|
bf37afd7c7 | ||
|
|
f311045320 | ||
|
|
381a7b110a | ||
|
|
75f2c56558 | ||
|
|
91333c5d2f | ||
|
|
ee2ba4e52f | ||
|
|
ae300c98a4 | ||
|
|
748b70311e | ||
|
|
8d0664186a | ||
|
|
2fb5a71efd | ||
|
|
4fda366b67 | ||
|
|
2ceae6014e | ||
|
|
cf3162cff1 | ||
|
|
2350d941a5 | ||
|
|
25f9f55878 | ||
|
|
07540f3386 | ||
|
|
fe63f36656 | ||
|
|
434daf87c2 | ||
|
|
c681e5e082 | ||
|
|
549f97b54a | ||
|
|
f47a93b0c1 | ||
|
|
3fe5a99dab | ||
|
|
097bc4c622 | ||
|
|
252126cf76 | ||
|
|
8609d1e790 | ||
|
|
9809f1ff66 | ||
|
|
796098e4c9 | ||
|
|
eb6bcdb3ee | ||
|
|
a1555e0615 | ||
|
|
44b527415f | ||
|
|
ed294c5945 | ||
|
|
bd3ade31fa | ||
|
|
d03d2e6d3d | ||
|
|
58ffa8d526 | ||
|
|
bfe8c15a29 | ||
|
|
2fa7e003b1 | ||
|
|
ba948669cd | ||
|
|
666e84eef2 | ||
|
|
69b15c889d | ||
|
|
ff3bf6d7f5 | ||
|
|
b844129649 | ||
|
|
86059bd5dd | ||
|
|
9927d991ef | ||
|
|
6849b7d555 | ||
|
|
1efd1ee6ac | ||
|
|
d12600fba0 | ||
|
|
769b2a3e30 | ||
|
|
d237ec7e78 | ||
|
|
de1375201f | ||
|
|
13ba8810c7 | ||
|
|
bdfbac2aa6 | ||
|
|
6bd0bd2ed1 | ||
|
|
211a889528 | ||
|
|
3bb29bf63a | ||
|
|
78d52ad2de | ||
|
|
4fe648415f | ||
|
|
6751ac4970 | ||
|
|
6764957d06 | ||
|
|
c719ba7bf3 | ||
|
|
31d7293b17 | ||
|
|
defef2222a | ||
|
|
63459f65fb | ||
|
|
c68e1ceb64 | ||
|
|
07e72d2ac8 | ||
|
|
7f97e354b4 | ||
|
|
e5a554f0b5 | ||
|
|
9e4aa79278 | ||
|
|
a0298728df | ||
|
|
0eb83f6ee6 | ||
|
|
e81f092520 | ||
|
|
7fb874ad28 | ||
|
|
a4a41b9023 | ||
|
|
99aea7eb6f | ||
|
|
b4ac36337f | ||
|
|
7072bc3203 | ||
|
|
7e9f000d0b | ||
|
|
af56eebc6a | ||
|
|
387c778496 | ||
|
|
fbbde125d9 | ||
|
|
dbaefd6126 | ||
|
|
a1c87f7c49 | ||
|
|
045ee53468 | ||
|
|
b84ab718b0 | ||
|
|
6144deb6b6 | ||
|
|
19864a4a08 | ||
|
|
7920b6e163 | ||
|
|
4928166593 | ||
|
|
ad5f520c68 | ||
|
|
150b4fb4f6 | ||
|
|
4f8198b298 | ||
|
|
076f177100 | ||
|
|
3b939480a4 | ||
|
|
773a2767c7 | ||
|
|
e9b29184d0 | ||
|
|
0d02b8d1f6 | ||
|
|
98c0fcc659 | ||
|
|
1ddebcc862 | ||
|
|
1adb900561 | ||
|
|
c5c1012ddd | ||
|
|
519f81771a | ||
|
|
c762c06b17 | ||
|
|
8bab543531 | ||
|
|
bab8c82a35 | ||
|
|
b82bca7c99 | ||
|
|
556a2126b5 | ||
|
|
a070751061 | ||
|
|
847845027f | ||
|
|
c69914367d | ||
|
|
48d364e269 | ||
|
|
c58c27ed8b | ||
|
|
97b8abf16c | ||
|
|
59567b43b0 | ||
|
|
e067e84d69 | ||
|
|
35c670513f | ||
|
|
8ec92b6fe7 | ||
|
|
5552f082e8 | ||
|
|
3c122117fc | ||
|
|
a467d21eba | ||
|
|
bc724ea206 | ||
|
|
4ea5c1d973 | ||
|
|
c65883a727 | ||
|
|
a4f6146667 | ||
|
|
936c6c0d5c | ||
|
|
91af8878e1 | ||
|
|
d2b2ae09e6 | ||
|
|
94c35184a9 | ||
|
|
9e021cd1a8 | ||
|
|
78565026ac | ||
|
|
de6be743c6 | ||
|
|
f534e80c71 | ||
|
|
0797ab6bc6 | ||
|
|
b4df26a75d | ||
|
|
d92c462466 | ||
|
|
f31b905847 | ||
|
|
572e457e77 | ||
|
|
be9b23a082 | ||
|
|
c9e7531251 | ||
|
|
90faecd86e | ||
|
|
6c12e5bfbe | ||
|
|
2e069429c2 | ||
|
|
e65202f825 | ||
|
|
11a3057e8e | ||
|
|
ba0c619844 | ||
|
|
a83fb30836 | ||
|
|
dc092653f4 | ||
|
|
25c6278000 | ||
|
|
5033e0e752 | ||
|
|
295eeef9b6 | ||
|
|
f63b87e28b | ||
|
|
1f780e86d5 | ||
|
|
408a56ffaf | ||
|
|
a84f5d52ff | ||
|
|
fb6eed0087 | ||
|
|
dc242a01b4 | ||
|
|
074d3dd2b1 | ||
|
|
807afbc879 | ||
|
|
8f1eeb1025 | ||
|
|
dd288f70ec | ||
|
|
6a11134a18 | ||
|
|
9b60b55f03 | ||
|
|
77aa06df64 | ||
|
|
9b7860d6ec | ||
|
|
bda73b1bc9 | ||
|
|
8576ee0981 | ||
|
|
8093b55e86 | ||
|
|
b6db4a0e2e | ||
|
|
cd7894dfc9 | ||
|
|
c36d73f42a | ||
|
|
9871c4ff06 | ||
|
|
e330983408 | ||
|
|
4bbf443ba2 | ||
|
|
0234c62c3e | ||
|
|
0bdc27186d | ||
|
|
c51c55b782 | ||
|
|
26250f1953 | ||
|
|
7ecfe6304a | ||
|
|
b7be03801c | ||
|
|
b21cb8a396 | ||
|
|
eadd56a376 | ||
|
|
2aa9a66c57 | ||
|
|
8e9c07df39 | ||
|
|
1d392f0e76 | ||
|
|
08cbc1b22b | ||
|
|
f744d7a789 | ||
|
|
ff2a737094 | ||
|
|
111a1cef52 | ||
|
|
a44b56dc61 | ||
|
|
1b586b69bc | ||
|
|
4a7f2ffc5e | ||
|
|
503162ec54 | ||
|
|
22fad86453 | ||
|
|
8641b8a36e | ||
|
|
be2d3b5886 | ||
|
|
3120487243 | ||
|
|
4404ef0281 | ||
|
|
0c68fc409e | ||
|
|
ea7bf19057 | ||
|
|
99bf9775d9 | ||
|
|
0e2d5f9d0e | ||
|
|
3065b9f968 | ||
|
|
cce5fbc7b1 | ||
|
|
82a4d4ec65 | ||
|
|
708147625f | ||
|
|
93559a54e9 | ||
|
|
f10ddea305 | ||
|
|
4a8ff6d824 | ||
|
|
4b7e3af77c | ||
|
|
19238a910c | ||
|
|
2deb13df43 | ||
|
|
1ece33e79a | ||
|
|
844f5e5af1 | ||
|
|
51bfac71b0 | ||
|
|
81a0fd782f | ||
|
|
3a30e5bf78 | ||
|
|
a87096cdc9 | ||
|
|
527d99fd39 | ||
|
|
6e2722a6d3 | ||
|
|
8694deaabb | ||
|
|
a226099b04 | ||
|
|
336ba8f419 | ||
|
|
5abdc99f3e | ||
|
|
f7ef9887d7 | ||
|
|
fed76f29d0 | ||
|
|
a3cfbfc6ba | ||
|
|
444646b65e | ||
|
|
8bd508a73d | ||
|
|
1cceb4e0ad | ||
|
|
c2d2034ae8 | ||
|
|
f94ed922e5 | ||
|
|
7a57d28db4 | ||
|
|
ce5121e659 | ||
|
|
a7d7158b05 | ||
|
|
6b8c78bacc | ||
|
|
2da930ba4c | ||
|
|
772cac7946 | ||
|
|
42f672d85d | ||
|
|
945f2912a7 | ||
|
|
1ccf516c5e | ||
|
|
fb396b8fac | ||
|
|
6db3026d47 | ||
|
|
becc306300 | ||
|
|
4e7ce11684 | ||
|
|
6589cf9d8e | ||
|
|
552589f098 | ||
|
|
2ec79c03a0 | ||
|
|
21653f0f91 | ||
|
|
b922eaa754 | ||
|
|
d27da93c33 | ||
|
|
2e6fa7f8a3 | ||
|
|
302184938a | ||
|
|
e5355cc45f | ||
|
|
2fe778507a | ||
|
|
4077422ae2 | ||
|
|
a9ac45c5f0 | ||
|
|
7ef99ee6f3 | ||
|
|
e44aada634 | ||
|
|
ac0a864e14 | ||
|
|
3c3331d5ed | ||
|
|
6f21f48937 | ||
|
|
2e227f868b | ||
|
|
7d7513c71c | ||
|
|
d95f1e9913 | ||
|
|
1013b49ab7 | ||
|
|
dc0e15a74e | ||
|
|
d6e5ca722f | ||
|
|
cd3ba00479 | ||
|
|
c549dba725 | ||
|
|
ca1ad99bea | ||
|
|
2c7bd7e591 | ||
|
|
bea45b3c30 | ||
|
|
093c7b4386 | ||
|
|
8332a5aa53 | ||
|
|
eb020656d2 | ||
|
|
31456a6dfe | ||
|
|
03fda0f803 | ||
|
|
c09f03f6e8 | ||
|
|
3bad9ff50a | ||
|
|
0663421d01 | ||
|
|
10175caa38 | ||
|
|
103ad75c50 | ||
|
|
2f5f86d6fc | ||
|
|
89d2c2917f | ||
|
|
05817aa3b9 | ||
|
|
5464ed6661 | ||
|
|
05c84a147d | ||
|
|
9c35403b98 | ||
|
|
b5b075eb04 | ||
|
|
e1261c9620 | ||
|
|
5531bca078 | ||
|
|
28b9dd50ff | ||
|
|
44c2a0a7fc | ||
|
|
d143acfc76 | ||
|
|
b4d59fd52d | ||
|
|
2ee2a1b730 | ||
|
|
86ebc8e46c | ||
|
|
29c5ee6b19 | ||
|
|
323aebf1f5 | ||
|
|
a5dd1ccfaa | ||
|
|
4dd297cef2 | ||
|
|
7f9fea18ae | ||
|
|
adb8b881b4 | ||
|
|
d3d1b69c7a | ||
|
|
922d3716ff | ||
|
|
4158222e86 | ||
|
|
6727c43441 | ||
|
|
55c1ec2925 | ||
|
|
0f1c18e675 | ||
|
|
0de1293ff5 | ||
|
|
89ab390719 | ||
|
|
88ef3ffa50 | ||
|
|
668d5d9d92 | ||
|
|
6c908ac727 | ||
|
|
2c4bd7162f | ||
|
|
cf18e0776d | ||
|
|
8b866beaeb | ||
|
|
ee5fca7a2b | ||
|
|
fc074937f5 | ||
|
|
a17ea13453 | ||
|
|
8bb4ea85b8 | ||
|
|
26e8372c75 | ||
|
|
4704efa32a | ||
|
|
339925e835 | ||
|
|
28360a7f26 | ||
|
|
49bb62d221 | ||
|
|
04f121b88f | ||
|
|
6ce5c8eb78 | ||
|
|
7736cdae1c | ||
|
|
05aa1f1ae4 | ||
|
|
42827cdea2 | ||
|
|
b88dad4034 | ||
|
|
d0645273df | ||
|
|
dea27e105d | ||
|
|
0bfad4392a | ||
|
|
4c1b507c07 | ||
|
|
0289055948 | ||
|
|
83a48dafea | ||
|
|
a7a20a9de4 | ||
|
|
82b67b01ff | ||
|
|
b896203dcf | ||
|
|
795d5807b5 | ||
|
|
7d43f4a1f4 | ||
|
|
c268c5e07c | ||
|
|
517659640e | ||
|
|
a9672e1a21 | ||
|
|
4570f71f21 | ||
|
|
ca2fd867b8 | ||
|
|
624da03bad | ||
|
|
a820f32ec9 | ||
|
|
f5dc6e80c0 | ||
|
|
de70b710af | ||
|
|
bf10a27db8 | ||
|
|
aa2656cb9e | ||
|
|
adf2b2bf03 | ||
|
|
6773326d96 | ||
|
|
1d7efce0dc | ||
|
|
1a1deb5d58 | ||
|
|
bcba806ef0 | ||
|
|
00648c27eb | ||
|
|
4885b39121 | ||
|
|
0f3e70b679 | ||
|
|
372a0f9eea | ||
|
|
2a44bad2e7 | ||
|
|
33e8472473 | ||
|
|
8834a8b216 | ||
|
|
db794c2d32 | ||
|
|
a1d80c29de | ||
|
|
bea796ebc0 | ||
|
|
d4978210f0 | ||
|
|
ef59e952d8 | ||
|
|
54d5ee5562 | ||
|
|
eb75ae05c6 | ||
|
|
b56a1501d2 | ||
|
|
fe9c716fbe | ||
|
|
bc308c21fc | ||
|
|
3e41f36ef5 | ||
|
|
8d2131884c | ||
|
|
289566afe8 | ||
|
|
944adc56ee | ||
|
|
6e81f722ad | ||
|
|
bfa28f4c30 | ||
|
|
3dcd33b08f | ||
|
|
3ac81e9d7c | ||
|
|
1704d21356 | ||
|
|
d690775ca1 | ||
|
|
fb07a28c99 | ||
|
|
1dff9aea62 | ||
|
|
e5d54f5344 | ||
|
|
a558c01589 | ||
|
|
7043983acc | ||
|
|
dd245c63d7 | ||
|
|
84d8760561 | ||
|
|
e1225cec5f | ||
|
|
5db6bb02d6 | ||
|
|
679d3fd5b3 | ||
|
|
c622985fda | ||
|
|
d910786034 | ||
|
|
8dbf572ea5 | ||
|
|
f8af1a7443 | ||
|
|
d95bcab053 | ||
|
|
2b4c10e705 | ||
|
|
ac4c802089 | ||
|
|
c6e4b8f829 | ||
|
|
52d41d19d3 | ||
|
|
0e7df4b193 | ||
|
|
2c9b3b35d1 | ||
|
|
773dcae2f9 | ||
|
|
22e7b674ed | ||
|
|
8c95422204 | ||
|
|
34531a8160 | ||
|
|
5c199483cd | ||
|
|
c52189557e | ||
|
|
bcabe63971 | ||
|
|
193ccaa3b4 | ||
|
|
c6605766e7 | ||
|
|
4fca628d36 | ||
|
|
7f81c62bf0 | ||
|
|
fc7da615fb | ||
|
|
86766f4e20 | ||
|
|
8cb0b7d043 | ||
|
|
b6cdeeef8e | ||
|
|
ac2175fa7d | ||
|
|
5816bab6a2 | ||
|
|
d0d650aa67 | ||
|
|
6d5ec9c998 | ||
|
|
fe08467e45 | ||
|
|
26e03b81fe | ||
|
|
f6582fd229 | ||
|
|
5e87126c38 | ||
|
|
c279692cfe | ||
|
|
7d0dab9d7d | ||
|
|
16555ad12e | ||
|
|
9a95c2ff08 | ||
|
|
1d6347c9b0 | ||
|
|
13075460ea | ||
|
|
4c3dfb92b7 | ||
|
|
fc2efaeb8c | ||
|
|
b15e60243b | ||
|
|
f2de3215c3 | ||
|
|
efbad07643 | ||
|
|
69d61eda01 | ||
|
|
e9255d3714 | ||
|
|
c8647c0396 | ||
|
|
8114627d6a | ||
|
|
5048a30fc7 | ||
|
|
ce6fb83ef4 | ||
|
|
85f8a59d7f | ||
|
|
dd8729063c | ||
|
|
14c766e750 | ||
|
|
3a11a8a01d | ||
|
|
988815579a | ||
|
|
d1fa13ed52 | ||
|
|
08b497faea | ||
|
|
96d332e234 | ||
|
|
440f31a4d3 | ||
|
|
cb91705e03 | ||
|
|
d12e742373 | ||
|
|
7aa7c0f481 | ||
|
|
b3ffa16315 | ||
|
|
09d1f55bce | ||
|
|
21333d0f18 | ||
|
|
edcc859b58 | ||
|
|
2ce17a724a | ||
|
|
0fb07ba328 | ||
|
|
78f0307246 | ||
|
|
c5203ab5ea | ||
|
|
3d1a306518 | ||
|
|
2750d61e92 | ||
|
|
43ac5ad70d | ||
|
|
309e936ad9 | ||
|
|
d00fa906cf | ||
|
|
01839b9c14 | ||
|
|
1f396946e5 | ||
|
|
2f58ef781c | ||
|
|
8b9f70ac08 | ||
|
|
e039d4103f | ||
|
|
0333e81616 | ||
|
|
cf1be4ae2d | ||
|
|
dc34636598 | ||
|
|
c74d881d3d | ||
|
|
ab51f3bec0 | ||
|
|
b4c4fae3f5 | ||
|
|
ce98df59f1 | ||
|
|
f29bdd21a7 | ||
|
|
9d31401d47 | ||
|
|
5c68bbe16f | ||
|
|
07c610e068 | ||
|
|
998f109fc8 | ||
|
|
cfb70bccc1 | ||
|
|
7524f9006e | ||
|
|
bcfe3dacc6 | ||
|
|
6c56151d27 | ||
|
|
98274d2145 | ||
|
|
1d125f55ba | ||
|
|
918470affc | ||
|
|
797f26e45b | ||
|
|
e145c1d31c | ||
|
|
bb5d0c5c4a | ||
|
|
0aea1b608a | ||
|
|
a2aa43a426 | ||
|
|
8d5514603e | ||
|
|
b9a2feff5e | ||
|
|
f13615d97a | ||
|
|
d6227aece6 | ||
|
|
6058389974 | ||
|
|
dccad08508 | ||
|
|
112158b056 | ||
|
|
5be300736e | ||
|
|
1b98a64e90 | ||
|
|
4849eb4c54 | ||
|
|
5e8ee7e006 | ||
|
|
e27d34d118 | ||
|
|
a0bf8d5740 | ||
|
|
17a5ba08e4 | ||
|
|
d0877153bf | ||
|
|
55011e5308 | ||
|
|
2697b3c7da | ||
|
|
b9c17dd1f0 | ||
|
|
aea17bfae2 | ||
|
|
0a5755145c | ||
|
|
249e19769b | ||
|
|
f64808c385 | ||
|
|
2e69b54a4f | ||
|
|
cd5d1ceadf | ||
|
|
c55f6b40ec | ||
|
|
bf4ec9be22 | ||
|
|
ed0626afeb | ||
|
|
b5305d5a8c | ||
|
|
17efa04ea6 | ||
|
|
b3f5c8f6b2 | ||
|
|
4507083148 | ||
|
|
f4c0018d7a | ||
|
|
c9e1d6cca8 | ||
|
|
242dc34115 | ||
|
|
41c785d77a | ||
|
|
a745528b40 | ||
|
|
7465be91d0 | ||
|
|
d79c5baa1b | ||
|
|
46af0d38fa | ||
|
|
6323e09a0a | ||
|
|
d94bdb75c8 | ||
|
|
cc3b4dff20 | ||
|
|
78ac382fdf | ||
|
|
860072aaaf | ||
|
|
2694a409c6 | ||
|
|
206b1f4631 | ||
|
|
ef9891e8ff | ||
|
|
bd69890ccd | ||
|
|
fc280c7cd6 | ||
|
|
435ac2a650 | ||
|
|
fb0ad2f9ea |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These files are text and should be normalized
|
||||
*.txt text
|
||||
*.c text
|
||||
*.h text
|
||||
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/src/apps/snmp/LwipMibCompiler/CCodeGeneration/bin/
|
||||
/src/apps/snmp/LwipMibCompiler/CCodeGeneration/obj/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler/bin/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler/obj/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipMibViewer/bin/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipMibViewer/obj/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/bin/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/obj/
|
||||
/src/apps/snmp/LwipMibCompiler/SharpSnmpLib/bin/
|
||||
/src/apps/snmp/LwipMibCompiler/SharpSnmpLib/obj/
|
||||
/src/apps/snmp/LwipMibCompiler/LwipMibCompiler.userprefs
|
||||
/src/apps/snmp/LwipMibCompiler/*.suo
|
||||
21
README
21
README
@@ -40,22 +40,19 @@ and additions to the stack to further increase its usefulness.
|
||||
|
||||
Development of lwIP is hosted on Savannah, a central point for
|
||||
software development, maintenance and distribution. Everyone can
|
||||
help improve lwIP by use of Savannah's interface, CVS and the
|
||||
help improve lwIP by use of Savannah's interface, Git and the
|
||||
mailing list. A core team of developers will commit changes to the
|
||||
CVS source tree.
|
||||
Git source tree.
|
||||
|
||||
The lwIP TCP/IP stack is maintained in the 'lwip' CVS module and
|
||||
contributions (such as platform ports) are in the 'contrib' module.
|
||||
The lwIP TCP/IP stack is maintained in the 'lwip' Git module and
|
||||
contributions (such as platform ports) are in the 'contrib' Git module.
|
||||
|
||||
See doc/savannah.txt for details on CVS server access for users and
|
||||
See doc/savannah.txt for details on Git server access for users and
|
||||
developers.
|
||||
|
||||
Last night's CVS tar ball can be downloaded from:
|
||||
http://savannah.gnu.org/cvs.backups/lwip.tar.gz [CHANGED - NEEDS FIXING]
|
||||
|
||||
The current CVS trees are web-browsable:
|
||||
http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/lwip/
|
||||
http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/contrib/
|
||||
The current Git trees are web-browsable:
|
||||
http://git.savannah.gnu.org/cgit/lwip.git
|
||||
http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git
|
||||
|
||||
Submit patches and bugs via the lwIP project page:
|
||||
http://savannah.nongnu.org/projects/lwip/
|
||||
@@ -68,7 +65,7 @@ lwIP are at the official lwIP home page:
|
||||
http://www.sics.se/~adam/lwip/
|
||||
|
||||
Self documentation of the source code is regularly extracted from the
|
||||
current CVS sources and is available from this web page:
|
||||
current Git sources and is available from this web page:
|
||||
http://www.nongnu.org/lwip/
|
||||
|
||||
There is now a constantly growin wiki about lwIP at
|
||||
|
||||
@@ -4,10 +4,14 @@ application written for an older version of lwIP to correctly work
|
||||
with newer versions.
|
||||
|
||||
|
||||
(CVS HEAD)
|
||||
(git master)
|
||||
|
||||
* [Enter new changes just after this line - do not remove this line]
|
||||
|
||||
* TODO
|
||||
|
||||
(1.4.0)
|
||||
|
||||
++ Application changes:
|
||||
|
||||
* Replaced struct ip_addr by typedef ip_addr_t (struct ip_addr is kept for
|
||||
|
||||
@@ -34,7 +34,7 @@ features of Savannah help us not lose users' input.
|
||||
2.3 Bug reports and patches:
|
||||
|
||||
1. Make sure you are reporting bugs or send patches against the latest
|
||||
sources. (From the latest release and/or the current CVS sources.)
|
||||
sources. (From the latest release and/or the current Git sources.)
|
||||
2. If you think you found a bug make sure it's not already filed in the
|
||||
bugtracker at Savannah.
|
||||
3. If you have a fix put the patch on Savannah. If it is a patch that affects
|
||||
@@ -46,18 +46,13 @@ features of Savannah help us not lose users' input.
|
||||
4. Do not file a bug and post a fix to it to the patch area. Either a bug report
|
||||
or a patch will be enough.
|
||||
If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area.
|
||||
5. Trivial patches (compiler warning, indentation and spelling fixes or anything obvious which takes a line or two)
|
||||
can go to the lwip-users list. This is still the fastest way of interaction and the list is not so crowded
|
||||
as to allow for loss of fixes. Putting bugs on Savannah and subsequently closing them is too much an overhead
|
||||
for reporting a compiler warning fix.
|
||||
6. Patches should be specific to a single change or to related changes.Do not mix bugfixes with spelling and other
|
||||
trivial fixes unless the bugfix is trivial too.Do not reorganize code and rename identifiers in the same patch you
|
||||
change behaviour if not necessary.A patch is easier to read and understand if it's to the point and short than
|
||||
5. Patches should be specific to a single change or to related changes. Do not mix bugfixes with spelling and other
|
||||
trivial fixes unless the bugfix is trivial too. Do not reorganize code and rename identifiers in the same patch you
|
||||
change behaviour if not necessary. A patch is easier to read and understand if it's to the point and short than
|
||||
if it's not to the point and long :) so the chances for it to be applied are greater.
|
||||
|
||||
2.4 Platform porters:
|
||||
|
||||
1. If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and
|
||||
you think it could benefit others[1] you might want discuss this on the mailing list. You
|
||||
can also ask for CVS access to submit and maintain your port in the contrib CVS module.
|
||||
|
||||
can also ask for Git access to submit and maintain your port in the contrib Git module.
|
||||
|
||||
292
doc/doxygen/lwip.Doxyfile
Normal file
292
doc/doxygen/lwip.Doxyfile
Normal file
@@ -0,0 +1,292 @@
|
||||
# Doxyfile 1.5.4
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "lwIP 1.3.0"
|
||||
PROJECT_NUMBER = "lwIP 1.3.0"
|
||||
OUTPUT_DIRECTORY = C:/OPENSOURCE/LwIP/doxygen
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class " \
|
||||
"The $name widget " \
|
||||
"The $name file " \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = C:\OPENSOURCE\lwip
|
||||
STRIP_FROM_INC_PATH = C:\OPENSOURCE\lwip
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
SIP_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text "
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = C:\OPENSOURCE\lwip\lwip
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.idl \
|
||||
*.odl \
|
||||
*.cs \
|
||||
*.php \
|
||||
*.php3 \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.mm \
|
||||
*.dox
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = C:/OPENSOURCE/lwIP/doxygen/output/html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
CHM_FILE = lwip.chm
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = YES
|
||||
RTF_OUTPUT = C:/OPENSOURCE/lwIP/doxygen/output/rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = NO
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH = C:\OPENSOURCE\lwip\lwip
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = NO_SYS=0 \
|
||||
SYS_LIGHTWEIGHT_PROT=1 \
|
||||
LWIP_ICMP=1 \
|
||||
LWIP_RAW=1 \
|
||||
LWIP_DHCP=1 \
|
||||
LWIP_UDPLITE=1 \
|
||||
LWIP_UDP=1 \
|
||||
LWIP_IGMP=1 \
|
||||
LWIP_TCP=1 \
|
||||
LWIP_SNMP=1 \
|
||||
MEMP_OVERFLOW_CHECK=1 \
|
||||
MEMP_SANITY_CHECK=1 \
|
||||
LWIP_ARP=1 \
|
||||
LWIP_NETIF_HOSTNAME=1 \
|
||||
LWIP_NETIF_API=1 \
|
||||
LWIP_NETIF_CALLBACK=1 \
|
||||
LWIP_NETIF_LINK_CALLBACK=1 \
|
||||
LWIP_AUTOIP=1 \
|
||||
ARP_QUEUEING=1 \
|
||||
LWIP_STATS=1 \
|
||||
MEM_USE_POOLS=0 \
|
||||
LWIP_DNS=1 \
|
||||
LWIP_SOCKETS=1 \
|
||||
LWIP_NETCONN=1 \
|
||||
"LWIP_DNS && LWIP_SOCKET " \
|
||||
"(LWIP_DNS && LWIP_SOCKET)=1 "
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
47
doc/doxygen/main_page.h
Normal file
47
doc/doxygen/main_page.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*! \mainpage lwIP Documentation
|
||||
*
|
||||
* \section intro_sec Introduction
|
||||
*
|
||||
* lwIP is a small independent implementation of the TCP/IP protocol suite that has been developed by Adam Dunkels at the Computer and Networks Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS).
|
||||
*
|
||||
* The focus of the lwIP TCP/IP implementation is to reduce resource usage while still having a full scale TCP. This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM.
|
||||
*
|
||||
* \section lwip_features_sec lwIP features:
|
||||
*
|
||||
* \li \c IP (Internet Protocol) including packet forwarding over multiple network interfaces\n
|
||||
* \li \c ICMP (Internet Control Message Protocol) for network maintenance and debugging\n
|
||||
* \li \c IGMP (Internet Group Management Protocol) for multicast traffic management\n
|
||||
* \li \c UDP (User Datagram Protocol) including experimental UDP-lite extensions\n
|
||||
* \li \c TCP (Transmission Control Protocol) with congestion control, RTT estimation and fast recovery/fast retransmit\n
|
||||
* \li \c raw/native API for enhanced performance\n
|
||||
* \li \c Optional Berkeley-like socket API\n
|
||||
* \li \c DNS (Domain names resolver)\n
|
||||
* \li \c SNMP (Simple Network Management Protocol)\n
|
||||
* \li \c DHCP (Dynamic Host Configuration Protocol)\n
|
||||
* \li \c AUTOIP (for IPv4, conform with RFC 3927)\n
|
||||
* \li \c PPP (Point-to-Point Protocol)\n
|
||||
* \li \c ARP (Address Resolution Protocol) for Ethernet\n
|
||||
*
|
||||
* \section install_sec Documentation
|
||||
*
|
||||
* Development of lwIP is hosted on Savannah, a central point for software development, maintenance and distribution. Everyone can help improve lwIP by use of Savannah's interface, Git and the mailing list. A core team of developers will commit changes to the Git source tree.\n
|
||||
* http://savannah.nongnu.org/projects/lwip/\n
|
||||
* \n
|
||||
* The original out-dated homepage of lwIP and Adam Dunkels' papers on lwIP are at the official lwIP home page:\n
|
||||
* http://www.sics.se/~adam/lwip/\n
|
||||
* \n
|
||||
* Self documentation of the source code is regularly extracted from the current Git sources and is available from this web page:\n
|
||||
* http://www.nongnu.org/lwip/\n
|
||||
* \n
|
||||
* There is now a constantly growin wiki about lwIP at\n
|
||||
* http://lwip.wikia.com/\n
|
||||
* \n
|
||||
* Also, there are mailing lists you can subscribe at\n
|
||||
* http://savannah.nongnu.org/mail/?group=lwip\n
|
||||
* plus searchable archives:\n
|
||||
* http://lists.nongnu.org/archive/html/lwip-users/\n
|
||||
* http://lists.nongnu.org/archive/html/lwip-devel/\n
|
||||
* \n
|
||||
* Reading Adam's papers, the files in docs/, browsing the source code documentation and browsing the mailing list archives is a good way to become familiar with the design of lwIP.\n
|
||||
*
|
||||
*/
|
||||
423
doc/ppp.txt
Normal file
423
doc/ppp.txt
Normal file
@@ -0,0 +1,423 @@
|
||||
PPP interface for lwIP
|
||||
|
||||
Author: Sylvain Rochet
|
||||
|
||||
Table of Contents:
|
||||
|
||||
1 - Supported PPP protocols and features
|
||||
2 - Raw API PPP example for all protocols
|
||||
3 - PPPoS input path (raw API, IRQ safe API, TCPIP API)
|
||||
4 - Thread safe PPP API (PPPAPI)
|
||||
5 - Upgrading from lwIP <= 1.4.x to lwIP >= 1.5.x
|
||||
|
||||
|
||||
|
||||
1 Supported PPP protocols and features
|
||||
======================================
|
||||
|
||||
Supported Low level protocols:
|
||||
* PPP over serial using HDLC-like framing, such as wired dialup modems
|
||||
or mobile telecommunications GPRS/EDGE/UMTS/HSPA+/LTE modems
|
||||
* PPP over Ethernet, such as xDSL modems
|
||||
* PPP over L2TP (Layer 2 Tunneling Protocol) LAC (L2TP Access Concentrator),
|
||||
IP tunnel over UDP, such as VPN access
|
||||
|
||||
Supported auth protocols:
|
||||
* PAP, Password Authentication Protocol
|
||||
* CHAP, Challenge-Handshake Authentication Protocol, also known as CHAP-MD5
|
||||
* MSCHAPv1, Microsoft version of CHAP, version 1
|
||||
* MSCHAPv2, Microsoft version of CHAP, version 2
|
||||
* EAP, Extensible Authentication Protocol
|
||||
|
||||
Supported address protocols:
|
||||
* IPCP, IP Control Protocol, IPv4 addresses negotiation
|
||||
* IP6CP, IPv6 Control Protocol, IPv6 link-local addresses negotiation
|
||||
|
||||
Supported encryption protocols:
|
||||
* MPPE, Microsoft Point-to-Point Encryption
|
||||
|
||||
Supported compression or miscellaneous protocols, for serial links only:
|
||||
* PFC, Protocol Field Compression
|
||||
* ACFC, Address-and-Control-Field-Compression
|
||||
* ACCM, Asynchronous-Control-Character-Map
|
||||
* VJ, Van Jacobson TCP/IP Header Compression
|
||||
|
||||
|
||||
|
||||
2 Raw API PPP example for all protocols
|
||||
=======================================
|
||||
|
||||
As usual, raw API for lwIP means the lightweight API which *MUST* only be used
|
||||
for NO_SYS=1 systems or called inside lwIP core thread for NO_SYS=0 systems.
|
||||
|
||||
/*
|
||||
* Globals
|
||||
* =======
|
||||
*/
|
||||
|
||||
/* The PPP control block */
|
||||
ppp_pcb *ppp;
|
||||
|
||||
/* The PPP IP interface */
|
||||
struct netif ppp_netif;
|
||||
|
||||
|
||||
/*
|
||||
* PPP status callback
|
||||
* ===================
|
||||
*
|
||||
* PPP status callback is called on PPP status change (up, down, …) from lwIP
|
||||
* core thread
|
||||
*/
|
||||
|
||||
/* PPP status callback example */
|
||||
static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) {
|
||||
struct netif *pppif = ppp_netif(pcb);
|
||||
LWIP_UNUSED_ARG(ctx);
|
||||
|
||||
switch(err_code) {
|
||||
case PPPERR_NONE: {
|
||||
#if LWIP_DNS
|
||||
ip_addr_t ns;
|
||||
#endif /* LWIP_DNS */
|
||||
printf("status_cb: Connected\n");
|
||||
#if PPP_IPV4_SUPPORT
|
||||
printf(" our_ipaddr = %s\n", ipaddr_ntoa(&pppif->ip_addr));
|
||||
printf(" his_ipaddr = %s\n", ipaddr_ntoa(&pppif->gw));
|
||||
printf(" netmask = %s\n", ipaddr_ntoa(&pppif->netmask));
|
||||
#if LWIP_DNS
|
||||
ns = dns_getserver(0);
|
||||
printf(" dns1 = %s\n", ipaddr_ntoa(&ns));
|
||||
ns = dns_getserver(1);
|
||||
printf(" dns2 = %s\n", ipaddr_ntoa(&ns));
|
||||
#endif /* LWIP_DNS */
|
||||
#endif /* PPP_IPV4_SUPPORT */
|
||||
#if PPP_IPV6_SUPPORT
|
||||
printf(" our6_ipaddr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0)));
|
||||
#endif /* PPP_IPV6_SUPPORT */
|
||||
break;
|
||||
}
|
||||
case PPPERR_PARAM: {
|
||||
printf("status_cb: Invalid parameter\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_OPEN: {
|
||||
printf("status_cb: Unable to open PPP session\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_DEVICE: {
|
||||
printf("status_cb: Invalid I/O device for PPP\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_ALLOC: {
|
||||
printf("status_cb: Unable to allocate resources\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_USER: {
|
||||
printf("status_cb: User interrupt\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_CONNECT: {
|
||||
printf("status_cb: Connection lost\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_AUTHFAIL: {
|
||||
printf("status_cb: Failed authentication challenge\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_PROTOCOL: {
|
||||
printf("status_cb: Failed to meet protocol\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_PEERDEAD: {
|
||||
printf("status_cb: Connection timeout\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_IDLETIMEOUT: {
|
||||
printf("status_cb: Idle Timeout\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_CONNECTTIME: {
|
||||
printf("status_cb: Max connect time reached\n");
|
||||
break;
|
||||
}
|
||||
case PPPERR_LOOPBACK: {
|
||||
printf("status_cb: Loopback detected\n");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
printf("status_cb: Unknown error code %d\n", err_code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This should be in the switch case, this is put outside of the switch
|
||||
* case for example readability.
|
||||
*/
|
||||
|
||||
if (err_code == PPPERR_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* ppp_close() was previously called, don't reconnect */
|
||||
if (err_code == PPPERR_USER) {
|
||||
/* ppp_free(); -- can be called here */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to reconnect in 30 seconds, if you need a modem chatscript you have
|
||||
* to do a much better signaling here ;-)
|
||||
*/
|
||||
ppp_connect(pcb, 30);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creating a new PPPoS session
|
||||
* ============================
|
||||
*
|
||||
* In lwIP, PPPoS is not PPPoSONET, in lwIP PPPoS is PPPoSerial.
|
||||
*/
|
||||
|
||||
#include "netif/ppp/pppos.h"
|
||||
|
||||
/*
|
||||
* PPPoS serial output callback
|
||||
*
|
||||
* ppp_pcb, PPP control block
|
||||
* data, buffer to write to serial port
|
||||
* len, length of the data buffer
|
||||
* ctx, optional user-provided callback context pointer
|
||||
*
|
||||
* Return value: len if write succeed
|
||||
*/
|
||||
static u32_t output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
|
||||
return uart_write(UART, data, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new PPPoS interface
|
||||
*
|
||||
* ppp_netif, netif to use for this PPP link, i.e. PPP IP interface
|
||||
* output_cb, PPPoS serial output callback
|
||||
* status_cb, PPP status callback, called on PPP status change (up, down, …)
|
||||
* ctx_cb, optional user-provided callback context pointer
|
||||
*/
|
||||
ppp = pppos_create(&ppp_netif,
|
||||
output_cb, status_cb, ctx_cb);
|
||||
|
||||
|
||||
/*
|
||||
* Creating a new PPPoE session
|
||||
* ============================
|
||||
*/
|
||||
|
||||
#include "netif/ppp/pppoe.h"
|
||||
|
||||
/*
|
||||
* Create a new PPPoE interface
|
||||
*
|
||||
* ppp_netif, netif to use for this PPP link, i.e. PPP IP interface
|
||||
* ethif, already existing and setup Ethernet interface to use
|
||||
* service_name, PPPoE service name discriminator (not supported yet)
|
||||
* concentrator_name, PPPoE concentrator name discriminator (not supported yet)
|
||||
* status_cb, PPP status callback, called on PPP status change (up, down, …)
|
||||
* ctx_cb, optional user-provided callback context pointer
|
||||
*/
|
||||
ppp = pppoe_create(&ppp_netif,
|
||||
ðif,
|
||||
service_name, concentrator_name,
|
||||
status_cb, ctx_cb);
|
||||
|
||||
|
||||
/*
|
||||
* Creating a new PPPoL2TP session
|
||||
* ===============================
|
||||
*/
|
||||
|
||||
#include "netif/ppp/pppol2tp.h"
|
||||
|
||||
/*
|
||||
* Create a new PPPoL2TP interface
|
||||
*
|
||||
* ppp_netif, netif to use for this PPP link, i.e. PPP IP interface
|
||||
* netif, optional already existing and setup output netif, necessary if you
|
||||
* want to set this interface as default route to settle the chicken
|
||||
* and egg problem with VPN links
|
||||
* ipaddr, IP to connect to
|
||||
* port, UDP port to connect to (usually 1701)
|
||||
* secret, L2TP secret to use
|
||||
* secret_len, size in bytes of the L2TP secret
|
||||
* status_cb, PPP status callback, called on PPP status change (up, down, …)
|
||||
* ctx_cb, optional user-provided callback context pointer
|
||||
*/
|
||||
ppp = pppol2tp_create(&ppp_netif,
|
||||
struct netif *netif, ip_addr_t *ipaddr, u16_t port,
|
||||
u8_t *secret, u8_t secret_len,
|
||||
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
|
||||
|
||||
/*
|
||||
* PPP link configuration
|
||||
* ======================
|
||||
*/
|
||||
|
||||
/* Auth configuration, this is pretty self-explanatory */
|
||||
ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password");
|
||||
|
||||
/* Set this interface as default route */
|
||||
ppp_set_default(ppp);
|
||||
|
||||
|
||||
/*
|
||||
* Initiate PPP connection
|
||||
* =======================
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initiate PPP negotiation, without waiting (holdoff=0), can only be called
|
||||
* if PPP session is in the dead state (i.e. disconnected).
|
||||
*/
|
||||
u16_t holdoff = 0;
|
||||
ppp_connect(ppp, holdoff);
|
||||
|
||||
|
||||
/*
|
||||
* Closing PPP connection
|
||||
* ======================
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initiate the end of the PPP session, without carrier lost signal
|
||||
* (nocarrier=0), meaning a clean shutdown of PPP protocols.
|
||||
* You can call this function at anytime.
|
||||
*/
|
||||
u8_t nocarrier = 0;
|
||||
ppp_close(ppp, nocarrier);
|
||||
/*
|
||||
* Then you must wait your status_cb() to be called, it may takes from a few
|
||||
* seconds to several tens of seconds depending on the current PPP state.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Freeing a PPP connection
|
||||
* ========================
|
||||
*/
|
||||
|
||||
/*
|
||||
* Free the PPP control block, can only be called if PPP session is in the
|
||||
* dead state (i.e. disconnected). You need to call ppp_close() before.
|
||||
*/
|
||||
ppp_free(ppp);
|
||||
|
||||
|
||||
|
||||
3 PPPoS input path (raw API, IRQ safe API, TCPIP API)
|
||||
=====================================================
|
||||
|
||||
Received data on serial port should be sent to lwIP using the pppos_input()
|
||||
function or the pppos_input_tcpip() function.
|
||||
|
||||
If NO_SYS is 1 and if PPP_INPROC_IRQ_SAFE is 0 (the default), pppos_input()
|
||||
is not IRQ safe and then *MUST* only be called inside your main loop.
|
||||
|
||||
Whatever the NO_SYS value, if PPP_INPROC_IRQ_SAFE is 1, pppos_input() is IRQ
|
||||
safe and can be safely called from an interrupt context, using that is going
|
||||
to reduce your need of buffer if pppos_input() is called byte after byte in
|
||||
your rx serial interrupt.
|
||||
|
||||
if NO_SYS is 0, the thread safe way outside an interrupt context is to use
|
||||
the pppos_input_tcpip() function to pass input data to the lwIP core thread
|
||||
using the TCPIP API. This is thread safe in all cases but you should avoid
|
||||
passing data byte after byte because it uses heavy locking (mailbox) and it
|
||||
allocates pbuf, better fill them !
|
||||
|
||||
if NO_SYS is 0 and if PPP_INPROC_IRQ_SAFE is 1, you may also use pppos_input()
|
||||
from an RX thread, however pppos_input() is not thread safe by itself. You can
|
||||
do that *BUT* you should NEVER call pppos_connect(), pppos_listen() and
|
||||
ppp_free() if pppos_input() can still be running, doing this is NOT thread safe
|
||||
at all. Using PPP_INPROC_IRQ_SAFE from an RX thread is discouraged unless you
|
||||
really know what you are doing, your move ;-)
|
||||
|
||||
|
||||
/*
|
||||
* Fonction to call for received data
|
||||
*
|
||||
* ppp, PPP control block
|
||||
* buffer, input buffer
|
||||
* buffer_len, buffer length in bytes
|
||||
*/
|
||||
void pppos_input(ppp, buffer, buffer_len);
|
||||
|
||||
or
|
||||
|
||||
void pppos_input_tcpip(ppp, buffer, buffer_len);
|
||||
|
||||
|
||||
4 Thread safe PPP API (PPPAPI)
|
||||
==============================
|
||||
|
||||
There is a thread safe API for all corresponding ppp_* functions, you have to
|
||||
enable LWIP_PPP_API in your lwipopts.h file, then see include/lwip/pppapi.h,
|
||||
this is actually pretty obvious.
|
||||
|
||||
|
||||
|
||||
5 Upgrading from lwIP <= 1.4.x to lwIP >= 1.5.x
|
||||
===============================================
|
||||
|
||||
PPP API was fully reworked between 1.4.x and 1.5.x releases. However porting
|
||||
from previous lwIP version is pretty easy:
|
||||
|
||||
* Previous PPP API used an integer to identify PPP sessions, we are now
|
||||
using ppp_pcb* control block, therefore all functions changed from "int ppp"
|
||||
to "ppp_pcb *ppp"
|
||||
|
||||
* struct netif was moved outside the PPP structure, you have to provide a netif
|
||||
for PPP interface in pppoX_create() functions
|
||||
|
||||
* PPP session are not started automatically after you created them anymore,
|
||||
you have to call ppp_connect(), this way you can configure the session before
|
||||
starting it.
|
||||
|
||||
* Previous PPP API used CamelCase, we are now using snake_case.
|
||||
|
||||
* Previous PPP API mixed PPPoS and PPPoE calls, this isn't the case anymore,
|
||||
PPPoS functions are now prefixed pppos_ and PPPoE functions are now prefixed
|
||||
pppoe_, common functions are now prefixed ppp_.
|
||||
|
||||
* New PPPERR_ error codes added, check you have all of them in your status
|
||||
callback function
|
||||
|
||||
* Only the following include files should now be used in user application:
|
||||
#include "lwip/pppapi.h"
|
||||
#include "netif/ppp/pppos.h"
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "netif/ppp/pppol2tp.h"
|
||||
|
||||
Functions from ppp.h can be used, but you don't need to include this header
|
||||
file as it is already included by above header files.
|
||||
|
||||
* PPP_INPROC_OWNTHREAD was broken by design and was removed, you have to create
|
||||
your own serial rx thread
|
||||
|
||||
* PPP_INPROC_MULTITHREADED option was misnamed and confusing and was renamed
|
||||
PPP_INPROC_IRQ_SAFE, please read the "PPPoS input path" documentation above
|
||||
because you might have been fooled by that
|
||||
|
||||
* If you used tcpip_callback_with_block() on ppp_ functions you may wish to use
|
||||
the PPPAPI API instead.
|
||||
|
||||
* ppp_sighup and ppp_close functions were merged using an optional argument
|
||||
"nocarrier" on ppp_close.
|
||||
|
||||
* DNS servers are now only remotely asked if LWIP_DNS is set and we are now
|
||||
unconditionally registering them, which is probably the wanted behavior in
|
||||
almost all cases. If you need it conditional contact us and we will made it
|
||||
conditional.
|
||||
|
||||
* PPPoS now requires a serial output callback
|
||||
|
||||
* PPP_MAXIDLEFLAG is now in ms instead of jiffies
|
||||
141
doc/rawapi.txt
141
doc/rawapi.txt
@@ -8,6 +8,12 @@ to use for communication with the TCP/IP code:
|
||||
* higher-level "sequential" API.
|
||||
* BSD-style socket API.
|
||||
|
||||
The raw API (sometimes called native API) is an event-driven API designed
|
||||
to be used without an operating system that implements zero-copy send and
|
||||
receive. This API is also used by the core stack for interaction between
|
||||
the various protocols. It is the only API available when running lwIP
|
||||
without an operating system.
|
||||
|
||||
The sequential API provides a way for ordinary, sequential, programs
|
||||
to use the lwIP stack. It is quite similar to the BSD socket API. The
|
||||
model of execution is based on the blocking open-read-write-close
|
||||
@@ -22,14 +28,17 @@ on other platforms (e.g. unix / windows etc.). However, due to limitations
|
||||
in the specification of this API, there might be incompatibilities
|
||||
that require small modifications of existing programs.
|
||||
|
||||
** Threading
|
||||
** Multithreading
|
||||
|
||||
lwIP started targeting single-threaded environments. When adding multi-
|
||||
threading support, instead of making the core thread-safe, another
|
||||
approach was chosen: there is one main thread running the lwIP core
|
||||
(also known as the "tcpip_thread"). The raw API may only be used from
|
||||
this thread! Application threads using the sequential- or socket API
|
||||
communicate with this main thread through message passing.
|
||||
(also known as the "tcpip_thread"). When running in a multithreaded
|
||||
environment, raw API functions MUST only be called from the core thread
|
||||
since raw API functions are not protected from concurrent access (aside
|
||||
from pbuf- and memory management functions). Application threads using
|
||||
the sequential- or socket API communicate with this main thread through
|
||||
message passing.
|
||||
|
||||
As such, the list of functions that may be called from
|
||||
other threads or an ISR is very limited! Only functions
|
||||
@@ -38,6 +47,7 @@ communicate with this main thread through message passing.
|
||||
- netbuf.h
|
||||
- netdb.h
|
||||
- netifapi.h
|
||||
- pppapi.h
|
||||
- sockets.h
|
||||
- sys.h
|
||||
|
||||
@@ -46,13 +56,18 @@ communicate with this main thread through message passing.
|
||||
since they are protected by SYS_LIGHTWEIGHT_PROT and/or
|
||||
semaphores.
|
||||
|
||||
Only since 1.3.0, if SYS_LIGHTWEIGHT_PROT is set to 1
|
||||
and LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is set to 1,
|
||||
Netconn or Socket API functions are thread safe against the
|
||||
core thread but they are not reentrant at the control block
|
||||
granularity level. That is, a UDP or TCP control block must
|
||||
not be shared among multiple threads without proper locking.
|
||||
|
||||
If SYS_LIGHTWEIGHT_PROT is set to 1 and
|
||||
LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is set to 1,
|
||||
pbuf_free() may also be called from another thread or
|
||||
an ISR (since only then, mem_free - for PBUF_RAM - may
|
||||
be called from an ISR: otherwise, the HEAP is only
|
||||
protected by semaphores).
|
||||
|
||||
|
||||
|
||||
** The remainder of this document discusses the "raw" API. **
|
||||
|
||||
@@ -71,13 +86,28 @@ the raw TCP/IP interface are more difficult to understand. Still, this
|
||||
is the preferred way of writing applications that should be small in
|
||||
code size and memory usage.
|
||||
|
||||
Both APIs can be used simultaneously by different application
|
||||
All APIs can be used simultaneously by different application
|
||||
programs. In fact, the sequential API is implemented as an application
|
||||
program using the raw TCP/IP interface.
|
||||
|
||||
Do not confuse the lwIP raw API with raw Ethernet or IP sockets.
|
||||
The former is a way of interfacing the lwIP network stack (including
|
||||
TCP and UDP), the later refers to processing raw Ethernet or IP data
|
||||
instead of TCP connections or UDP packets.
|
||||
|
||||
Raw API applications may never block since all packet processing
|
||||
(input and output) as well as timer processing (TCP mainly) is done
|
||||
in a single execution context.
|
||||
|
||||
--- Callbacks
|
||||
|
||||
Program execution is driven by callbacks. Each callback is an ordinary
|
||||
Program execution is driven by callbacks functions, which are then
|
||||
invoked by the lwIP core when activity related to that application
|
||||
occurs. A particular application may register to be notified via a
|
||||
callback function for events such as incoming data available, outgoing
|
||||
data sent, error notifications, poll timer expiration, connection
|
||||
closed, etc. An application can provide a callback function to perform
|
||||
processing for any or all of these events. Each callback is an ordinary
|
||||
C function that is called from within the TCP/IP code. Every callback
|
||||
function is passed the current TCP or UDP connection state as an
|
||||
argument. Also, in order to be able to keep program specific state,
|
||||
@@ -196,7 +226,7 @@ callback function.
|
||||
should be allocated and the data should only be referenced by pointer. This
|
||||
also means that the memory behind dataptr must not change until the data is
|
||||
ACKed by the remote host
|
||||
- TCP_WRITE_FLAG_MORE: indicates that more data follows. If this is given,
|
||||
- TCP_WRITE_FLAG_MORE: indicates that more data follows. If this is omitted,
|
||||
the PSH flag is set in the last segment created by this call to tcp_write.
|
||||
If this flag is given, the PSH flag is not set.
|
||||
|
||||
@@ -302,17 +332,6 @@ function to be called is set using the tcp_err() function.
|
||||
parameter since the pcb may already have been deallocated.
|
||||
|
||||
|
||||
--- Lower layer TCP interface
|
||||
|
||||
TCP provides a simple interface to the lower layers of the
|
||||
system. During system initialization, the function tcp_init() has
|
||||
to be called before any other TCP function is called. When the system
|
||||
is running, the two timer functions tcp_fasttmr() and tcp_slowtmr()
|
||||
must be called with regular intervals. The tcp_fasttmr() should be
|
||||
called every TCP_FAST_INTERVAL milliseconds (defined in tcp.h) and
|
||||
tcp_slowtmr() should be called every TCP_SLOW_INTERVAL milliseconds.
|
||||
|
||||
|
||||
--- UDP interface
|
||||
|
||||
The UDP interface is similar to that of TCP, but due to the lower
|
||||
@@ -363,9 +382,9 @@ level of complexity of UDP, the interface is significantly simpler.
|
||||
|
||||
--- System initalization
|
||||
|
||||
A truly complete and generic sequence for initializing the lwip stack
|
||||
cannot be given because it depends on the build configuration (lwipopts.h)
|
||||
and additional initializations for your runtime environment (e.g. timers).
|
||||
A truly complete and generic sequence for initializing the lwIP stack
|
||||
cannot be given because it depends on additional initializations for
|
||||
your runtime environment (e.g. timers).
|
||||
|
||||
We can give you some idea on how to proceed when using the raw API.
|
||||
We assume a configuration using a single Ethernet netif and the
|
||||
@@ -373,51 +392,13 @@ UDP and TCP transport layers, IPv4 and the DHCP client.
|
||||
|
||||
Call these functions in the order of appearance:
|
||||
|
||||
- stats_init()
|
||||
- lwip_init()
|
||||
|
||||
Clears the structure where runtime statistics are gathered.
|
||||
Initialize the lwIP stack and all of its subsystems.
|
||||
|
||||
- sys_init()
|
||||
|
||||
Not of much use since we set the NO_SYS 1 option in lwipopts.h,
|
||||
to be called for easy configuration changes.
|
||||
|
||||
- mem_init()
|
||||
|
||||
Initializes the dynamic memory heap defined by MEM_SIZE.
|
||||
|
||||
- memp_init()
|
||||
|
||||
Initializes the memory pools defined by MEMP_NUM_x.
|
||||
|
||||
- pbuf_init()
|
||||
|
||||
Initializes the pbuf memory pool defined by PBUF_POOL_SIZE.
|
||||
|
||||
- etharp_init()
|
||||
|
||||
Initializes the ARP table and queue.
|
||||
Note: you must call etharp_tmr at a ARP_TMR_INTERVAL (5 seconds) regular interval
|
||||
after this initialization.
|
||||
|
||||
- ip_init()
|
||||
|
||||
Doesn't do much, it should be called to handle future changes.
|
||||
|
||||
- udp_init()
|
||||
|
||||
Clears the UDP PCB list.
|
||||
|
||||
- tcp_init()
|
||||
|
||||
Clears the TCP PCB list and clears some internal TCP timers.
|
||||
Note: you must call tcp_fasttmr() and tcp_slowtmr() at the
|
||||
predefined regular intervals after this initialization.
|
||||
|
||||
- netif_add(struct netif *netif, ip_addr_t *ipaddr,
|
||||
ip_addr_t *netmask, ip_addr_t *gw,
|
||||
void *state, err_t (* init)(struct netif *netif),
|
||||
err_t (* input)(struct pbuf *p, struct netif *netif))
|
||||
- netif_add(struct netif *netif, const ip4_addr_t *ipaddr,
|
||||
const ip4_addr_t *netmask, const ip4_addr_t *gw,
|
||||
void *state, netif_init_fn init, netif_input_fn input)
|
||||
|
||||
Adds your network interface to the netif_list. Allocate a struct
|
||||
netif and pass a pointer to this structure as the first argument.
|
||||
@@ -425,18 +406,20 @@ Call these functions in the order of appearance:
|
||||
or fill them with sane numbers otherwise. The state pointer may be NULL.
|
||||
|
||||
The init function pointer must point to a initialization function for
|
||||
your ethernet netif interface. The following code illustrates it's use.
|
||||
your Ethernet netif interface. The following code illustrates its use.
|
||||
|
||||
err_t netif_if_init(struct netif *netif)
|
||||
{
|
||||
u8_t i;
|
||||
|
||||
for(i = 0; i < ETHARP_HWADDR_LEN; i++) netif->hwaddr[i] = some_eth_addr[i];
|
||||
for (i = 0; i < ETHARP_HWADDR_LEN; i++) {
|
||||
netif->hwaddr[i] = some_eth_addr[i];
|
||||
}
|
||||
init_my_eth_device();
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
For ethernet drivers, the input function pointer must point to the lwip
|
||||
For Ethernet drivers, the input function pointer must point to the lwIP
|
||||
function ethernet_input() declared in "netif/etharp.h". Other drivers
|
||||
must use ip_input() declared in "lwip/ip.h".
|
||||
|
||||
@@ -444,18 +427,30 @@ Call these functions in the order of appearance:
|
||||
|
||||
Registers the default network interface.
|
||||
|
||||
- netif_set_link_up(struct netif *netif)
|
||||
|
||||
This is the hardware link state; e.g. whether cable is plugged for wired
|
||||
Ethernet interface. This function must be called even if you don't know
|
||||
the current state. Having link up and link down events is optional but
|
||||
DHCP and IPv6 discover benefit well from those events.
|
||||
|
||||
- netif_set_up(struct netif *netif)
|
||||
|
||||
When the netif is fully configured this function must be called.
|
||||
This is the administrative (= software) state of the netif, when the
|
||||
netif is fully configured this function must be called.
|
||||
|
||||
- dhcp_start(struct netif *netif)
|
||||
|
||||
Creates a new DHCP client for this interface on the first call.
|
||||
Note: you must call dhcp_fine_tmr() and dhcp_coarse_tmr() at
|
||||
the predefined regular intervals after starting the client.
|
||||
|
||||
You can peek in the netif->dhcp struct for the actual DHCP status.
|
||||
|
||||
- sys_check_timeouts()
|
||||
|
||||
When the system is running, you have to periodically call
|
||||
sys_check_timeouts() which will handle all timers for all protocols in
|
||||
the stack; add this to your main loop or equivalent.
|
||||
|
||||
|
||||
--- Optimalization hints
|
||||
|
||||
|
||||
131
doc/savannah.txt
131
doc/savannah.txt
@@ -2,37 +2,34 @@ Daily Use Guide for using Savannah for lwIP
|
||||
|
||||
Table of Contents:
|
||||
|
||||
1 - Obtaining lwIP from the CVS repository
|
||||
2 - Committers/developers CVS access using SSH (to be written)
|
||||
3 - Merging from DEVEL branch to main trunk (stable branch)
|
||||
1 - Obtaining lwIP from the Git repository
|
||||
2 - Committers/developers Git access using SSH
|
||||
3 - Merging a development branch to master branch
|
||||
4 - How to release lwIP
|
||||
|
||||
|
||||
|
||||
1 Obtaining lwIP from the CVS repository
|
||||
1 Obtaining lwIP from the Git repository
|
||||
----------------------------------------
|
||||
|
||||
To perform an anonymous CVS checkout of the main trunk (this is where
|
||||
To perform an anonymous Git clone of the master branch (this is where
|
||||
bug fixes and incremental enhancements occur), do this:
|
||||
git clone git://git.savannah.nongnu.org/lwip.git
|
||||
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/lwip checkout lwip
|
||||
|
||||
Or, obtain a stable branch (updated with bug fixes only) as follows:
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/lwip checkout \
|
||||
-r STABLE-0_7 -d lwip-0.7 lwip
|
||||
git clone --branch DEVEL-1_4_1 git://git.savannah.nongnu.org/lwip.git
|
||||
|
||||
Or, obtain a specific (fixed) release as follows:
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/lwip checkout \
|
||||
-r STABLE-0_7_0 -d lwip-0.7.0 lwip
|
||||
git clone --branch STABLE-1_4_1 git://git.savannah.nongnu.org/lwip.git
|
||||
|
||||
3 Committers/developers CVS access using SSH
|
||||
|
||||
2 Committers/developers Git access using SSH
|
||||
--------------------------------------------
|
||||
|
||||
The Savannah server uses SSH (Secure Shell) protocol 2 authentication and encryption.
|
||||
As such, CVS commits to the server occur through a SSH tunnel for project members.
|
||||
As such, Git commits to the server occur through a SSH tunnel for project members.
|
||||
To create a SSH2 key pair in UNIX-like environments, do this:
|
||||
|
||||
ssh-keygen -t dsa
|
||||
ssh-keygen -t dsa
|
||||
|
||||
Under Windows, a recommended SSH client is "PuTTY", freely available with good
|
||||
documentation and a graphic user interface. Use its key generator.
|
||||
@@ -41,95 +38,83 @@ Now paste the id_dsa.pub contents into your Savannah account public key list. Wa
|
||||
a while so that Savannah can update its configuration (This can take minutes).
|
||||
|
||||
Try to login using SSH:
|
||||
|
||||
ssh -v your_login@cvs.sv.gnu.org
|
||||
ssh -v your_login@git.sv.gnu.org
|
||||
|
||||
If it tells you:
|
||||
Linux vcs.savannah.gnu.org 2.6.32-5-xen-686 #1 SMP Wed Jun 17 17:10:03 UTC 2015 i686
|
||||
|
||||
Authenticating with public key "your_key_name"...
|
||||
Server refused to allocate pty
|
||||
Interactive shell login is not possible for security reasons.
|
||||
VCS commands are allowed.
|
||||
Last login: Tue May 15 23:10:12 2012 from 82.245.102.129
|
||||
You tried to execute:
|
||||
Sorry, you are not allowed to execute that command.
|
||||
Shared connection to git.sv.gnu.org closed.
|
||||
|
||||
then you could login; Savannah refuses to give you a shell - which is OK, as we
|
||||
are allowed to use SSH for CVS only. Now, you should be able to do this:
|
||||
are allowed to use SSH for Git only. Now, you should be able to do this:
|
||||
git clone your_login@git.sv.gnu.org:/srv/git/lwip.git
|
||||
|
||||
export CVS_RSH=ssh
|
||||
cvs -z3 -d:ext:your_login@cvs.sv.gnu.org:/sources/lwip co lwip
|
||||
|
||||
after which you can edit your local files with bug fixes or new features and
|
||||
commit them. Make sure you know what you are doing when using CVS to make
|
||||
After which you can edit your local files with bug fixes or new features and
|
||||
commit them. Make sure you know what you are doing when using Git to make
|
||||
changes on the repository. If in doubt, ask on the lwip-members mailing list.
|
||||
|
||||
(If SSH asks about authenticity of the host, you can check the key
|
||||
fingerprint against http://savannah.nongnu.org/cvs/?group=lwip)
|
||||
fingerprint against https://savannah.nongnu.org/git/?group=lwip
|
||||
|
||||
|
||||
3 Merging from DEVEL branch to main trunk (stable)
|
||||
--------------------------------------------------
|
||||
3 - Merging a development branch to master branch
|
||||
-------------------------------------------------
|
||||
|
||||
Merging is a delicate process in CVS and requires the
|
||||
following disciplined steps in order to prevent conflicts
|
||||
in the future. Conflicts can be hard to solve!
|
||||
Merging is a straightforward process in Git. How to merge all changes in a
|
||||
development branch since our last merge from main:
|
||||
|
||||
Merging from branch A to branch B requires that the A branch
|
||||
has a tag indicating the previous merger. This tag is called
|
||||
'merged_from_A_to_B'. After merging, the tag is moved in the
|
||||
A branch to remember this merger for future merge actions.
|
||||
Checkout the master branch:
|
||||
git checkout master
|
||||
|
||||
IMPORTANT: AFTER COMMITTING A SUCCESFUL MERGE IN THE
|
||||
REPOSITORY, THE TAG MUST BE SET ON THE SOURCE BRANCH OF THE
|
||||
MERGE ACTION (REPLACING EXISTING TAGS WITH THE SAME NAME).
|
||||
Merge the development branch to master:
|
||||
git merge your-development-branch
|
||||
|
||||
Merge all changes in DEVEL since our last merge to main:
|
||||
Resolve any conflict.
|
||||
|
||||
In the working copy of the main trunk:
|
||||
cvs update -P -jmerged_from_DEVEL_to_main -jDEVEL
|
||||
Commit the merge result.
|
||||
git commit -a
|
||||
|
||||
(This will apply the changes between 'merged_from_DEVEL_to_main'
|
||||
and 'DEVEL' to your work set of files)
|
||||
Push your commits:
|
||||
git push
|
||||
|
||||
We can now commit the merge result.
|
||||
cvs commit -R -m "Merged from DEVEL to main."
|
||||
|
||||
If this worked out OK, we now move the tag in the DEVEL branch
|
||||
to this merge point, so we can use this point for future merges:
|
||||
|
||||
cvs rtag -F -r DEVEL merged_from_DEVEL_to_main lwip
|
||||
|
||||
4 How to release lwIP
|
||||
---------------------
|
||||
|
||||
First, checkout a clean copy of the branch to be released. Tag this set with
|
||||
tag name "STABLE-0_6_3". (I use release number 0.6.3 throughout this example).
|
||||
First, tag the release using Git: (I use release number 1.4.1 throughout
|
||||
this example).
|
||||
git tag -a STABLE-1_4_1
|
||||
|
||||
Login CVS using pserver authentication, then export a clean copy of the
|
||||
tagged tree. Export is similar to a checkout, except that the CVS metadata
|
||||
is not created locally.
|
||||
Share the tag reference by pushing it to remote:
|
||||
git push origin STABLE-1_4_1
|
||||
|
||||
export CVS_RSH=ssh
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/lwip checkout \
|
||||
-r STABLE-0_6_3 -d lwip-0.6.3 lwip
|
||||
Prepare the release:
|
||||
cp -r lwip lwip-1.4.1
|
||||
rm -rf lwip-1.4.1/.git lwip-1.4.1/.gitattributes
|
||||
|
||||
Archive this directory using tar, gzip'd, bzip2'd and zip'd.
|
||||
|
||||
tar czvf lwip-0.6.3.tar.gz lwip-0.6.3
|
||||
tar cjvf lwip-0.6.3.tar.bz2 lwip-0.6.3
|
||||
zip -r lwip-0.6.3.zip lwip-0.6.3
|
||||
Archive the current directory using tar, gzip'd, bzip2'd and zip'd.
|
||||
tar czvf lwip-1.4.1.tar.gz lwip-1.4.1
|
||||
tar cjvf lwip-1.4.1.tar.bz2 lwip-1.4.1
|
||||
zip -r lwip-1.4.1.zip lwip-1.4.1
|
||||
|
||||
Now, sign the archives with a detached GPG binary signature as follows:
|
||||
|
||||
gpg -b lwip-0.6.3.tar.gz
|
||||
gpg -b lwip-0.6.3.tar.bz2
|
||||
gpg -b lwip-0.6.3.zip
|
||||
gpg -b lwip-1.4.1.tar.gz
|
||||
gpg -b lwip-1.4.1.tar.bz2
|
||||
gpg -b lwip-1.4.1.zip
|
||||
|
||||
Upload these files using anonymous FTP:
|
||||
ncftp ftp://savannah.gnu.org/incoming/savannah/lwip
|
||||
|
||||
ncftp>mput *0.6.3.*
|
||||
ncftp ftp://savannah.gnu.org/incoming/savannah/lwip
|
||||
ncftp> mput *1.4.1.*
|
||||
|
||||
Additionally, you may post a news item on Savannah, like this:
|
||||
|
||||
A new 0.6.3 release is now available here:
|
||||
http://savannah.nongnu.org/files/?group=lwip&highlight=0.6.3
|
||||
A new 1.4.1 release is now available here:
|
||||
http://savannah.nongnu.org/files/?group=lwip&highlight=1.4.1
|
||||
|
||||
You will have to submit this via the user News interface, then approve
|
||||
this via the Administrator News interface.
|
||||
this via the Administrator News interface.
|
||||
|
||||
@@ -91,22 +91,6 @@ one or more trap destinations using these calls:
|
||||
snmp_trap_dst_enable();
|
||||
snmp_trap_dst_ip_set();
|
||||
|
||||
In the lwIP initialisation sequence call snmp_init() just after
|
||||
the call to udp_init().
|
||||
|
||||
Exactly every 10 msec the SNMP uptime timestamp must be updated with
|
||||
snmp_inc_sysuptime(). You should call this from a timer interrupt
|
||||
or a timer signal handler depending on your runtime environment.
|
||||
|
||||
An alternative way to update the SNMP uptime timestamp is to do a call like
|
||||
snmp_add_sysuptime(100) each 1000ms (which is bigger "step", but call to
|
||||
a lower frequency). Another one is to not call snmp_inc_sysuptime() or
|
||||
snmp_add_sysuptime(), and to define the SNMP_GET_SYSUPTIME(sysuptime) macro.
|
||||
This one is undefined by default in mib2.c. SNMP_GET_SYSUPTIME is called inside
|
||||
snmp_get_sysuptime(u32_t *value), and enable to change "sysuptime" value only
|
||||
when it's queried (any function which need "sysuptime" have to call
|
||||
snmp_get_sysuptime).
|
||||
|
||||
|
||||
3 Private MIBs
|
||||
==============
|
||||
|
||||
167
src/Filelists.mk
Normal file
167
src/Filelists.mk
Normal file
@@ -0,0 +1,167 @@
|
||||
#
|
||||
# Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
# SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
# OF SUCH DAMAGE.
|
||||
#
|
||||
# This file is part of the lwIP TCP/IP stack.
|
||||
#
|
||||
# Author: Adam Dunkels <adam@sics.se>
|
||||
#
|
||||
|
||||
# COREFILES, CORE4FILES: The minimum set of files needed for lwIP.
|
||||
COREFILES=$(LWIPDIR)/core/def.c \
|
||||
$(LWIPDIR)/core/dns.c \
|
||||
$(LWIPDIR)/core/inet_chksum.c \
|
||||
$(LWIPDIR)/core/init.c \
|
||||
$(LWIPDIR)/core/ip.c \
|
||||
$(LWIPDIR)/core/mem.c \
|
||||
$(LWIPDIR)/core/memp.c \
|
||||
$(LWIPDIR)/core/netif.c \
|
||||
$(LWIPDIR)/core/pbuf.c \
|
||||
$(LWIPDIR)/core/raw.c \
|
||||
$(LWIPDIR)/core/stats.c \
|
||||
$(LWIPDIR)/core/sys.c \
|
||||
$(LWIPDIR)/core/tcp.c \
|
||||
$(LWIPDIR)/core/tcp_in.c \
|
||||
$(LWIPDIR)/core/tcp_out.c \
|
||||
$(LWIPDIR)/core/timers.c \
|
||||
$(LWIPDIR)/core/udp.c
|
||||
|
||||
CORE4FILES=$(LWIPDIR)/core/ipv4/autoip.c \
|
||||
$(LWIPDIR)/core/ipv4/dhcp.c \
|
||||
$(LWIPDIR)/core/ipv4/icmp.c \
|
||||
$(LWIPDIR)/core/ipv4/igmp.c \
|
||||
$(LWIPDIR)/core/ipv4/ip_frag.c \
|
||||
$(LWIPDIR)/core/ipv4/ip4.c \
|
||||
$(LWIPDIR)/core/ipv4/ip4_addr.c
|
||||
|
||||
CORE6FILES=$(LWIPDIR)/core/ipv6/dhcp6.c \
|
||||
$(LWIPDIR)/core/ipv6/ethip6.c \
|
||||
$(LWIPDIR)/core/ipv6/icmp6.c \
|
||||
$(LWIPDIR)/core/ipv6/ip6.c \
|
||||
$(LWIPDIR)/core/ipv6/ip6_addr.c \
|
||||
$(LWIPDIR)/core/ipv6/ip6_frag.c \
|
||||
$(LWIPDIR)/core/ipv6/mld6.c \
|
||||
$(LWIPDIR)/core/ipv6/nd6.c
|
||||
|
||||
# APIFILES: The files which implement the sequential and socket APIs.
|
||||
APIFILES=$(LWIPDIR)/api/api_lib.c \
|
||||
$(LWIPDIR)/api/api_msg.c \
|
||||
$(LWIPDIR)/api/err.c \
|
||||
$(LWIPDIR)/api/netbuf.c \
|
||||
$(LWIPDIR)/api/netdb.c \
|
||||
$(LWIPDIR)/api/netifapi.c \
|
||||
$(LWIPDIR)/api/sockets.c \
|
||||
$(LWIPDIR)/api/tcpip.c
|
||||
|
||||
# NETIFFILES: Files implementing various generic network interface functions
|
||||
NETIFFILES=$(LWIPDIR)/netif/ethernet.c $(LWIPDIR)/netif/etharp.c \
|
||||
$(LWIPDIR)/netif/slipif.c
|
||||
|
||||
# SIXLOWPAN: 6LoWPAN
|
||||
SIXLOWPAN=$(LWIPDIR)/netif/lowpan6.c \
|
||||
|
||||
# PPPFILES: PPP
|
||||
PPPFILES=$(LWIPDIR)/netif/ppp/auth.c \
|
||||
$(LWIPDIR)/netif/ppp/ccp.c \
|
||||
$(LWIPDIR)/netif/ppp/chap-md5.c \
|
||||
$(LWIPDIR)/netif/ppp/chap_ms.c \
|
||||
$(LWIPDIR)/netif/ppp/chap-new.c \
|
||||
$(LWIPDIR)/netif/ppp/demand.c \
|
||||
$(LWIPDIR)/netif/ppp/eap.c \
|
||||
$(LWIPDIR)/netif/ppp/ecp.c \
|
||||
$(LWIPDIR)/netif/ppp/eui64.c \
|
||||
$(LWIPDIR)/netif/ppp/fsm.c \
|
||||
$(LWIPDIR)/netif/ppp/ipcp.c \
|
||||
$(LWIPDIR)/netif/ppp/ipv6cp.c \
|
||||
$(LWIPDIR)/netif/ppp/lcp.c \
|
||||
$(LWIPDIR)/netif/ppp/magic.c \
|
||||
$(LWIPDIR)/netif/ppp/mppe.c \
|
||||
$(LWIPDIR)/netif/ppp/multilink.c \
|
||||
$(LWIPDIR)/netif/ppp/ppp.c \
|
||||
$(LWIPDIR)/netif/ppp/pppapi.c \
|
||||
$(LWIPDIR)/netif/ppp/pppcrypt.c \
|
||||
$(LWIPDIR)/netif/ppp/pppoe.c \
|
||||
$(LWIPDIR)/netif/ppp/pppol2tp.c \
|
||||
$(LWIPDIR)/netif/ppp/pppos.c \
|
||||
$(LWIPDIR)/netif/ppp/upap.c \
|
||||
$(LWIPDIR)/netif/ppp/utils.c \
|
||||
$(LWIPDIR)/netif/ppp/vj.c \
|
||||
$(LWIPDIR)/netif/ppp/polarssl/arc4.c \
|
||||
$(LWIPDIR)/netif/ppp/polarssl/des.c \
|
||||
$(LWIPDIR)/netif/ppp/polarssl/md4.c \
|
||||
$(LWIPDIR)/netif/ppp/polarssl/md5.c \
|
||||
$(LWIPDIR)/netif/ppp/polarssl/sha1.c
|
||||
|
||||
# LWIPNOAPPSFILES: All LWIP files without apps
|
||||
LWIPNOAPPSFILES=$(COREFILES) \
|
||||
$(CORE4FILES) \
|
||||
$(CORE6FILES) \
|
||||
$(APIFILES) \
|
||||
$(NETIFFILES) \
|
||||
$(PPPFILES) \
|
||||
$(SIXLOWPAN)
|
||||
|
||||
# SNMPFILES: SNMPv2c agent
|
||||
SNMPFILES=$(LWIPDIR)/apps/snmp/snmp_asn1.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_core.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_icmp.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_interfaces.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_ip.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_snmp.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_system.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_tcp.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_mib2_udp.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_msg.c \
|
||||
$(LWIPDIR)/apps/snmp/snmpv3.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_netconn.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_pbuf_stream.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_raw.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_scalar.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_table.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_threadsync.c \
|
||||
$(LWIPDIR)/apps/snmp/snmp_traps.c \
|
||||
$(LWIPDIR)/apps/snmp/snmpv3_mbedtls.c \
|
||||
$(LWIPDIR)/apps/snmp/snmpv3_dummy.c
|
||||
|
||||
# HTTPDFILES: HTTP server
|
||||
HTTPDFILES=$(LWIPDIR)/apps/httpd/fs.c \
|
||||
$(LWIPDIR)/apps/httpd/httpd.c
|
||||
|
||||
# LWIPERFFILES: IPERF server
|
||||
LWIPERFFILES=$(LWIPDIR)/apps/lwiperf/lwiperf.c
|
||||
|
||||
# SNTPFILES: SNTP client
|
||||
SNTPFILES=$(LWIPDIR)/apps/sntp/sntp.c
|
||||
|
||||
# NETBIOSNSFILES: NetBIOS name server
|
||||
NETBIOSNSFILES=$(LWIPDIR)/apps/netbiosns/netbiosns.c
|
||||
|
||||
# LWIPAPPFILES: All LWIP APPs
|
||||
LWIPAPPFILES=$(SNMPFILES) \
|
||||
$(HTTPDFILES) \
|
||||
$(LWIPERFFILES) \
|
||||
$(SNTPFILES) \
|
||||
$(NETBIOSNSFILES)
|
||||
@@ -3,12 +3,12 @@
|
||||
* Sequential API External module
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@@ -17,21 +17,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
@@ -44,16 +44,55 @@
|
||||
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/api.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/memp.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/priv/api_msg.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define API_MSG_VAR_REF(name) API_VAR_REF(name)
|
||||
#define API_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct api_msg, name)
|
||||
#define API_MSG_VAR_ALLOC(name) API_VAR_ALLOC(struct api_msg, MEMP_API_MSG, name, ERR_MEM)
|
||||
#define API_MSG_VAR_ALLOC_RETURN_NULL(name) API_VAR_ALLOC(struct api_msg, MEMP_API_MSG, name, NULL)
|
||||
#define API_MSG_VAR_FREE(name) API_VAR_FREE(MEMP_API_MSG, name)
|
||||
|
||||
static err_t netconn_close_shutdown(struct netconn *conn, u8_t how);
|
||||
|
||||
/**
|
||||
* Call the lower part of a netconn_* function
|
||||
* This function is then running in the thread context
|
||||
* of tcpip_thread and has exclusive access to lwIP core code.
|
||||
*
|
||||
* @param fn function to call
|
||||
* @param apimsg a struct containing the function to call and its parameters
|
||||
* @return ERR_OK if the function was called, another err_t if not
|
||||
*/
|
||||
static err_t
|
||||
netconn_apimsg(tcpip_callback_fn fn, struct api_msg *apimsg)
|
||||
{
|
||||
err_t err;
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
/* catch functions that don't set err */
|
||||
apimsg->err = ERR_VAL;
|
||||
#endif /* LWIP_DEBUG */
|
||||
|
||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
||||
apimsg->op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
err = tcpip_send_msg_wait_sem(fn, apimsg, LWIP_API_MSG_SEM(apimsg));
|
||||
if (err == ERR_OK) {
|
||||
return apimsg->err;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new netconn (of a specific type) that has a callback function.
|
||||
* The corresponding pcb is also created.
|
||||
@@ -68,26 +107,33 @@ struct netconn*
|
||||
netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_callback callback)
|
||||
{
|
||||
struct netconn *conn;
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
API_MSG_VAR_ALLOC_RETURN_NULL(msg);
|
||||
|
||||
conn = netconn_alloc(t, callback);
|
||||
if (conn != NULL) {
|
||||
msg.function = do_newconn;
|
||||
msg.msg.msg.n.proto = proto;
|
||||
msg.msg.conn = conn;
|
||||
if (TCPIP_APIMSG(&msg) != ERR_OK) {
|
||||
err_t err;
|
||||
|
||||
API_MSG_VAR_REF(msg).msg.n.proto = proto;
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
err = netconn_apimsg(lwip_netconn_do_newconn, &API_MSG_VAR_REF(msg));
|
||||
if (err != ERR_OK) {
|
||||
LWIP_ASSERT("freeing conn without freeing pcb", conn->pcb.tcp == NULL);
|
||||
LWIP_ASSERT("conn has no op_completed", sys_sem_valid(&conn->op_completed));
|
||||
LWIP_ASSERT("conn has no recvmbox", sys_mbox_valid(&conn->recvmbox));
|
||||
#if LWIP_TCP
|
||||
LWIP_ASSERT("conn->acceptmbox shouldn't exist", !sys_mbox_valid(&conn->acceptmbox));
|
||||
#endif /* LWIP_TCP */
|
||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||
LWIP_ASSERT("conn has no op_completed", sys_sem_valid(&conn->op_completed));
|
||||
sys_sem_free(&conn->op_completed);
|
||||
#endif /* !LWIP_NETCONN_SEM_PER_THREAD */
|
||||
sys_mbox_free(&conn->recvmbox);
|
||||
memp_free(MEMP_NETCONN, conn);
|
||||
API_MSG_VAR_FREE(msg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
API_MSG_VAR_FREE(msg);
|
||||
return conn;
|
||||
}
|
||||
|
||||
@@ -102,21 +148,35 @@ netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_cal
|
||||
err_t
|
||||
netconn_delete(struct netconn *conn)
|
||||
{
|
||||
struct api_msg msg;
|
||||
err_t err;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
|
||||
/* No ASSERT here because possible to get a (conn == NULL) if we got an accept error */
|
||||
if (conn == NULL) {
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
msg.function = do_delconn;
|
||||
msg.msg.conn = conn;
|
||||
tcpip_apimsg(&msg);
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
|
||||
/* get the time we started, which is later compared to
|
||||
sys_now() + conn->send_timeout */
|
||||
API_MSG_VAR_REF(msg).msg.sd.time_started = sys_now();
|
||||
#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
||||
#if LWIP_TCP
|
||||
API_MSG_VAR_REF(msg).msg.sd.polls_left =
|
||||
((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1;
|
||||
#endif /* LWIP_TCP */
|
||||
#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
||||
err = netconn_apimsg(lwip_netconn_do_delconn, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
if (err != ERR_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
netconn_free(conn);
|
||||
|
||||
/* don't care for return value of do_delconn since it only calls void functions */
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
@@ -134,21 +194,27 @@ netconn_delete(struct netconn *conn)
|
||||
err_t
|
||||
netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_getaddr: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_getaddr: invalid addr", (addr != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_getaddr: invalid port", (port != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_getaddr;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.ad.ipaddr = ip_2_ipX(addr);
|
||||
msg.msg.msg.ad.port = port;
|
||||
msg.msg.msg.ad.local = local;
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.ad.local = local;
|
||||
#if LWIP_MPU_COMPATIBLE
|
||||
err = netconn_apimsg(lwip_netconn_do_getaddr, &API_MSG_VAR_REF(msg));
|
||||
*addr = msg->msg.ad.ipaddr;
|
||||
*port = msg->msg.ad.port;
|
||||
#else /* LWIP_MPU_COMPATIBLE */
|
||||
msg.msg.ad.ipaddr = addr;
|
||||
msg.msg.ad.port = port;
|
||||
err = netconn_apimsg(lwip_netconn_do_getaddr, &msg);
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -163,20 +229,25 @@ netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local)
|
||||
* @return ERR_OK if bound, any other err_t on failure
|
||||
*/
|
||||
err_t
|
||||
netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port)
|
||||
netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
|
||||
LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_bind;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.bc.ipaddr = addr;
|
||||
msg.msg.msg.bc.port = port;
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
/* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */
|
||||
if (addr == NULL) {
|
||||
addr = IP_ADDR_ANY;
|
||||
}
|
||||
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.bc.ipaddr = API_MSG_VAR_REF(addr);
|
||||
API_MSG_VAR_REF(msg).msg.bc.port = port;
|
||||
err = netconn_apimsg(lwip_netconn_do_bind, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -189,21 +260,25 @@ netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port)
|
||||
* @return ERR_OK if connected, return value of tcp_/udp_/raw_connect otherwise
|
||||
*/
|
||||
err_t
|
||||
netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port)
|
||||
netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_connect;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.bc.ipaddr = addr;
|
||||
msg.msg.msg.bc.port = port;
|
||||
/* This is the only function which need to not block tcpip_thread */
|
||||
err = tcpip_apimsg(&msg);
|
||||
/* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */
|
||||
if (addr == NULL) {
|
||||
addr = IP_ADDR_ANY;
|
||||
}
|
||||
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.bc.ipaddr = API_MSG_VAR_REF(addr);
|
||||
API_MSG_VAR_REF(msg).msg.bc.port = port;
|
||||
err = netconn_apimsg(lwip_netconn_do_connect, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -216,16 +291,16 @@ netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port)
|
||||
err_t
|
||||
netconn_disconnect(struct netconn *conn)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_disconnect;
|
||||
msg.msg.conn = conn;
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
err = netconn_apimsg(lwip_netconn_do_disconnect, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -241,7 +316,7 @@ err_t
|
||||
netconn_listen_with_backlog(struct netconn *conn, u8_t backlog)
|
||||
{
|
||||
#if LWIP_TCP
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
/* This does no harm. If TCP_LISTEN_BACKLOG is off, backlog is unused. */
|
||||
@@ -249,14 +324,14 @@ netconn_listen_with_backlog(struct netconn *conn, u8_t backlog)
|
||||
|
||||
LWIP_ERROR("netconn_listen: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_listen;
|
||||
msg.msg.conn = conn;
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
msg.msg.msg.lb.backlog = backlog;
|
||||
API_MSG_VAR_REF(msg).msg.lb.backlog = backlog;
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
err = netconn_apimsg(lwip_netconn_do_listen, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
#else /* LWIP_TCP */
|
||||
LWIP_UNUSED_ARG(conn);
|
||||
@@ -277,16 +352,16 @@ err_t
|
||||
netconn_accept(struct netconn *conn, struct netconn **new_conn)
|
||||
{
|
||||
#if LWIP_TCP
|
||||
void *accept_ptr;
|
||||
struct netconn *newconn;
|
||||
err_t err;
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
|
||||
LWIP_ERROR("netconn_accept: invalid pointer", (new_conn != NULL), return ERR_ARG;);
|
||||
*new_conn = NULL;
|
||||
LWIP_ERROR("netconn_accept: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_accept: invalid acceptmbox", sys_mbox_valid(&conn->acceptmbox), return ERR_ARG;);
|
||||
|
||||
err = conn->last_err;
|
||||
if (ERR_IS_FATAL(err)) {
|
||||
@@ -294,29 +369,53 @@ netconn_accept(struct netconn *conn, struct netconn **new_conn)
|
||||
waiting on acceptmbox forever! */
|
||||
return err;
|
||||
}
|
||||
if (!sys_mbox_valid(&conn->acceptmbox)) {
|
||||
return ERR_CLSD;
|
||||
}
|
||||
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
|
||||
#if LWIP_SO_RCVTIMEO
|
||||
if (sys_arch_mbox_fetch(&conn->acceptmbox, (void **)&newconn, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_TIMEOUT);
|
||||
if (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
API_MSG_VAR_FREE(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
#else
|
||||
sys_arch_mbox_fetch(&conn->acceptmbox, (void **)&newconn, 0);
|
||||
sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0);
|
||||
#endif /* LWIP_SO_RCVTIMEO*/
|
||||
newconn = (struct netconn *)accept_ptr;
|
||||
/* Register event with callback */
|
||||
API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0);
|
||||
|
||||
if (accept_ptr == &netconn_aborted) {
|
||||
/* a connection has been aborted: out of pcbs or out of netconns during accept */
|
||||
/* @todo: set netconn error, but this would be fatal and thus block further accepts */
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
API_MSG_VAR_FREE(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
return ERR_ABRT;
|
||||
}
|
||||
if (newconn == NULL) {
|
||||
/* connection has been aborted */
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_ABRT);
|
||||
return ERR_ABRT;
|
||||
/* in this special case, we set the netconn error from application thread, as
|
||||
on a ready-to-accept listening netconn, there should not be anything running
|
||||
in tcpip_thread */
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_CLSD);
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
API_MSG_VAR_FREE(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
return ERR_CLSD;
|
||||
}
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
/* Let the stack know that we have accepted the connection. */
|
||||
msg.function = do_recv;
|
||||
msg.msg.conn = conn;
|
||||
/* don't care for the return value of do_recv */
|
||||
TCPIP_APIMSG(&msg);
|
||||
API_MSG_VAR_REF(msg).conn = newconn;
|
||||
/* don't care for the return value of lwip_netconn_do_recv */
|
||||
netconn_apimsg(lwip_netconn_do_accepted, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
|
||||
*new_conn = newconn;
|
||||
@@ -345,13 +444,24 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
|
||||
u16_t len;
|
||||
err_t err;
|
||||
#if LWIP_TCP
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;);
|
||||
*new_buf = NULL;
|
||||
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_accept: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
|
||||
#if LWIP_TCP
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
if (!sys_mbox_valid(&conn->recvmbox)) {
|
||||
/* This happens when calling this function after receiving FIN */
|
||||
return sys_mbox_valid(&conn->acceptmbox) ? ERR_CONN : ERR_CLSD;
|
||||
}
|
||||
}
|
||||
#endif /* LWIP_TCP */
|
||||
LWIP_ERROR("netconn_recv: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
|
||||
|
||||
err = conn->last_err;
|
||||
if (ERR_IS_FATAL(err)) {
|
||||
@@ -361,10 +471,25 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
|
||||
before the fatal error occurred - is that a problem? */
|
||||
return err;
|
||||
}
|
||||
|
||||
#if LWIP_TCP
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
}
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
#if LWIP_SO_RCVTIMEO
|
||||
if (sys_arch_mbox_fetch(&conn->recvmbox, &buf, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_TIMEOUT);
|
||||
#if LWIP_TCP
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
API_MSG_VAR_FREE(msg);
|
||||
}
|
||||
#endif /* LWIP_TCP */
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
#else
|
||||
@@ -372,27 +497,30 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
|
||||
#endif /* LWIP_SO_RCVTIMEO*/
|
||||
|
||||
#if LWIP_TCP
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
|
||||
if (!netconn_get_noautorecved(conn) || (buf == NULL)) {
|
||||
/* Let the stack know that we have taken the data. */
|
||||
/* TODO: Speedup: Don't block and wait for the answer here
|
||||
(to prevent multiple thread-switches). */
|
||||
msg.function = do_recv;
|
||||
msg.msg.conn = conn;
|
||||
if (buf != NULL) {
|
||||
msg.msg.msg.r.len = ((struct pbuf *)buf)->tot_len;
|
||||
} else {
|
||||
msg.msg.msg.r.len = 1;
|
||||
}
|
||||
/* don't care for the return value of do_recv */
|
||||
TCPIP_APIMSG(&msg);
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
/* Let the stack know that we have taken the data. */
|
||||
/* TODO: Speedup: Don't block and wait for the answer here
|
||||
(to prevent multiple thread-switches). */
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
if (buf != NULL) {
|
||||
API_MSG_VAR_REF(msg).msg.r.len = ((struct pbuf *)buf)->tot_len;
|
||||
} else {
|
||||
API_MSG_VAR_REF(msg).msg.r.len = 1;
|
||||
}
|
||||
|
||||
/* don't care for the return value of lwip_netconn_do_recv */
|
||||
netconn_apimsg(lwip_netconn_do_recv, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
/* If we are closed, we indicate that we no longer wish to use the socket */
|
||||
if (buf == NULL) {
|
||||
API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0);
|
||||
/* Avoid to lose any previous error code */
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_CLSD);
|
||||
/* RX side is closed, so deallocate the recvmbox */
|
||||
netconn_close_shutdown(conn, NETCONN_SHUT_RD);
|
||||
/* Don' store ERR_CLSD as conn->err since we are only half-closed */
|
||||
return ERR_CLSD;
|
||||
}
|
||||
len = ((struct pbuf *)buf)->tot_len;
|
||||
@@ -458,16 +586,17 @@ netconn_recv(struct netconn *conn, struct netbuf **new_buf)
|
||||
LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;);
|
||||
*new_buf = NULL;
|
||||
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_accept: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
|
||||
|
||||
#if LWIP_TCP
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
struct pbuf *p = NULL;
|
||||
/* This is not a listening netconn, since recvmbox is set */
|
||||
|
||||
buf = (struct netbuf *)memp_malloc(MEMP_NETBUF);
|
||||
if (buf == NULL) {
|
||||
NETCONN_SET_SAFE_ERR(conn, ERR_MEM);
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
@@ -481,12 +610,15 @@ netconn_recv(struct netconn *conn, struct netbuf **new_buf)
|
||||
buf->p = p;
|
||||
buf->ptr = p;
|
||||
buf->port = 0;
|
||||
ipX_addr_set_any(LWIP_IPV6, &buf->addr);
|
||||
ip_addr_set_zero(&buf->addr);
|
||||
*new_buf = buf;
|
||||
/* don't set conn->last_err: it's only ERR_OK, anyway */
|
||||
return ERR_OK;
|
||||
} else
|
||||
}
|
||||
#endif /* LWIP_TCP */
|
||||
#if LWIP_TCP && (LWIP_UDP || LWIP_RAW)
|
||||
else
|
||||
#endif /* LWIP_TCP && (LWIP_UDP || LWIP_RAW) */
|
||||
{
|
||||
#if (LWIP_UDP || LWIP_RAW)
|
||||
return netconn_recv_data(conn, (void **)new_buf);
|
||||
@@ -494,38 +626,6 @@ netconn_recv(struct netconn *conn, struct netbuf **new_buf)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TCP: update the receive window: by calling this, the application
|
||||
* tells the stack that it has processed data and is able to accept
|
||||
* new data.
|
||||
* ATTENTION: use with care, this is mainly used for sockets!
|
||||
* Can only be used when calling netconn_set_noautorecved(conn, 1) before.
|
||||
*
|
||||
* @param conn the netconn for which to update the receive window
|
||||
* @param length amount of data processed (ATTENTION: this must be accurate!)
|
||||
*/
|
||||
void
|
||||
netconn_recved(struct netconn *conn, u32_t length)
|
||||
{
|
||||
#if LWIP_TCP
|
||||
if ((conn != NULL) && (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) &&
|
||||
(netconn_get_noautorecved(conn))) {
|
||||
struct api_msg msg;
|
||||
/* Let the stack know that we have taken the data. */
|
||||
/* TODO: Speedup: Don't block and wait for the answer here
|
||||
(to prevent multiple thread-switches). */
|
||||
msg.function = do_recv;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.r.len = length;
|
||||
/* don't care for the return value of do_recv */
|
||||
TCPIP_APIMSG(&msg);
|
||||
}
|
||||
#else /* LWIP_TCP */
|
||||
LWIP_UNUSED_ARG(conn);
|
||||
LWIP_UNUSED_ARG(length);
|
||||
#endif /* LWIP_TCP */
|
||||
}
|
||||
|
||||
/**
|
||||
* Send data (in form of a netbuf) to a specific remote IP address and port.
|
||||
* Only to be used for UDP and RAW netconns (not TCP).
|
||||
@@ -537,10 +637,10 @@ netconn_recved(struct netconn *conn, u32_t length)
|
||||
* @return ERR_OK if data was sent, any other err_t on error
|
||||
*/
|
||||
err_t
|
||||
netconn_sendto(struct netconn *conn, struct netbuf *buf, ip_addr_t *addr, u16_t port)
|
||||
netconn_sendto(struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port)
|
||||
{
|
||||
if (buf != NULL) {
|
||||
ipX_addr_set_ipaddr(PCB_ISIPV6(conn->pcb.ip), &buf->addr, addr);
|
||||
ip_addr_set(&buf->addr, addr);
|
||||
buf->port = port;
|
||||
return netconn_send(conn, buf);
|
||||
}
|
||||
@@ -557,18 +657,18 @@ netconn_sendto(struct netconn *conn, struct netbuf *buf, ip_addr_t *addr, u16_t
|
||||
err_t
|
||||
netconn_send(struct netconn *conn, struct netbuf *buf)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_send: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %"U16_F" bytes\n", buf->p->tot_len));
|
||||
msg.function = do_send;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.b = buf;
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.b = buf;
|
||||
err = netconn_apimsg(lwip_netconn_do_send, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -581,39 +681,70 @@ netconn_send(struct netconn *conn, struct netbuf *buf)
|
||||
* @param apiflags combination of following flags :
|
||||
* - NETCONN_COPY: data will be copied into memory belonging to the stack
|
||||
* - NETCONN_MORE: for TCP connection, PSH flag will be set on last segment sent
|
||||
* - NETCONN_DONTBLOCK: only write the data if all dat can be written at once
|
||||
* - NETCONN_DONTBLOCK: only write the data if all data can be written at once
|
||||
* @param bytes_written pointer to a location that receives the number of written bytes
|
||||
* @return ERR_OK if data was sent, any other err_t on error
|
||||
*/
|
||||
err_t
|
||||
netconn_write(struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags)
|
||||
netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
|
||||
u8_t apiflags, size_t *bytes_written)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
u8_t dontblock;
|
||||
|
||||
LWIP_ERROR("netconn_write: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_write: invalid conn->type", (NETCONNTYPE_GROUP(conn->type)== NETCONN_TCP), return ERR_VAL;);
|
||||
if (size == 0) {
|
||||
return ERR_OK;
|
||||
}
|
||||
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
|
||||
if (dontblock && !bytes_written) {
|
||||
/* This implies netconn_write() cannot be used for non-blocking send, since
|
||||
it has no way to return the number of bytes written. */
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
/* non-blocking write sends as much */
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.w.dataptr = dataptr;
|
||||
API_MSG_VAR_REF(msg).msg.w.apiflags = apiflags;
|
||||
API_MSG_VAR_REF(msg).msg.w.len = size;
|
||||
#if LWIP_SO_SNDTIMEO
|
||||
if (conn->send_timeout != 0) {
|
||||
/* get the time we started, which is later compared to
|
||||
sys_now() + conn->send_timeout */
|
||||
API_MSG_VAR_REF(msg).msg.w.time_started = sys_now();
|
||||
} else {
|
||||
API_MSG_VAR_REF(msg).msg.w.time_started = 0;
|
||||
}
|
||||
#endif /* LWIP_SO_SNDTIMEO */
|
||||
|
||||
/* @todo: for non-blocking write, check if 'size' would ever fit into
|
||||
snd_queue or snd_buf */
|
||||
msg.function = do_write;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.w.dataptr = dataptr;
|
||||
msg.msg.msg.w.apiflags = apiflags;
|
||||
msg.msg.msg.w.len = size;
|
||||
/* For locking the core: this _can_ be delayed on low memory/low send buffer,
|
||||
but if it is, this is done inside api_msg.c:do_write(), so we can use the
|
||||
non-blocking version here. */
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
err = netconn_apimsg(lwip_netconn_do_write, &API_MSG_VAR_REF(msg));
|
||||
if ((err == ERR_OK) && (bytes_written != NULL)) {
|
||||
if (dontblock
|
||||
#if LWIP_SO_SNDTIMEO
|
||||
|| (conn->send_timeout != 0)
|
||||
#endif /* LWIP_SO_SNDTIMEO */
|
||||
) {
|
||||
/* nonblocking write: maybe the data has been sent partly */
|
||||
*bytes_written = API_MSG_VAR_REF(msg).msg.w.len;
|
||||
} else {
|
||||
/* blocking call succeeded: all data has been sent if it */
|
||||
*bytes_written = size;
|
||||
}
|
||||
}
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close ot shutdown a TCP netconn (doesn't delete it).
|
||||
* Close or shutdown a TCP netconn (doesn't delete it).
|
||||
*
|
||||
* @param conn the TCP netconn to close or shutdown
|
||||
* @param how fully close or only shutdown one side?
|
||||
@@ -622,20 +753,29 @@ netconn_write(struct netconn *conn, const void *dataptr, size_t size, u8_t apifl
|
||||
static err_t
|
||||
netconn_close_shutdown(struct netconn *conn, u8_t how)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
LWIP_UNUSED_ARG(how);
|
||||
|
||||
LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_close;
|
||||
msg.msg.conn = conn;
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
#if LWIP_TCP
|
||||
/* shutting down both ends is the same as closing */
|
||||
msg.msg.msg.sd.shut = how;
|
||||
/* because of the LWIP_TCPIP_CORE_LOCKING implementation of do_close,
|
||||
don't use TCPIP_APIMSG here */
|
||||
err = tcpip_apimsg(&msg);
|
||||
API_MSG_VAR_REF(msg).msg.sd.shut = how;
|
||||
#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
|
||||
/* get the time we started, which is later compared to
|
||||
sys_now() + conn->send_timeout */
|
||||
API_MSG_VAR_REF(msg).msg.sd.time_started = sys_now();
|
||||
#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
||||
API_MSG_VAR_REF(msg).msg.sd.polls_left =
|
||||
((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1;
|
||||
#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
|
||||
#endif /* LWIP_TCP */
|
||||
err = netconn_apimsg(lwip_netconn_do_close, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -677,23 +817,32 @@ netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx)
|
||||
*/
|
||||
err_t
|
||||
netconn_join_leave_group(struct netconn *conn,
|
||||
ip_addr_t *multiaddr,
|
||||
ip_addr_t *netif_addr,
|
||||
const ip_addr_t *multiaddr,
|
||||
const ip_addr_t *netif_addr,
|
||||
enum netconn_igmp join_or_leave)
|
||||
{
|
||||
struct api_msg msg;
|
||||
API_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_join_leave_group: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||
|
||||
msg.function = do_join_leave_group;
|
||||
msg.msg.conn = conn;
|
||||
msg.msg.msg.jl.multiaddr = ip_2_ipX(multiaddr);
|
||||
msg.msg.msg.jl.netif_addr = ip_2_ipX(netif_addr);
|
||||
msg.msg.msg.jl.join_or_leave = join_or_leave;
|
||||
err = TCPIP_APIMSG(&msg);
|
||||
API_MSG_VAR_ALLOC(msg);
|
||||
|
||||
/* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */
|
||||
if (multiaddr == NULL) {
|
||||
multiaddr = IP_ADDR_ANY;
|
||||
}
|
||||
if (netif_addr == NULL) {
|
||||
netif_addr = IP_ADDR_ANY;
|
||||
}
|
||||
|
||||
API_MSG_VAR_REF(msg).conn = conn;
|
||||
API_MSG_VAR_REF(msg).msg.jl.multiaddr = API_MSG_VAR_REF(multiaddr);
|
||||
API_MSG_VAR_REF(msg).msg.jl.netif_addr = API_MSG_VAR_REF(netif_addr);
|
||||
API_MSG_VAR_REF(msg).msg.jl.join_or_leave = join_or_leave;
|
||||
err = netconn_apimsg(lwip_netconn_do_join_leave_group, &API_MSG_VAR_REF(msg));
|
||||
API_MSG_VAR_FREE(msg);
|
||||
|
||||
NETCONN_SET_SAFE_ERR(conn, err);
|
||||
return err;
|
||||
}
|
||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
||||
@@ -709,32 +858,95 @@ netconn_join_leave_group(struct netconn *conn,
|
||||
* ERR_ARG: dns client not initialized or invalid hostname
|
||||
* ERR_VAL: dns server response was invalid
|
||||
*/
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
err_t
|
||||
netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype)
|
||||
#else
|
||||
err_t
|
||||
netconn_gethostbyname(const char *name, ip_addr_t *addr)
|
||||
#endif
|
||||
{
|
||||
struct dns_api_msg msg;
|
||||
err_t err;
|
||||
API_VAR_DECLARE(struct dns_api_msg, msg);
|
||||
#if !LWIP_MPU_COMPATIBLE
|
||||
sys_sem_t sem;
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
err_t err;
|
||||
|
||||
LWIP_ERROR("netconn_gethostbyname: invalid name", (name != NULL), return ERR_ARG;);
|
||||
LWIP_ERROR("netconn_gethostbyname: invalid addr", (addr != NULL), return ERR_ARG;);
|
||||
|
||||
err = sys_sem_new(&sem, 0);
|
||||
if (err != ERR_OK) {
|
||||
return err;
|
||||
#if LWIP_MPU_COMPATIBLE
|
||||
if (strlen(name) >= DNS_MAX_NAME_LENGTH) {
|
||||
return ERR_ARG;
|
||||
}
|
||||
#endif
|
||||
|
||||
msg.name = name;
|
||||
msg.addr = addr;
|
||||
API_VAR_ALLOC(struct dns_api_msg, MEMP_DNS_API_MSG, msg, ERR_MEM);
|
||||
#if LWIP_MPU_COMPATIBLE
|
||||
strncpy(API_VAR_REF(msg).name, name, DNS_MAX_NAME_LENGTH-1);
|
||||
API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH-1] = 0;
|
||||
#else /* LWIP_MPU_COMPATIBLE */
|
||||
msg.err = &err;
|
||||
msg.sem = &sem;
|
||||
API_VAR_REF(msg).addr = API_VAR_REF(addr);
|
||||
API_VAR_REF(msg).name = name;
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
API_VAR_REF(msg).dns_addrtype = dns_addrtype;
|
||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
||||
API_VAR_REF(msg).sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
#else /* LWIP_NETCONN_SEM_PER_THREAD*/
|
||||
err = sys_sem_new(API_EXPR_REF(API_VAR_REF(msg).sem), 0);
|
||||
if (err != ERR_OK) {
|
||||
API_VAR_FREE(MEMP_DNS_API_MSG, msg);
|
||||
return err;
|
||||
}
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
tcpip_callback(do_gethostbyname, &msg);
|
||||
sys_sem_wait(&sem);
|
||||
sys_sem_free(&sem);
|
||||
err = tcpip_callback(lwip_netconn_do_gethostbyname, &API_VAR_REF(msg));
|
||||
if (err != ERR_OK) {
|
||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||
sys_sem_free(API_EXPR_REF(API_VAR_REF(msg).sem));
|
||||
#endif /* !LWIP_NETCONN_SEM_PER_THREAD */
|
||||
API_VAR_FREE(MEMP_DNS_API_MSG, msg);
|
||||
return err;
|
||||
}
|
||||
sys_sem_wait(API_EXPR_REF_SEM(API_VAR_REF(msg).sem));
|
||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||
sys_sem_free(API_EXPR_REF(API_VAR_REF(msg).sem));
|
||||
#endif /* !LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
#if LWIP_MPU_COMPATIBLE
|
||||
*addr = msg->addr;
|
||||
err = msg->err;
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
|
||||
API_VAR_FREE(MEMP_DNS_API_MSG, msg);
|
||||
return err;
|
||||
}
|
||||
#endif /* LWIP_DNS*/
|
||||
|
||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
||||
void
|
||||
netconn_thread_init(void)
|
||||
{
|
||||
sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
if ((sem == NULL) || !sys_sem_valid(sem)) {
|
||||
/* call alloc only once */
|
||||
LWIP_NETCONN_THREAD_SEM_ALLOC();
|
||||
LWIP_ASSERT("LWIP_NETCONN_THREAD_SEM_ALLOC() failed", sys_sem_valid(LWIP_NETCONN_THREAD_SEM_GET()));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
netconn_thread_cleanup(void)
|
||||
{
|
||||
sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
if ((sem != NULL) && sys_sem_valid(sem)) {
|
||||
/* call free only once */
|
||||
LWIP_NETCONN_THREAD_SEM_FREE();
|
||||
}
|
||||
}
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
#endif /* LWIP_NETCONN */
|
||||
|
||||
1056
src/api/api_msg.c
1056
src/api/api_msg.c
File diff suppressed because it is too large
Load Diff
@@ -6,9 +6,9 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@@ -17,21 +17,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
@@ -50,13 +50,14 @@ static const char *err_strerr[] = {
|
||||
"Illegal value.", /* ERR_VAL -6 */
|
||||
"Operation would block.", /* ERR_WOULDBLOCK -7 */
|
||||
"Address in use.", /* ERR_USE -8 */
|
||||
"Already connected.", /* ERR_ISCONN -9 */
|
||||
"Connection aborted.", /* ERR_ABRT -10 */
|
||||
"Connection reset.", /* ERR_RST -11 */
|
||||
"Connection closed.", /* ERR_CLSD -12 */
|
||||
"Not connected.", /* ERR_CONN -13 */
|
||||
"Illegal argument.", /* ERR_ARG -14 */
|
||||
"Low-level netif error.", /* ERR_IF -15 */
|
||||
"Already connecting.", /* ERR_ALREADY -9 */
|
||||
"Already connected.", /* ERR_ISCONN -10 */
|
||||
"Not connected.", /* ERR_CONN -11 */
|
||||
"Low-level netif error.", /* ERR_IF -12 */
|
||||
"Connection aborted.", /* ERR_ABRT -13 */
|
||||
"Connection reset.", /* ERR_RST -14 */
|
||||
"Connection closed.", /* ERR_CLSD -15 */
|
||||
"Illegal argument." /* ERR_ARG -16 */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -69,7 +70,6 @@ const char *
|
||||
lwip_strerr(err_t err)
|
||||
{
|
||||
return err_strerr[-err];
|
||||
|
||||
}
|
||||
|
||||
#endif /* LWIP_DEBUG */
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* Network buffer management
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@@ -17,21 +17,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ netbuf *netbuf_new(void)
|
||||
if (buf != NULL) {
|
||||
buf->p = NULL;
|
||||
buf->ptr = NULL;
|
||||
ipX_addr_set_any(LWIP_IPV6, &buf->addr);
|
||||
ip_addr_set_zero(&buf->addr);
|
||||
buf->port = 0;
|
||||
#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
@@ -69,7 +69,7 @@ netbuf *netbuf_new(void)
|
||||
#endif /* LWIP_CHECKSUM_ON_COPY */
|
||||
buf->toport_chksum = 0;
|
||||
#if LWIP_NETBUF_RECVINFO
|
||||
ipX_addr_set_any(LWIP_IPV6, &buf->toaddr);
|
||||
ip_addr_set_zero(&buf->toaddr);
|
||||
#endif /* LWIP_NETBUF_RECVINFO */
|
||||
#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */
|
||||
return buf;
|
||||
@@ -158,7 +158,7 @@ netbuf_ref(struct netbuf *buf, const void *dataptr, u16_t size)
|
||||
buf->ptr = NULL;
|
||||
return ERR_MEM;
|
||||
}
|
||||
buf->p->payload = (void*)dataptr;
|
||||
((struct pbuf_rom*)buf->p)->payload = dataptr;
|
||||
buf->p->len = buf->p->tot_len = size;
|
||||
buf->ptr = buf->p;
|
||||
return ERR_OK;
|
||||
@@ -186,7 +186,7 @@ netbuf_chain(struct netbuf *head, struct netbuf *tail)
|
||||
* @param buf netbuf to get the data from
|
||||
* @param dataptr pointer to a void pointer where to store the data pointer
|
||||
* @param len pointer to an u16_t where the length of the data is stored
|
||||
* @return ERR_OK if the information was retreived,
|
||||
* @return ERR_OK if the information was retrieved,
|
||||
* ERR_BUF on error.
|
||||
*/
|
||||
err_t
|
||||
|
||||
170
src/api/netdb.c
170
src/api/netdb.c
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@@ -14,21 +14,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
* Author: Simon Goldschmidt
|
||||
*
|
||||
*/
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/** helper struct for gethostbyname_r to access the char* buffer */
|
||||
struct gethostbyname_r_helper {
|
||||
ip_addr_t *addrs;
|
||||
ip_addr_t *addr_list[2];
|
||||
ip_addr_t addr;
|
||||
char *aliases;
|
||||
};
|
||||
@@ -92,6 +92,7 @@ lwip_gethostbyname(const char *name)
|
||||
HOSTENT_STORAGE char *s_aliases;
|
||||
HOSTENT_STORAGE ip_addr_t s_hostent_addr;
|
||||
HOSTENT_STORAGE ip_addr_t *s_phostent_addr[2];
|
||||
HOSTENT_STORAGE char s_hostname[DNS_MAX_NAME_LENGTH + 1];
|
||||
|
||||
/* query host IP address */
|
||||
err = netconn_gethostbyname(name, &addr);
|
||||
@@ -105,7 +106,10 @@ lwip_gethostbyname(const char *name)
|
||||
s_hostent_addr = addr;
|
||||
s_phostent_addr[0] = &s_hostent_addr;
|
||||
s_phostent_addr[1] = NULL;
|
||||
s_hostent.h_name = (char*)name;
|
||||
strncpy(s_hostname, name, DNS_MAX_NAME_LENGTH);
|
||||
s_hostname[DNS_MAX_NAME_LENGTH] = 0;
|
||||
s_hostent.h_name = s_hostname;
|
||||
s_aliases = NULL;
|
||||
s_hostent.h_aliases = &s_aliases;
|
||||
s_hostent.h_addrtype = AF_INET;
|
||||
s_hostent.h_length = sizeof(ip_addr_t);
|
||||
@@ -114,22 +118,16 @@ lwip_gethostbyname(const char *name)
|
||||
#if DNS_DEBUG
|
||||
/* dump hostent */
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_name == %s\n", s_hostent.h_name));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_aliases == %p\n", s_hostent.h_aliases));
|
||||
if (s_hostent.h_aliases != NULL) {
|
||||
u8_t idx;
|
||||
for ( idx=0; s_hostent.h_aliases[idx]; idx++) {
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_aliases[%i]-> == %p\n", idx, s_hostent.h_aliases[idx]));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_aliases[%i]-> == %s\n", idx, s_hostent.h_aliases[idx]));
|
||||
}
|
||||
}
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_aliases == %p\n", (void*)s_hostent.h_aliases));
|
||||
/* h_aliases are always empty */
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addrtype == %d\n", s_hostent.h_addrtype));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_length == %d\n", s_hostent.h_length));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list == %p\n", s_hostent.h_addr_list));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list == %p\n", (void*)s_hostent.h_addr_list));
|
||||
if (s_hostent.h_addr_list != NULL) {
|
||||
u8_t idx;
|
||||
for ( idx=0; s_hostent.h_addr_list[idx]; idx++) {
|
||||
for (idx=0; s_hostent.h_addr_list[idx]; idx++) {
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i] == %p\n", idx, s_hostent.h_addr_list[idx]));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i]-> == %s\n", idx, ip_ntoa((ip_addr_t*)s_hostent.h_addr_list[idx])));
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i]-> == %s\n", idx, ipaddr_ntoa((ip_addr_t*)s_hostent.h_addr_list[idx])));
|
||||
}
|
||||
}
|
||||
#endif /* DNS_DEBUG */
|
||||
@@ -180,7 +178,7 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
||||
}
|
||||
/* first thing to do: set *result to nothing */
|
||||
*result = NULL;
|
||||
if ((name == NULL) || (ret == NULL) || (buf == 0)) {
|
||||
if ((name == NULL) || (ret == NULL) || (buf == NULL)) {
|
||||
/* not all arguments given */
|
||||
*h_errnop = EINVAL;
|
||||
return -1;
|
||||
@@ -197,10 +195,10 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
||||
hostname = ((char*)h) + sizeof(struct gethostbyname_r_helper);
|
||||
|
||||
/* query host IP address */
|
||||
err = netconn_gethostbyname(name, &(h->addr));
|
||||
err = netconn_gethostbyname(name, &h->addr);
|
||||
if (err != ERR_OK) {
|
||||
LWIP_DEBUGF(DNS_DEBUG, ("lwip_gethostbyname(%s) failed, err=%d\n", name, err));
|
||||
*h_errnop = ENSRNOTFOUND;
|
||||
*h_errnop = HOST_NOT_FOUND;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -209,13 +207,14 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
||||
hostname[namelen] = 0;
|
||||
|
||||
/* fill hostent */
|
||||
h->addrs = &(h->addr);
|
||||
h->addr_list[0] = &h->addr;
|
||||
h->addr_list[1] = NULL;
|
||||
h->aliases = NULL;
|
||||
ret->h_name = (char*)hostname;
|
||||
ret->h_aliases = &(h->aliases);
|
||||
ret->h_name = hostname;
|
||||
ret->h_aliases = &h->aliases;
|
||||
ret->h_addrtype = AF_INET;
|
||||
ret->h_length = sizeof(ip_addr_t);
|
||||
ret->h_addr_list = (char**)&(h->addrs);
|
||||
ret->h_addr_list = (char**)&h->addr_list;
|
||||
|
||||
/* set result != NULL */
|
||||
*result = ret;
|
||||
@@ -257,10 +256,12 @@ lwip_freeaddrinfo(struct addrinfo *ai)
|
||||
*
|
||||
* @param nodename descriptive name or address string of the host
|
||||
* (may be NULL -> local address)
|
||||
* @param servname port number as string of NULL
|
||||
* @param servname port number as string of NULL
|
||||
* @param hints structure containing input values that set socktype and protocol
|
||||
* @param res pointer to a pointer where to store the result (set to NULL on failure)
|
||||
* @return 0 on success, non-zero on failure
|
||||
*
|
||||
* @todo: implement AI_V4MAPPED, AI_ADDRCONFIG
|
||||
*/
|
||||
int
|
||||
lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
@@ -269,10 +270,11 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
err_t err;
|
||||
ip_addr_t addr;
|
||||
struct addrinfo *ai;
|
||||
struct sockaddr_in *sa = NULL;
|
||||
struct sockaddr_storage *sa = NULL;
|
||||
int port_nr = 0;
|
||||
size_t total_size;
|
||||
size_t namelen = 0;
|
||||
int ai_family;
|
||||
|
||||
if (res == NULL) {
|
||||
return EAI_FAIL;
|
||||
@@ -282,9 +284,25 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
return EAI_NONAME;
|
||||
}
|
||||
|
||||
if (hints != NULL) {
|
||||
ai_family = hints->ai_family;
|
||||
if ((ai_family != AF_UNSPEC)
|
||||
#if LWIP_IPV4
|
||||
&& (ai_family != AF_INET)
|
||||
#endif /* LWIP_IPV4 */
|
||||
#if LWIP_IPV6
|
||||
&& (ai_family != AF_INET6)
|
||||
#endif /* LWIP_IPV6 */
|
||||
) {
|
||||
return EAI_FAMILY;
|
||||
}
|
||||
} else {
|
||||
ai_family = AF_UNSPEC;
|
||||
}
|
||||
|
||||
if (servname != NULL) {
|
||||
/* service name specified: convert to port number
|
||||
* @todo?: currently, only ASCII integers (port numbers) are supported! */
|
||||
* @todo?: currently, only ASCII integers (port numbers) are supported (AI_NUMERICSERV)! */
|
||||
port_nr = atoi(servname);
|
||||
if ((port_nr <= 0) || (port_nr > 0xffff)) {
|
||||
return EAI_SERVICE;
|
||||
@@ -293,19 +311,49 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
|
||||
if (nodename != NULL) {
|
||||
/* service location specified, try to resolve */
|
||||
err = netconn_gethostbyname(nodename, &addr);
|
||||
if (err != ERR_OK) {
|
||||
return EAI_FAIL;
|
||||
if ((hints != NULL) && (hints->ai_flags & AI_NUMERICHOST)) {
|
||||
/* no DNS lookup, just parse for an address string */
|
||||
if (!ipaddr_aton(nodename, &addr)) {
|
||||
return EAI_NONAME;
|
||||
}
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
if ((IP_IS_V6_VAL(addr) && ai_family == AF_INET) ||
|
||||
(IP_IS_V4_VAL(addr) && ai_family == AF_INET6)) {
|
||||
return EAI_NONAME;
|
||||
}
|
||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
} else {
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
/* AF_UNSPEC: prefer IPv4 */
|
||||
u8_t type = NETCONN_DNS_IPV4_IPV6;
|
||||
if (ai_family == AF_INET) {
|
||||
type = NETCONN_DNS_IPV4;
|
||||
} else if (ai_family == AF_INET6) {
|
||||
type = NETCONN_DNS_IPV6;
|
||||
}
|
||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
err = netconn_gethostbyname_addrtype(nodename, &addr, type);
|
||||
if (err != ERR_OK) {
|
||||
return EAI_FAIL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* service location specified, use loopback address */
|
||||
ip_addr_set_loopback(&addr);
|
||||
if ((hints != NULL) && (hints->ai_flags & AI_PASSIVE)) {
|
||||
ip_addr_set_any(ai_family == AF_INET6, &addr);
|
||||
} else {
|
||||
ip_addr_set_loopback(ai_family == AF_INET6, &addr);
|
||||
}
|
||||
}
|
||||
|
||||
total_size = sizeof(struct addrinfo) + sizeof(struct sockaddr_in);
|
||||
total_size = sizeof(struct addrinfo) + sizeof(struct sockaddr_storage);
|
||||
if (nodename != NULL) {
|
||||
namelen = strlen(nodename);
|
||||
LWIP_ASSERT("namelen is too long", (namelen + 1) <= (mem_size_t)-1);
|
||||
if (namelen > DNS_MAX_NAME_LENGTH) {
|
||||
/* invalid name length */
|
||||
return EAI_FAIL;
|
||||
}
|
||||
LWIP_ASSERT("namelen is too long", total_size + namelen + 1 > total_size);
|
||||
total_size += namelen + 1;
|
||||
}
|
||||
/* If this fails, please report to lwip-devel! :-) */
|
||||
@@ -313,18 +361,33 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
total_size <= NETDB_ELEM_SIZE);
|
||||
ai = (struct addrinfo *)memp_malloc(MEMP_NETDB);
|
||||
if (ai == NULL) {
|
||||
goto memerr;
|
||||
return EAI_MEMORY;
|
||||
}
|
||||
memset(ai, 0, total_size);
|
||||
sa = (struct sockaddr_in*)((u8_t*)ai + sizeof(struct addrinfo));
|
||||
/* set up sockaddr */
|
||||
inet_addr_from_ipaddr(&sa->sin_addr, &addr);
|
||||
sa->sin_family = AF_INET;
|
||||
sa->sin_len = sizeof(struct sockaddr_in);
|
||||
sa->sin_port = htons((u16_t)port_nr);
|
||||
sa = (struct sockaddr_storage *)(void*)((u8_t*)ai + sizeof(struct addrinfo));
|
||||
if (IP_IS_V6_VAL(addr)) {
|
||||
#if LWIP_IPV6
|
||||
struct sockaddr_in6 *sa6 = (struct sockaddr_in6*)sa;
|
||||
/* set up sockaddr */
|
||||
inet6_addr_from_ip6addr(&sa6->sin6_addr, ip_2_ip6(&addr));
|
||||
sa6->sin6_family = AF_INET6;
|
||||
sa6->sin6_len = sizeof(struct sockaddr_in6);
|
||||
sa6->sin6_port = htons((u16_t)port_nr);
|
||||
ai->ai_family = AF_INET6;
|
||||
#endif /* LWIP_IPV6 */
|
||||
} else {
|
||||
#if LWIP_IPV4
|
||||
struct sockaddr_in *sa4 = (struct sockaddr_in*)sa;
|
||||
/* set up sockaddr */
|
||||
inet_addr_from_ipaddr(&sa4->sin_addr, ip_2_ip4(&addr));
|
||||
sa4->sin_family = AF_INET;
|
||||
sa4->sin_len = sizeof(struct sockaddr_in);
|
||||
sa4->sin_port = htons((u16_t)port_nr);
|
||||
ai->ai_family = AF_INET;
|
||||
#endif /* LWIP_IPV4 */
|
||||
}
|
||||
|
||||
/* set up addrinfo */
|
||||
ai->ai_family = AF_INET;
|
||||
if (hints != NULL) {
|
||||
/* copy socktype & protocol from hints if specified */
|
||||
ai->ai_socktype = hints->ai_socktype;
|
||||
@@ -332,21 +395,16 @@ lwip_getaddrinfo(const char *nodename, const char *servname,
|
||||
}
|
||||
if (nodename != NULL) {
|
||||
/* copy nodename to canonname if specified */
|
||||
ai->ai_canonname = ((char*)ai + sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
|
||||
ai->ai_canonname = ((char*)ai + sizeof(struct addrinfo) + sizeof(struct sockaddr_storage));
|
||||
MEMCPY(ai->ai_canonname, nodename, namelen);
|
||||
ai->ai_canonname[namelen] = 0;
|
||||
}
|
||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||
ai->ai_addrlen = sizeof(struct sockaddr_storage);
|
||||
ai->ai_addr = (struct sockaddr*)sa;
|
||||
|
||||
*res = ai;
|
||||
|
||||
return 0;
|
||||
memerr:
|
||||
if (ai != NULL) {
|
||||
memp_free(MEMP_NETDB, ai);
|
||||
}
|
||||
return EAI_MEMORY;
|
||||
}
|
||||
|
||||
#endif /* LWIP_DNS && LWIP_SOCKET */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@@ -14,21 +14,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/opt.h"
|
||||
@@ -36,56 +36,69 @@
|
||||
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/netifapi.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#define NETIFAPI_VAR_REF(name) API_VAR_REF(name)
|
||||
#define NETIFAPI_VAR_DECLARE(name) API_VAR_DECLARE(struct netifapi_msg, name)
|
||||
#define NETIFAPI_VAR_ALLOC(name) API_VAR_ALLOC(struct netifapi_msg, MEMP_NETIFAPI_MSG, name, ERR_MEM)
|
||||
#define NETIFAPI_VAR_FREE(name) API_VAR_FREE(MEMP_NETIFAPI_MSG, name)
|
||||
|
||||
/**
|
||||
* Call netif_add() inside the tcpip_thread context.
|
||||
*/
|
||||
void
|
||||
do_netifapi_netif_add(struct netifapi_msg_msg *msg)
|
||||
static err_t
|
||||
netifapi_do_netif_add(struct tcpip_api_call_data *m)
|
||||
{
|
||||
struct netifapi_msg *msg = (struct netifapi_msg*)m;
|
||||
|
||||
if (!netif_add( msg->netif,
|
||||
msg->msg.add.ipaddr,
|
||||
msg->msg.add.netmask,
|
||||
msg->msg.add.gw,
|
||||
#if LWIP_IPV4
|
||||
API_EXPR_REF(msg->msg.add.ipaddr),
|
||||
API_EXPR_REF(msg->msg.add.netmask),
|
||||
API_EXPR_REF(msg->msg.add.gw),
|
||||
#endif /* LWIP_IPV4 */
|
||||
msg->msg.add.state,
|
||||
msg->msg.add.init,
|
||||
msg->msg.add.input)) {
|
||||
msg->err = ERR_IF;
|
||||
return ERR_IF;
|
||||
} else {
|
||||
msg->err = ERR_OK;
|
||||
return ERR_OK;
|
||||
}
|
||||
TCPIP_NETIFAPI_ACK(msg);
|
||||
}
|
||||
|
||||
#if LWIP_IPV4
|
||||
/**
|
||||
* Call netif_set_addr() inside the tcpip_thread context.
|
||||
*/
|
||||
void
|
||||
do_netifapi_netif_set_addr(struct netifapi_msg_msg *msg)
|
||||
static err_t
|
||||
netifapi_do_netif_set_addr(struct tcpip_api_call_data *m)
|
||||
{
|
||||
struct netifapi_msg *msg = (struct netifapi_msg*)m;
|
||||
|
||||
netif_set_addr( msg->netif,
|
||||
msg->msg.add.ipaddr,
|
||||
msg->msg.add.netmask,
|
||||
msg->msg.add.gw);
|
||||
msg->err = ERR_OK;
|
||||
TCPIP_NETIFAPI_ACK(msg);
|
||||
API_EXPR_REF(msg->msg.add.ipaddr),
|
||||
API_EXPR_REF(msg->msg.add.netmask),
|
||||
API_EXPR_REF(msg->msg.add.gw));
|
||||
return ERR_OK;
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
|
||||
/**
|
||||
* Call the "errtfunc" (or the "voidfunc" if "errtfunc" is NULL) inside the
|
||||
* tcpip_thread context.
|
||||
*/
|
||||
void
|
||||
do_netifapi_netif_common(struct netifapi_msg_msg *msg)
|
||||
static err_t
|
||||
netifapi_do_netif_common(struct tcpip_api_call_data *m)
|
||||
{
|
||||
struct netifapi_msg *msg = (struct netifapi_msg*)m;
|
||||
|
||||
if (msg->msg.common.errtfunc != NULL) {
|
||||
msg->err = msg->msg.common.errtfunc(msg->netif);
|
||||
return msg->msg.common.errtfunc(msg->netif);
|
||||
} else {
|
||||
msg->err = ERR_OK;
|
||||
msg->msg.common.voidfunc(msg->netif);
|
||||
return ERR_OK;
|
||||
}
|
||||
TCPIP_NETIFAPI_ACK(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,26 +109,42 @@ do_netifapi_netif_common(struct netifapi_msg_msg *msg)
|
||||
*/
|
||||
err_t
|
||||
netifapi_netif_add(struct netif *netif,
|
||||
ip_addr_t *ipaddr,
|
||||
ip_addr_t *netmask,
|
||||
ip_addr_t *gw,
|
||||
void *state,
|
||||
netif_init_fn init,
|
||||
netif_input_fn input)
|
||||
#if LWIP_IPV4
|
||||
const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
|
||||
#endif /* LWIP_IPV4 */
|
||||
void *state, netif_init_fn init, netif_input_fn input)
|
||||
{
|
||||
struct netifapi_msg msg;
|
||||
msg.function = do_netifapi_netif_add;
|
||||
msg.msg.netif = netif;
|
||||
msg.msg.msg.add.ipaddr = ipaddr;
|
||||
msg.msg.msg.add.netmask = netmask;
|
||||
msg.msg.msg.add.gw = gw;
|
||||
msg.msg.msg.add.state = state;
|
||||
msg.msg.msg.add.init = init;
|
||||
msg.msg.msg.add.input = input;
|
||||
TCPIP_NETIFAPI(&msg);
|
||||
return msg.msg.err;
|
||||
err_t err;
|
||||
NETIFAPI_VAR_DECLARE(msg);
|
||||
NETIFAPI_VAR_ALLOC(msg);
|
||||
|
||||
#if LWIP_IPV4
|
||||
if (ipaddr == NULL) {
|
||||
ipaddr = IP4_ADDR_ANY;
|
||||
}
|
||||
if (netmask == NULL) {
|
||||
netmask = IP4_ADDR_ANY;
|
||||
}
|
||||
if (gw == NULL) {
|
||||
gw = IP4_ADDR_ANY;
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
|
||||
NETIFAPI_VAR_REF(msg).netif = netif;
|
||||
#if LWIP_IPV4
|
||||
NETIFAPI_VAR_REF(msg).msg.add.ipaddr = NETIFAPI_VAR_REF(ipaddr);
|
||||
NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask);
|
||||
NETIFAPI_VAR_REF(msg).msg.add.gw = NETIFAPI_VAR_REF(gw);
|
||||
#endif /* LWIP_IPV4 */
|
||||
NETIFAPI_VAR_REF(msg).msg.add.state = state;
|
||||
NETIFAPI_VAR_REF(msg).msg.add.init = init;
|
||||
NETIFAPI_VAR_REF(msg).msg.add.input = input;
|
||||
err = tcpip_api_call(netifapi_do_netif_add, &API_VAR_REF(msg).call);
|
||||
NETIFAPI_VAR_FREE(msg);
|
||||
return err;
|
||||
}
|
||||
|
||||
#if LWIP_IPV4
|
||||
/**
|
||||
* Call netif_set_addr() in a thread-safe way by running that function inside the
|
||||
* tcpip_thread context.
|
||||
@@ -124,19 +153,33 @@ netifapi_netif_add(struct netif *netif,
|
||||
*/
|
||||
err_t
|
||||
netifapi_netif_set_addr(struct netif *netif,
|
||||
ip_addr_t *ipaddr,
|
||||
ip_addr_t *netmask,
|
||||
ip_addr_t *gw)
|
||||
const ip4_addr_t *ipaddr,
|
||||
const ip4_addr_t *netmask,
|
||||
const ip4_addr_t *gw)
|
||||
{
|
||||
struct netifapi_msg msg;
|
||||
msg.function = do_netifapi_netif_set_addr;
|
||||
msg.msg.netif = netif;
|
||||
msg.msg.msg.add.ipaddr = ipaddr;
|
||||
msg.msg.msg.add.netmask = netmask;
|
||||
msg.msg.msg.add.gw = gw;
|
||||
TCPIP_NETIFAPI(&msg);
|
||||
return msg.msg.err;
|
||||
err_t err;
|
||||
NETIFAPI_VAR_DECLARE(msg);
|
||||
NETIFAPI_VAR_ALLOC(msg);
|
||||
|
||||
if (ipaddr == NULL) {
|
||||
ipaddr = IP4_ADDR_ANY;
|
||||
}
|
||||
if (netmask == NULL) {
|
||||
netmask = IP4_ADDR_ANY;
|
||||
}
|
||||
if (gw == NULL) {
|
||||
gw = IP4_ADDR_ANY;
|
||||
}
|
||||
|
||||
NETIFAPI_VAR_REF(msg).netif = netif;
|
||||
NETIFAPI_VAR_REF(msg).msg.add.ipaddr = NETIFAPI_VAR_REF(ipaddr);
|
||||
NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask);
|
||||
NETIFAPI_VAR_REF(msg).msg.add.gw = NETIFAPI_VAR_REF(gw);
|
||||
err = tcpip_api_call(netifapi_do_netif_set_addr, &API_VAR_REF(msg).call);
|
||||
NETIFAPI_VAR_FREE(msg);
|
||||
return err;
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
|
||||
/**
|
||||
* call the "errtfunc" (or the "voidfunc" if "errtfunc" is NULL) in a thread-safe
|
||||
@@ -148,13 +191,16 @@ err_t
|
||||
netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
|
||||
netifapi_errt_fn errtfunc)
|
||||
{
|
||||
struct netifapi_msg msg;
|
||||
msg.function = do_netifapi_netif_common;
|
||||
msg.msg.netif = netif;
|
||||
msg.msg.msg.common.voidfunc = voidfunc;
|
||||
msg.msg.msg.common.errtfunc = errtfunc;
|
||||
TCPIP_NETIFAPI(&msg);
|
||||
return msg.msg.err;
|
||||
err_t err;
|
||||
NETIFAPI_VAR_DECLARE(msg);
|
||||
NETIFAPI_VAR_ALLOC(msg);
|
||||
|
||||
NETIFAPI_VAR_REF(msg).netif = netif;
|
||||
NETIFAPI_VAR_REF(msg).msg.common.voidfunc = voidfunc;
|
||||
NETIFAPI_VAR_REF(msg).msg.common.errtfunc = errtfunc;
|
||||
err = tcpip_api_call(netifapi_do_netif_common, &API_VAR_REF(msg).call);
|
||||
NETIFAPI_VAR_FREE(msg);
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif /* LWIP_NETIF_API */
|
||||
|
||||
1970
src/api/sockets.c
1970
src/api/sockets.c
File diff suppressed because it is too large
Load Diff
345
src/api/tcpip.c
345
src/api/tcpip.c
@@ -40,14 +40,19 @@
|
||||
|
||||
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "netif/etharp.h"
|
||||
#include "netif/ppp_oe.h"
|
||||
|
||||
#define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name)
|
||||
#define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name)
|
||||
#define TCPIP_MSG_VAR_ALLOC(name) API_VAR_ALLOC(struct tcpip_msg, MEMP_TCPIP_MSG_API, name, ERR_MEM)
|
||||
#define TCPIP_MSG_VAR_FREE(name) API_VAR_FREE(MEMP_TCPIP_MSG_API, name)
|
||||
|
||||
/* global variables */
|
||||
static tcpip_init_done_fn tcpip_init_done;
|
||||
@@ -87,40 +92,31 @@ tcpip_thread(void *arg)
|
||||
/* wait for a message, timeouts are processed while waiting */
|
||||
sys_timeouts_mbox_fetch(&mbox, (void **)&msg);
|
||||
LOCK_TCPIP_CORE();
|
||||
if (msg == NULL) {
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: invalid message: NULL\n"));
|
||||
LWIP_ASSERT("tcpip_thread: invalid message", 0);
|
||||
continue;
|
||||
}
|
||||
switch (msg->type) {
|
||||
#if LWIP_NETCONN
|
||||
#if !LWIP_TCPIP_CORE_LOCKING
|
||||
case TCPIP_MSG_API:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg));
|
||||
msg->msg.apimsg->function(&(msg->msg.apimsg->msg));
|
||||
msg->msg.api_msg.function(msg->msg.api_msg.msg);
|
||||
break;
|
||||
#endif /* LWIP_NETCONN */
|
||||
case TCPIP_MSG_API_CALL:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API CALL message %p\n", (void *)msg));
|
||||
msg->msg.api_call.arg->err = msg->msg.api_call.function(msg->msg.api_call.arg);
|
||||
sys_sem_signal(msg->msg.api_call.sem);
|
||||
break;
|
||||
#endif /* !LWIP_TCPIP_CORE_LOCKING */
|
||||
|
||||
#if !LWIP_TCPIP_CORE_LOCKING_INPUT
|
||||
case TCPIP_MSG_INPKT:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg));
|
||||
#if LWIP_ETHERNET
|
||||
if (msg->msg.inp.netif->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET)) {
|
||||
ethernet_input(msg->msg.inp.p, msg->msg.inp.netif);
|
||||
} else
|
||||
#endif /* LWIP_ETHERNET */
|
||||
#if LWIP_IPV6
|
||||
if ((*((unsigned char *)(msg->msg.inp.p->payload)) & 0xf0) == 0x60) {
|
||||
ip6_input(msg->msg.inp.p, msg->msg.inp.netif);
|
||||
} else
|
||||
#endif /* LWIP_IPV6 */
|
||||
{
|
||||
ip_input(msg->msg.inp.p, msg->msg.inp.netif);
|
||||
}
|
||||
msg->msg.inp.input_fn(msg->msg.inp.p, msg->msg.inp.netif);
|
||||
memp_free(MEMP_TCPIP_MSG_INPKT, msg);
|
||||
break;
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
|
||||
#if LWIP_NETIF_API
|
||||
case TCPIP_MSG_NETIFAPI:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: Netif API message %p\n", (void *)msg));
|
||||
msg->msg.netifapimsg->function(&(msg->msg.netifapimsg->msg));
|
||||
break;
|
||||
#endif /* LWIP_NETIF_API */
|
||||
#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
|
||||
#if LWIP_TCPIP_TIMEOUT
|
||||
case TCPIP_MSG_TIMEOUT:
|
||||
@@ -157,34 +153,25 @@ tcpip_thread(void *arg)
|
||||
/**
|
||||
* Pass a received packet to tcpip_thread for input processing
|
||||
*
|
||||
* @param p the received packet, p->payload pointing to the Ethernet header or
|
||||
* to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or
|
||||
* NETIF_FLAG_ETHERNET flags)
|
||||
* @param p the received packet
|
||||
* @param inp the network interface on which the packet was received
|
||||
* @param input_fn input function to call
|
||||
*/
|
||||
err_t
|
||||
tcpip_input(struct pbuf *p, struct netif *inp)
|
||||
tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn)
|
||||
{
|
||||
#if LWIP_TCPIP_CORE_LOCKING_INPUT
|
||||
err_t ret;
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_input: PACKET %p/%p\n", (void *)p, (void *)inp));
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_inpkt: PACKET %p/%p\n", (void *)p, (void *)inp));
|
||||
LOCK_TCPIP_CORE();
|
||||
#if LWIP_ETHERNET
|
||||
if (inp->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET)) {
|
||||
ret = ethernet_input(p, inp);
|
||||
} else
|
||||
#endif /* LWIP_ETHERNET */
|
||||
{
|
||||
ret = ip_input(p, inp);
|
||||
}
|
||||
ret = input_fn(p, inp);
|
||||
UNLOCK_TCPIP_CORE();
|
||||
return ret;
|
||||
#else /* LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
struct tcpip_msg *msg;
|
||||
|
||||
if (!sys_mbox_valid(&mbox)) {
|
||||
return ERR_VAL;
|
||||
}
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_INPKT);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
@@ -193,6 +180,7 @@ tcpip_input(struct pbuf *p, struct netif *inp)
|
||||
msg->type = TCPIP_MSG_INPKT;
|
||||
msg->msg.inp.p = p;
|
||||
msg->msg.inp.netif = inp;
|
||||
msg->msg.inp.input_fn = input_fn;
|
||||
if (sys_mbox_trypost(&mbox, msg) != ERR_OK) {
|
||||
memp_free(MEMP_TCPIP_MSG_INPKT, msg);
|
||||
return ERR_MEM;
|
||||
@@ -201,6 +189,26 @@ tcpip_input(struct pbuf *p, struct netif *inp)
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass a received packet to tcpip_thread for input processing with
|
||||
* ethernet_input or ip_input
|
||||
*
|
||||
* @param p the received packet, p->payload pointing to the Ethernet header or
|
||||
* to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or
|
||||
* NETIF_FLAG_ETHERNET flags)
|
||||
* @param inp the network interface on which the packet was received
|
||||
*/
|
||||
err_t
|
||||
tcpip_input(struct pbuf *p, struct netif *inp)
|
||||
{
|
||||
#if LWIP_ETHERNET
|
||||
if (inp->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET)) {
|
||||
return tcpip_inpkt(p, inp, ethernet_input);
|
||||
} else
|
||||
#endif /* LWIP_ETHERNET */
|
||||
return tcpip_inpkt(p, inp, ip_input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call a specific function in the thread context of
|
||||
* tcpip_thread for easy access synchronization.
|
||||
@@ -217,26 +225,25 @@ tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block)
|
||||
{
|
||||
struct tcpip_msg *msg;
|
||||
|
||||
if (sys_mbox_valid(&mbox)) {
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
msg->type = TCPIP_MSG_CALLBACK;
|
||||
msg->msg.cb.function = function;
|
||||
msg->msg.cb.ctx = ctx;
|
||||
if (block) {
|
||||
sys_mbox_post(&mbox, msg);
|
||||
} else {
|
||||
if (sys_mbox_trypost(&mbox, msg) != ERR_OK) {
|
||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
msg->type = TCPIP_MSG_CALLBACK;
|
||||
msg->msg.cb.function = function;
|
||||
msg->msg.cb.ctx = ctx;
|
||||
if (block) {
|
||||
sys_mbox_post(&mbox, msg);
|
||||
} else {
|
||||
if (sys_mbox_trypost(&mbox, msg) != ERR_OK) {
|
||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||
return ERR_MEM;
|
||||
}
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
return ERR_VAL;
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
#if LWIP_TCPIP_TIMEOUT
|
||||
@@ -253,20 +260,19 @@ tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
|
||||
{
|
||||
struct tcpip_msg *msg;
|
||||
|
||||
if (sys_mbox_valid(&mbox)) {
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
msg->type = TCPIP_MSG_TIMEOUT;
|
||||
msg->msg.tmo.msecs = msecs;
|
||||
msg->msg.tmo.h = h;
|
||||
msg->msg.tmo.arg = arg;
|
||||
sys_mbox_post(&mbox, msg);
|
||||
return ERR_OK;
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
return ERR_VAL;
|
||||
|
||||
msg->type = TCPIP_MSG_TIMEOUT;
|
||||
msg->msg.tmo.msecs = msecs;
|
||||
msg->msg.tmo.h = h;
|
||||
msg->msg.tmo.arg = arg;
|
||||
sys_mbox_post(&mbox, msg);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -282,125 +288,112 @@ tcpip_untimeout(sys_timeout_handler h, void *arg)
|
||||
{
|
||||
struct tcpip_msg *msg;
|
||||
|
||||
if (sys_mbox_valid(&mbox)) {
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
msg->type = TCPIP_MSG_UNTIMEOUT;
|
||||
msg->msg.tmo.h = h;
|
||||
msg->msg.tmo.arg = arg;
|
||||
sys_mbox_post(&mbox, msg);
|
||||
return ERR_OK;
|
||||
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
return ERR_VAL;
|
||||
|
||||
msg->type = TCPIP_MSG_UNTIMEOUT;
|
||||
msg->msg.tmo.h = h;
|
||||
msg->msg.tmo.arg = arg;
|
||||
sys_mbox_post(&mbox, msg);
|
||||
return ERR_OK;
|
||||
}
|
||||
#endif /* LWIP_TCPIP_TIMEOUT */
|
||||
|
||||
#if LWIP_NETCONN
|
||||
|
||||
/**
|
||||
* Call the lower part of a netconn_* function
|
||||
* This function is then running in the thread context
|
||||
* of tcpip_thread and has exclusive access to lwIP core code.
|
||||
* Sends a message to TCPIP thread to call a function. Caller thread blocks on
|
||||
* on a provided semaphore, which ist NOT automatically signalled by TCPIP thread,
|
||||
* this has to be done by the user.
|
||||
* It is recommended to use LWIP_TCPIP_CORE_LOCKING since this is the way
|
||||
* with least runtime overhead.
|
||||
*
|
||||
* @param apimsg a struct containing the function to call and its parameters
|
||||
* @param fn function to be called from TCPIP thread
|
||||
* @param apimsg argument to API function
|
||||
* @param sem semaphore to wait on
|
||||
* @return ERR_OK if the function was called, another err_t if not
|
||||
*/
|
||||
err_t
|
||||
tcpip_apimsg(struct api_msg *apimsg)
|
||||
tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem)
|
||||
{
|
||||
struct tcpip_msg msg;
|
||||
#ifdef LWIP_DEBUG
|
||||
/* catch functions that don't set err */
|
||||
apimsg->msg.err = ERR_VAL;
|
||||
#endif
|
||||
|
||||
if (sys_mbox_valid(&mbox)) {
|
||||
msg.type = TCPIP_MSG_API;
|
||||
msg.msg.apimsg = apimsg;
|
||||
sys_mbox_post(&mbox, &msg);
|
||||
sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 0);
|
||||
return apimsg->msg.err;
|
||||
}
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
#if LWIP_TCPIP_CORE_LOCKING
|
||||
/**
|
||||
* Call the lower part of a netconn_* function
|
||||
* This function has exclusive access to lwIP core code by locking it
|
||||
* before the function is called.
|
||||
*
|
||||
* @param apimsg a struct containing the function to call and its parameters
|
||||
* @return ERR_OK (only for compatibility fo tcpip_apimsg())
|
||||
*/
|
||||
err_t
|
||||
tcpip_apimsg_lock(struct api_msg *apimsg)
|
||||
{
|
||||
#ifdef LWIP_DEBUG
|
||||
/* catch functions that don't set err */
|
||||
apimsg->msg.err = ERR_VAL;
|
||||
#endif
|
||||
|
||||
LWIP_UNUSED_ARG(sem);
|
||||
LOCK_TCPIP_CORE();
|
||||
apimsg->function(&(apimsg->msg));
|
||||
fn(apimsg);
|
||||
UNLOCK_TCPIP_CORE();
|
||||
return apimsg->msg.err;
|
||||
return ERR_OK;
|
||||
#else /* LWIP_TCPIP_CORE_LOCKING */
|
||||
TCPIP_MSG_VAR_DECLARE(msg);
|
||||
|
||||
}
|
||||
LWIP_ASSERT("semaphore not initialized", sys_sem_valid(sem));
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
TCPIP_MSG_VAR_ALLOC(msg);
|
||||
TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_msg.function = fn;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_msg.msg = apimsg;
|
||||
sys_mbox_post(&mbox, &TCPIP_MSG_VAR_REF(msg));
|
||||
sys_arch_sem_wait(sem, 0);
|
||||
TCPIP_MSG_VAR_FREE(msg);
|
||||
return ERR_OK;
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
#endif /* LWIP_NETCONN */
|
||||
}
|
||||
|
||||
#if LWIP_NETIF_API
|
||||
#if !LWIP_TCPIP_CORE_LOCKING
|
||||
/**
|
||||
* Much like tcpip_apimsg, but calls the lower part of a netifapi_*
|
||||
* function.
|
||||
*
|
||||
* @param netifapimsg a struct containing the function to call and its parameters
|
||||
* @return error code given back by the function that was called
|
||||
* Synchronously calls function in TCPIP thread and waits for its completion.
|
||||
* It is recommended to use LWIP_TCPIP_CORE_LOCKING (preferred) or
|
||||
* LWIP_NETCONN_SEM_PER_THREAD.
|
||||
* If not, a semaphore is created and destroyed on every call which is usually
|
||||
* an expensive/slow operation.
|
||||
* @param fn Function to call
|
||||
* @param call Call parameters
|
||||
* @return Return value from tcpip_api_call_fn
|
||||
*/
|
||||
err_t
|
||||
tcpip_netifapi(struct netifapi_msg* netifapimsg)
|
||||
tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call)
|
||||
{
|
||||
struct tcpip_msg msg;
|
||||
|
||||
if (sys_mbox_valid(&mbox)) {
|
||||
err_t err = sys_sem_new(&netifapimsg->msg.sem, 0);
|
||||
if (err != ERR_OK) {
|
||||
netifapimsg->msg.err = err;
|
||||
return err;
|
||||
}
|
||||
|
||||
msg.type = TCPIP_MSG_NETIFAPI;
|
||||
msg.msg.netifapimsg = netifapimsg;
|
||||
sys_mbox_post(&mbox, &msg);
|
||||
sys_sem_wait(&netifapimsg->msg.sem);
|
||||
sys_sem_free(&netifapimsg->msg.sem);
|
||||
return netifapimsg->msg.err;
|
||||
}
|
||||
return ERR_VAL;
|
||||
}
|
||||
#else /* !LWIP_TCPIP_CORE_LOCKING */
|
||||
/**
|
||||
* Call the lower part of a netifapi_* function
|
||||
* This function has exclusive access to lwIP core code by locking it
|
||||
* before the function is called.
|
||||
*
|
||||
* @param netifapimsg a struct containing the function to call and its parameters
|
||||
* @return ERR_OK (only for compatibility fo tcpip_netifapi())
|
||||
*/
|
||||
err_t
|
||||
tcpip_netifapi_lock(struct netifapi_msg* netifapimsg)
|
||||
{
|
||||
LOCK_TCPIP_CORE();
|
||||
netifapimsg->function(&(netifapimsg->msg));
|
||||
#if LWIP_TCPIP_CORE_LOCKING
|
||||
err_t err;
|
||||
LOCK_TCPIP_CORE();
|
||||
err = fn(call);
|
||||
UNLOCK_TCPIP_CORE();
|
||||
return netifapimsg->msg.err;
|
||||
return err;
|
||||
#else /* LWIP_TCPIP_CORE_LOCKING */
|
||||
TCPIP_MSG_VAR_DECLARE(msg);
|
||||
err_t err;
|
||||
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
|
||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||
err = sys_sem_new(&call->sem, 0);
|
||||
if (err != ERR_OK) {
|
||||
return err;
|
||||
}
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
TCPIP_MSG_VAR_ALLOC(msg);
|
||||
TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API_CALL;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_call.arg = call;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_call.function = fn;
|
||||
#if LWIP_NETCONN_SEM_PER_THREAD
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_call.sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
#else /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_call.sem = &call->sem;
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
sys_mbox_post(&mbox, &TCPIP_MSG_VAR_REF(msg));
|
||||
sys_arch_sem_wait(TCPIP_MSG_VAR_REF(msg).msg.api_call.sem, 0);
|
||||
TCPIP_MSG_VAR_FREE(msg);
|
||||
|
||||
#if !LWIP_NETCONN_SEM_PER_THREAD
|
||||
sys_sem_free(&call->sem);
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
return call->err;
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
}
|
||||
#endif /* !LWIP_TCPIP_CORE_LOCKING */
|
||||
#endif /* LWIP_NETIF_API */
|
||||
|
||||
/**
|
||||
* Allocate a structure for a static callback message and initialize it.
|
||||
@@ -410,13 +403,14 @@ tcpip_netifapi_lock(struct netifapi_msg* netifapimsg)
|
||||
* @param ctx parameter passed to function
|
||||
* @return a struct pointer to pass to tcpip_trycallback().
|
||||
*/
|
||||
struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx)
|
||||
struct tcpip_callback_msg*
|
||||
tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx)
|
||||
{
|
||||
struct tcpip_msg *msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
msg->type = TCPIP_MSG_CALLBACK;
|
||||
msg->type = TCPIP_MSG_CALLBACK_STATIC;
|
||||
msg->msg.cb.function = function;
|
||||
msg->msg.cb.ctx = ctx;
|
||||
return (struct tcpip_callback_msg*)msg;
|
||||
@@ -427,7 +421,8 @@ struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, voi
|
||||
*
|
||||
* @param msg the message to free
|
||||
*/
|
||||
void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg)
|
||||
void
|
||||
tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg)
|
||||
{
|
||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||
}
|
||||
@@ -442,9 +437,7 @@ void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg)
|
||||
err_t
|
||||
tcpip_trycallback(struct tcpip_callback_msg* msg)
|
||||
{
|
||||
if (!sys_mbox_valid(&mbox)) {
|
||||
return ERR_VAL;
|
||||
}
|
||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||
return sys_mbox_trypost(&mbox, msg);
|
||||
}
|
||||
|
||||
@@ -463,11 +456,11 @@ tcpip_init(tcpip_init_done_fn initfunc, void *arg)
|
||||
|
||||
tcpip_init_done = initfunc;
|
||||
tcpip_init_done_arg = arg;
|
||||
if(sys_mbox_new(&mbox, TCPIP_MBOX_SIZE) != ERR_OK) {
|
||||
if (sys_mbox_new(&mbox, TCPIP_MBOX_SIZE) != ERR_OK) {
|
||||
LWIP_ASSERT("failed to create tcpip_thread mbox", 0);
|
||||
}
|
||||
#if LWIP_TCPIP_CORE_LOCKING
|
||||
if(sys_mutex_new(&lock_tcpip_core) != ERR_OK) {
|
||||
if (sys_mutex_new(&lock_tcpip_core) != ERR_OK) {
|
||||
LWIP_ASSERT("failed to create lock_tcpip_core", 0);
|
||||
}
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
|
||||
179
src/apps/httpd/fs.c
Normal file
179
src/apps/httpd/fs.c
Normal file
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/apps/httpd_opts.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/apps/fs.h"
|
||||
#include "fsdata.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#if HTTPD_USE_CUSTOM_FSDATA
|
||||
#include "fsdata_custom.c"
|
||||
#else /* HTTPD_USE_CUSTOM_FSDATA */
|
||||
#include "fsdata.c"
|
||||
#endif /* HTTPD_USE_CUSTOM_FSDATA */
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
int fs_open_custom(struct fs_file *file, const char *name);
|
||||
void fs_close_custom(struct fs_file *file);
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
u8_t fs_canread_custom(struct fs_file *file);
|
||||
u8_t fs_wait_read_custom(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg);
|
||||
int fs_read_async_custom(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg);
|
||||
#else /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
int fs_read_custom(struct fs_file *file, char *buffer, int count);
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
err_t
|
||||
fs_open(struct fs_file *file, const char *name)
|
||||
{
|
||||
const struct fsdata_file *f;
|
||||
|
||||
if ((file == NULL) || (name == NULL)) {
|
||||
return ERR_ARG;
|
||||
}
|
||||
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (fs_open_custom(file, name)) {
|
||||
file->is_custom_file = 1;
|
||||
return ERR_OK;
|
||||
}
|
||||
file->is_custom_file = 0;
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
|
||||
for (f = FS_ROOT; f != NULL; f = f->next) {
|
||||
if (!strcmp(name, (const char *)f->name)) {
|
||||
file->data = (const char *)f->data;
|
||||
file->len = f->len;
|
||||
file->index = f->len;
|
||||
file->pextension = NULL;
|
||||
file->flags = f->flags;
|
||||
#if HTTPD_PRECALCULATED_CHECKSUM
|
||||
file->chksum_count = f->chksum_count;
|
||||
file->chksum = f->chksum;
|
||||
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
|
||||
#if LWIP_HTTPD_FILE_STATE
|
||||
file->state = fs_state_init(file, name);
|
||||
#endif /* #if LWIP_HTTPD_FILE_STATE */
|
||||
return ERR_OK;
|
||||
}
|
||||
}
|
||||
/* file not found */
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
fs_close(struct fs_file *file)
|
||||
{
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (file->is_custom_file) {
|
||||
fs_close_custom(file);
|
||||
}
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
#if LWIP_HTTPD_FILE_STATE
|
||||
fs_state_free(file, file->state);
|
||||
#endif /* #if LWIP_HTTPD_FILE_STATE */
|
||||
LWIP_UNUSED_ARG(file);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#if LWIP_HTTPD_DYNAMIC_FILE_READ
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
int
|
||||
fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg)
|
||||
#else /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
int
|
||||
fs_read(struct fs_file *file, char *buffer, int count)
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
{
|
||||
int read;
|
||||
if(file->index == file->len) {
|
||||
return FS_READ_EOF;
|
||||
}
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
LWIP_UNUSED_ARG(callback_fn);
|
||||
LWIP_UNUSED_ARG(callback_arg);
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (file->is_custom_file) {
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
return fs_read_async_custom(file, buffer, count, callback_fn, callback_arg);
|
||||
#else /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
return fs_read_custom(file, buffer, count);
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
}
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
|
||||
read = file->len - file->index;
|
||||
if(read > count) {
|
||||
read = count;
|
||||
}
|
||||
|
||||
MEMCPY(buffer, (file->data + file->index), read);
|
||||
file->index += read;
|
||||
|
||||
return(read);
|
||||
}
|
||||
#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
int
|
||||
fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg)
|
||||
{
|
||||
if (file != NULL) {
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (!fs_canread_custom(file)) {
|
||||
if (fs_wait_read_custom(file, callback_fn, callback_arg)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#else /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
LWIP_UNUSED_ARG(callback_fn);
|
||||
LWIP_UNUSED_ARG(callback_arg);
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
int
|
||||
fs_bytes_left(struct fs_file *file)
|
||||
{
|
||||
return file->len - file->index;
|
||||
}
|
||||
21
src/apps/httpd/fs/404.html
Normal file
21
src/apps/httpd/fs/404.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<head><title>lwIP - A Lightweight TCP/IP Stack</title></head>
|
||||
<body bgcolor="white" text="black">
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top"><td width="80">
|
||||
<a href="http://www.sics.se/"><img src="/img/sics.gif"
|
||||
border="0" alt="SICS logo" title="SICS logo"></a>
|
||||
</td><td width="500">
|
||||
<h1>lwIP - A Lightweight TCP/IP Stack</h1>
|
||||
<h2>404 - Page not found</h2>
|
||||
<p>
|
||||
Sorry, the page you are requesting was not found on this
|
||||
server.
|
||||
</p>
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/apps/httpd/fs/img/sics.gif
Normal file
BIN
src/apps/httpd/fs/img/sics.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 724 B |
47
src/apps/httpd/fs/index.html
Normal file
47
src/apps/httpd/fs/index.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head><title>lwIP - A Lightweight TCP/IP Stack</title></head>
|
||||
<body bgcolor="white" text="black">
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top"><td width="80">
|
||||
<a href="http://www.sics.se/"><img src="/img/sics.gif"
|
||||
border="0" alt="SICS logo" title="SICS logo"></a>
|
||||
</td><td width="500">
|
||||
<h1>lwIP - A Lightweight TCP/IP Stack</h1>
|
||||
<p>
|
||||
The web page you are watching was served by a simple web
|
||||
server running on top of the lightweight TCP/IP stack <a
|
||||
href="http://www.sics.se/~adam/lwip/">lwIP</a>.
|
||||
</p>
|
||||
<p>
|
||||
lwIP is an open source implementation of the TCP/IP
|
||||
protocol suite that was originally written by <a
|
||||
href="http://www.sics.se/~adam/lwip/">Adam Dunkels
|
||||
of the Swedish Institute of Computer Science</a> but now is
|
||||
being actively developed by a team of developers
|
||||
distributed world-wide. Since it's release, lwIP has
|
||||
spurred a lot of interest and has been ported to several
|
||||
platforms and operating systems. lwIP can be used either
|
||||
with or without an underlying OS.
|
||||
</p>
|
||||
<p>
|
||||
The focus of the lwIP TCP/IP implementation is to reduce
|
||||
the RAM usage while still having a full scale TCP. This
|
||||
makes lwIP suitable for use in embedded systems with tens
|
||||
of kilobytes of free RAM and room for around 40 kilobytes
|
||||
of code ROM.
|
||||
</p>
|
||||
<p>
|
||||
More information about lwIP can be found at the lwIP
|
||||
homepage at <a
|
||||
href="http://savannah.nongnu.org/projects/lwip/">http://savannah.nongnu.org/projects/lwip/</a>
|
||||
or at the lwIP wiki at <a
|
||||
href="http://lwip.wikia.com/">http://lwip.wikia.com/</a>.
|
||||
</p>
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
298
src/apps/httpd/fsdata.c
Normal file
298
src/apps/httpd/fsdata.c
Normal file
@@ -0,0 +1,298 @@
|
||||
#include "lwip/apps/fs.h"
|
||||
#include "lwip/def.h"
|
||||
#include "fsdata.h"
|
||||
|
||||
|
||||
#define file_NULL (struct fsdata_file *) NULL
|
||||
|
||||
|
||||
static const unsigned int dummy_align__img_sics_gif = 0;
|
||||
static const unsigned char data__img_sics_gif[] = {
|
||||
/* /img/sics.gif (14 chars) */
|
||||
0x2f,0x69,0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x00,0x00,0x00,
|
||||
|
||||
/* HTTP header */
|
||||
/* "HTTP/1.0 200 OK
|
||||
" (17 bytes) */
|
||||
0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
|
||||
0x0a,
|
||||
/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
|
||||
" (63 bytes) */
|
||||
0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
|
||||
0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
|
||||
0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
|
||||
0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
|
||||
/* "Content-type: image/gif
|
||||
|
||||
" (27 bytes) */
|
||||
0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x69,0x6d,
|
||||
0x61,0x67,0x65,0x2f,0x67,0x69,0x66,0x0d,0x0a,0x0d,0x0a,
|
||||
/* raw file data (724 bytes) */
|
||||
0x47,0x49,0x46,0x38,0x39,0x61,0x46,0x00,0x22,0x00,0xa5,0x00,0x00,0xd9,0x2b,0x39,
|
||||
0x6a,0x6a,0x6a,0xbf,0xbf,0xbf,0x93,0x93,0x93,0x0f,0x0f,0x0f,0xb0,0xb0,0xb0,0xa6,
|
||||
0xa6,0xa6,0x80,0x80,0x80,0x76,0x76,0x76,0x1e,0x1e,0x1e,0x9d,0x9d,0x9d,0x2e,0x2e,
|
||||
0x2e,0x49,0x49,0x49,0x54,0x54,0x54,0x8a,0x8a,0x8a,0x60,0x60,0x60,0xc6,0xa6,0x99,
|
||||
0xbd,0xb5,0xb2,0xc2,0xab,0xa1,0xd9,0x41,0x40,0xd5,0x67,0x55,0xc0,0xb0,0xaa,0xd5,
|
||||
0x5e,0x4e,0xd6,0x50,0x45,0xcc,0x93,0x7d,0xc8,0xa1,0x90,0xce,0x8b,0x76,0xd2,0x7b,
|
||||
0x65,0xd1,0x84,0x6d,0xc9,0x99,0x86,0x3a,0x3a,0x3a,0x00,0x00,0x00,0xb8,0xb8,0xb8,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2c,0x00,0x00,
|
||||
0x00,0x00,0x46,0x00,0x22,0x00,0x00,0x06,0xfe,0x40,0x90,0x70,0x48,0x2c,0x1a,0x8f,
|
||||
0xc8,0xa4,0x72,0xc9,0x6c,0x3a,0x9f,0xd0,0xa8,0x74,0x4a,0xad,0x5a,0xaf,0xd8,0xac,
|
||||
0x76,0xa9,0x40,0x04,0xbe,0x83,0xe2,0x60,0x3c,0x50,0x20,0x0d,0x8e,0x6f,0x00,0x31,
|
||||
0x28,0x1c,0x0d,0x07,0xb5,0xc3,0x60,0x75,0x24,0x3e,0xf8,0xfc,0x87,0x11,0x06,0xe9,
|
||||
0x3d,0x46,0x07,0x0b,0x7a,0x7a,0x7c,0x43,0x06,0x1e,0x84,0x78,0x0b,0x07,0x6e,0x51,
|
||||
0x01,0x8a,0x84,0x08,0x7e,0x79,0x80,0x87,0x89,0x91,0x7a,0x93,0x0a,0x04,0x99,0x78,
|
||||
0x96,0x4f,0x03,0x9e,0x79,0x01,0x94,0x9f,0x43,0x9c,0xa3,0xa4,0x05,0x77,0xa3,0xa0,
|
||||
0x4e,0x98,0x79,0x0b,0x1e,0x83,0xa4,0xa6,0x1f,0x96,0x05,0x9d,0xaa,0x78,0x01,0x07,
|
||||
0x84,0x04,0x1e,0x1e,0xbb,0xb8,0x51,0x84,0x0e,0x43,0x05,0x07,0x77,0xa5,0x7f,0x42,
|
||||
0xb1,0xb2,0x01,0x63,0x08,0x0d,0xbb,0x01,0x0c,0x7a,0x0d,0x44,0x0e,0xd8,0xaf,0x4c,
|
||||
0x05,0x7a,0x04,0x47,0x07,0x07,0xb7,0x80,0xa2,0xe1,0x7d,0x44,0x05,0x01,0x04,0x01,
|
||||
0xd0,0xea,0x87,0x93,0x4f,0xe0,0x9a,0x49,0xce,0xd8,0x79,0x04,0x66,0x20,0x15,0x10,
|
||||
0x10,0x11,0x92,0x29,0x80,0xb6,0xc0,0x91,0x15,0x45,0x1e,0x90,0x19,0x71,0x46,0xa8,
|
||||
0x5c,0x04,0x0e,0x00,0x22,0x4e,0xe8,0x40,0x24,0x9f,0x3e,0x04,0x06,0xa7,0x58,0xd4,
|
||||
0x93,0xa0,0x1c,0x91,0x3f,0xe8,0xf0,0x88,0x03,0xb1,0x21,0xa2,0x49,0x00,0x19,0x86,
|
||||
0xfc,0x52,0x44,0xe0,0x01,0x9d,0x29,0x21,0x15,0x25,0x50,0xf7,0x67,0x25,0x1e,0x06,
|
||||
0xfd,0x4e,0x9a,0xb4,0x90,0xac,0x15,0xfa,0xcb,0x52,0x53,0x1e,0x8c,0xf2,0xf8,0x07,
|
||||
0x92,0x2d,0x08,0x3a,0x4d,0x12,0x49,0x95,0x49,0xdb,0x14,0x04,0xc4,0x14,0x85,0x29,
|
||||
0xaa,0xe7,0x01,0x08,0xa4,0x49,0x01,0x14,0x51,0xe0,0x53,0x91,0xd5,0x29,0x06,0x1a,
|
||||
0x64,0x02,0xf4,0xc7,0x81,0x9e,0x05,0x20,0x22,0x64,0xa5,0x30,0xae,0xab,0x9e,0x97,
|
||||
0x53,0xd8,0xb9,0xfd,0x50,0xef,0x93,0x02,0x42,0x74,0x34,0xe8,0x9c,0x20,0x21,0xc9,
|
||||
0x01,0x68,0x78,0xe6,0x55,0x29,0x20,0x56,0x4f,0x4c,0x40,0x51,0x71,0x82,0xc0,0x70,
|
||||
0x21,0x22,0x85,0xbe,0x4b,0x1c,0x44,0x05,0xea,0xa4,0x01,0xbf,0x22,0xb5,0xf0,0x1c,
|
||||
0x06,0x51,0x38,0x8f,0xe0,0x22,0xec,0x18,0xac,0x39,0x22,0xd4,0xd6,0x93,0x44,0x01,
|
||||
0x32,0x82,0xc8,0xfc,0x61,0xb3,0x01,0x45,0x0c,0x2e,0x83,0x30,0xd0,0x0e,0x17,0x24,
|
||||
0x0f,0x70,0x85,0x94,0xee,0x05,0x05,0x53,0x4b,0x32,0x1b,0x3f,0x98,0xd3,0x1d,0x29,
|
||||
0x81,0xb0,0xae,0x1e,0x8c,0x7e,0x68,0xe0,0x60,0x5a,0x54,0x8f,0xb0,0x78,0x69,0x73,
|
||||
0x06,0xa2,0x00,0x6b,0x57,0xca,0x3d,0x11,0x50,0xbd,0x04,0x30,0x4b,0x3a,0xd4,0xab,
|
||||
0x5f,0x1f,0x9b,0x3d,0x13,0x74,0x27,0x88,0x3c,0x25,0xe0,0x17,0xbe,0x7a,0x79,0x45,
|
||||
0x0d,0x0c,0xb0,0x8b,0xda,0x90,0xca,0x80,0x06,0x5d,0x17,0x60,0x1c,0x22,0x4c,0xd8,
|
||||
0x57,0x22,0x06,0x20,0x00,0x98,0x07,0x08,0xe4,0x56,0x80,0x80,0x1c,0xc5,0xb7,0xc5,
|
||||
0x82,0x0c,0x36,0xe8,0xe0,0x83,0x10,0x46,0x28,0xe1,0x84,0x14,0x56,0x68,0xa1,0x10,
|
||||
0x41,0x00,0x00,0x3b,};
|
||||
|
||||
static const unsigned int dummy_align__404_html = 1;
|
||||
static const unsigned char data__404_html[] = {
|
||||
/* /404.html (10 chars) */
|
||||
0x2f,0x34,0x30,0x34,0x2e,0x68,0x74,0x6d,0x6c,0x00,0x00,0x00,
|
||||
|
||||
/* HTTP header */
|
||||
/* "HTTP/1.0 404 File not found
|
||||
" (29 bytes) */
|
||||
0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x34,0x30,0x34,0x20,0x46,0x69,0x6c,
|
||||
0x65,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x0d,0x0a,
|
||||
/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
|
||||
" (63 bytes) */
|
||||
0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
|
||||
0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
|
||||
0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
|
||||
0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
|
||||
/* "Content-type: text/html
|
||||
|
||||
" (27 bytes) */
|
||||
0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
|
||||
0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,
|
||||
/* raw file data (565 bytes) */
|
||||
0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x3c,0x74,
|
||||
0x69,0x74,0x6c,0x65,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,0x69,
|
||||
0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50,
|
||||
0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0x3c,0x2f,
|
||||
0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x62,0x6f,0x64,0x79,0x20,0x62,0x67,0x63,
|
||||
0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x74,0x65,0x78,
|
||||
0x74,0x3d,0x22,0x62,0x6c,0x61,0x63,0x6b,0x22,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x3c,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,
|
||||
0x31,0x30,0x30,0x25,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74,
|
||||
0x72,0x20,0x76,0x61,0x6c,0x69,0x67,0x6e,0x3d,0x22,0x74,0x6f,0x70,0x22,0x3e,0x3c,
|
||||
0x74,0x64,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x30,0x22,0x3e,0x09,0x20,
|
||||
0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,
|
||||
0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73,
|
||||
0x65,0x2f,0x22,0x3e,0x3c,0x69,0x6d,0x67,0x20,0x73,0x72,0x63,0x3d,0x22,0x2f,0x69,
|
||||
0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x22,0x0d,0x0a,0x09,0x20,
|
||||
0x20,0x62,0x6f,0x72,0x64,0x65,0x72,0x3d,0x22,0x30,0x22,0x20,0x61,0x6c,0x74,0x3d,
|
||||
0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x20,0x74,0x69,0x74,0x6c,
|
||||
0x65,0x3d,0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x3e,0x3c,0x2f,
|
||||
0x61,0x3e,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x20,0x77,0x69,
|
||||
0x64,0x74,0x68,0x3d,0x22,0x35,0x30,0x30,0x22,0x3e,0x09,0x20,0x20,0x0d,0x0a,0x09,
|
||||
0x20,0x20,0x3c,0x68,0x31,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,
|
||||
0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,
|
||||
0x50,0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x68,0x31,0x3e,0x0d,0x0a,0x09,0x20,
|
||||
0x20,0x3c,0x68,0x32,0x3e,0x34,0x30,0x34,0x20,0x2d,0x20,0x50,0x61,0x67,0x65,0x20,
|
||||
0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x3c,0x2f,0x68,0x32,0x3e,0x0d,0x0a,
|
||||
0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x53,0x6f,0x72,
|
||||
0x72,0x79,0x2c,0x20,0x74,0x68,0x65,0x20,0x70,0x61,0x67,0x65,0x20,0x79,0x6f,0x75,
|
||||
0x20,0x61,0x72,0x65,0x20,0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x69,0x6e,0x67,0x20,
|
||||
0x77,0x61,0x73,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x20,0x6f,0x6e,
|
||||
0x20,0x74,0x68,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x65,0x72,0x76,
|
||||
0x65,0x72,0x2e,0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,
|
||||
0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x26,0x6e,
|
||||
0x62,0x73,0x70,0x3b,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x2f,0x74,0x72,
|
||||
0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65,
|
||||
0x3e,0x0d,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x74,
|
||||
0x6d,0x6c,0x3e,0x0d,0x0a,};
|
||||
|
||||
static const unsigned int dummy_align__index_html = 2;
|
||||
static const unsigned char data__index_html[] = {
|
||||
/* /index.html (12 chars) */
|
||||
0x2f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x68,0x74,0x6d,0x6c,0x00,
|
||||
|
||||
/* HTTP header */
|
||||
/* "HTTP/1.0 200 OK
|
||||
" (17 bytes) */
|
||||
0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
|
||||
0x0a,
|
||||
/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
|
||||
" (63 bytes) */
|
||||
0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
|
||||
0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
|
||||
0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
|
||||
0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
|
||||
/* "Content-type: text/html
|
||||
|
||||
" (27 bytes) */
|
||||
0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
|
||||
0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,
|
||||
/* raw file data (1751 bytes) */
|
||||
0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x3c,0x74,
|
||||
0x69,0x74,0x6c,0x65,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,0x69,
|
||||
0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50,
|
||||
0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0x3c,0x2f,
|
||||
0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x62,0x6f,0x64,0x79,0x20,0x62,0x67,0x63,
|
||||
0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x74,0x65,0x78,
|
||||
0x74,0x3d,0x22,0x62,0x6c,0x61,0x63,0x6b,0x22,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x3c,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,
|
||||
0x31,0x30,0x30,0x25,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74,
|
||||
0x72,0x20,0x76,0x61,0x6c,0x69,0x67,0x6e,0x3d,0x22,0x74,0x6f,0x70,0x22,0x3e,0x3c,
|
||||
0x74,0x64,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x30,0x22,0x3e,0x09,0x20,
|
||||
0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,
|
||||
0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73,
|
||||
0x65,0x2f,0x22,0x3e,0x3c,0x69,0x6d,0x67,0x20,0x73,0x72,0x63,0x3d,0x22,0x2f,0x69,
|
||||
0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x22,0x0d,0x0a,0x09,0x20,
|
||||
0x20,0x62,0x6f,0x72,0x64,0x65,0x72,0x3d,0x22,0x30,0x22,0x20,0x61,0x6c,0x74,0x3d,
|
||||
0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x20,0x74,0x69,0x74,0x6c,
|
||||
0x65,0x3d,0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x3e,0x3c,0x2f,
|
||||
0x61,0x3e,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x20,0x77,0x69,
|
||||
0x64,0x74,0x68,0x3d,0x22,0x35,0x30,0x30,0x22,0x3e,0x09,0x20,0x20,0x0d,0x0a,0x09,
|
||||
0x20,0x20,0x3c,0x68,0x31,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,
|
||||
0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,
|
||||
0x50,0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x68,0x31,0x3e,0x0d,0x0a,0x09,0x20,
|
||||
0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x54,0x68,0x65,0x20,0x77,
|
||||
0x65,0x62,0x20,0x70,0x61,0x67,0x65,0x20,0x79,0x6f,0x75,0x20,0x61,0x72,0x65,0x20,
|
||||
0x77,0x61,0x74,0x63,0x68,0x69,0x6e,0x67,0x20,0x77,0x61,0x73,0x20,0x73,0x65,0x72,
|
||||
0x76,0x65,0x64,0x20,0x62,0x79,0x20,0x61,0x20,0x73,0x69,0x6d,0x70,0x6c,0x65,0x20,
|
||||
0x77,0x65,0x62,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x65,0x72,0x76,0x65,0x72,
|
||||
0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x20,0x6f,0x6e,0x20,0x74,0x6f,0x70,0x20,
|
||||
0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,
|
||||
0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50,0x20,0x73,0x74,0x61,0x63,0x6b,0x20,
|
||||
0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,
|
||||
0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73,
|
||||
0x65,0x2f,0x7e,0x61,0x64,0x61,0x6d,0x2f,0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x6c,
|
||||
0x77,0x49,0x50,0x3c,0x2f,0x61,0x3e,0x2e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70,
|
||||
0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,
|
||||
0x6c,0x77,0x49,0x50,0x20,0x69,0x73,0x20,0x61,0x6e,0x20,0x6f,0x70,0x65,0x6e,0x20,
|
||||
0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,
|
||||
0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x54,0x43,0x50,
|
||||
0x2f,0x49,0x50,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x74,0x6f,0x63,
|
||||
0x6f,0x6c,0x20,0x73,0x75,0x69,0x74,0x65,0x20,0x74,0x68,0x61,0x74,0x20,0x77,0x61,
|
||||
0x73,0x20,0x6f,0x72,0x69,0x67,0x69,0x6e,0x61,0x6c,0x6c,0x79,0x20,0x77,0x72,0x69,
|
||||
0x74,0x74,0x65,0x6e,0x20,0x62,0x79,0x20,0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20,
|
||||
0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,
|
||||
0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73,0x65,0x2f,0x7e,0x61,0x64,0x61,0x6d,0x2f,
|
||||
0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x41,0x64,0x61,0x6d,0x20,0x44,0x75,0x6e,0x6b,
|
||||
0x65,0x6c,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,
|
||||
0x20,0x53,0x77,0x65,0x64,0x69,0x73,0x68,0x20,0x49,0x6e,0x73,0x74,0x69,0x74,0x75,
|
||||
0x74,0x65,0x20,0x6f,0x66,0x20,0x43,0x6f,0x6d,0x70,0x75,0x74,0x65,0x72,0x20,0x53,
|
||||
0x63,0x69,0x65,0x6e,0x63,0x65,0x3c,0x2f,0x61,0x3e,0x20,0x62,0x75,0x74,0x20,0x6e,
|
||||
0x6f,0x77,0x20,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x62,0x65,0x69,0x6e,
|
||||
0x67,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x6c,0x79,0x20,0x64,0x65,0x76,0x65,0x6c,
|
||||
0x6f,0x70,0x65,0x64,0x20,0x62,0x79,0x20,0x61,0x20,0x74,0x65,0x61,0x6d,0x20,0x6f,
|
||||
0x66,0x20,0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x65,0x72,0x73,0x0d,0x0a,0x09,0x20,
|
||||
0x20,0x20,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x64,0x20,0x77,
|
||||
0x6f,0x72,0x6c,0x64,0x2d,0x77,0x69,0x64,0x65,0x2e,0x20,0x53,0x69,0x6e,0x63,0x65,
|
||||
0x20,0x69,0x74,0x27,0x73,0x20,0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x2c,0x20,0x6c,
|
||||
0x77,0x49,0x50,0x20,0x68,0x61,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x70,
|
||||
0x75,0x72,0x72,0x65,0x64,0x20,0x61,0x20,0x6c,0x6f,0x74,0x20,0x6f,0x66,0x20,0x69,
|
||||
0x6e,0x74,0x65,0x72,0x65,0x73,0x74,0x20,0x61,0x6e,0x64,0x20,0x68,0x61,0x73,0x20,
|
||||
0x62,0x65,0x65,0x6e,0x20,0x70,0x6f,0x72,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x73,
|
||||
0x65,0x76,0x65,0x72,0x61,0x6c,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x70,0x6c,0x61,
|
||||
0x74,0x66,0x6f,0x72,0x6d,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x70,0x65,0x72,0x61,
|
||||
0x74,0x69,0x6e,0x67,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,0x73,0x2e,0x20,0x6c,0x77,
|
||||
0x49,0x50,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x65,
|
||||
0x69,0x74,0x68,0x65,0x72,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x77,0x69,0x74,0x68,
|
||||
0x20,0x6f,0x72,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x61,0x6e,0x20,0x75,
|
||||
0x6e,0x64,0x65,0x72,0x6c,0x79,0x69,0x6e,0x67,0x20,0x4f,0x53,0x2e,0x0d,0x0a,0x09,
|
||||
0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a,
|
||||
0x09,0x20,0x20,0x20,0x20,0x54,0x68,0x65,0x20,0x66,0x6f,0x63,0x75,0x73,0x20,0x6f,
|
||||
0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x20,0x54,0x43,0x50,0x2f,0x49,
|
||||
0x50,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x20,0x69,0x73,0x20,0x74,0x6f,0x20,0x72,0x65,0x64,0x75,0x63,0x65,0x0d,0x0a,0x09,
|
||||
0x20,0x20,0x20,0x20,0x74,0x68,0x65,0x20,0x52,0x41,0x4d,0x20,0x75,0x73,0x61,0x67,
|
||||
0x65,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x73,0x74,0x69,0x6c,0x6c,0x20,0x68,0x61,
|
||||
0x76,0x69,0x6e,0x67,0x20,0x61,0x20,0x66,0x75,0x6c,0x6c,0x20,0x73,0x63,0x61,0x6c,
|
||||
0x65,0x20,0x54,0x43,0x50,0x2e,0x20,0x54,0x68,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20,
|
||||
0x20,0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x6c,0x77,0x49,0x50,0x20,0x73,0x75,0x69,
|
||||
0x74,0x61,0x62,0x6c,0x65,0x20,0x66,0x6f,0x72,0x20,0x75,0x73,0x65,0x20,0x69,0x6e,
|
||||
0x20,0x65,0x6d,0x62,0x65,0x64,0x64,0x65,0x64,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,
|
||||
0x73,0x20,0x77,0x69,0x74,0x68,0x20,0x74,0x65,0x6e,0x73,0x0d,0x0a,0x09,0x20,0x20,
|
||||
0x20,0x20,0x6f,0x66,0x20,0x6b,0x69,0x6c,0x6f,0x62,0x79,0x74,0x65,0x73,0x20,0x6f,
|
||||
0x66,0x20,0x66,0x72,0x65,0x65,0x20,0x52,0x41,0x4d,0x20,0x61,0x6e,0x64,0x20,0x72,
|
||||
0x6f,0x6f,0x6d,0x20,0x66,0x6f,0x72,0x20,0x61,0x72,0x6f,0x75,0x6e,0x64,0x20,0x34,
|
||||
0x30,0x20,0x6b,0x69,0x6c,0x6f,0x62,0x79,0x74,0x65,0x73,0x0d,0x0a,0x09,0x20,0x20,
|
||||
0x20,0x20,0x6f,0x66,0x20,0x63,0x6f,0x64,0x65,0x20,0x52,0x4f,0x4d,0x2e,0x0d,0x0a,
|
||||
0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,
|
||||
0x0a,0x09,0x20,0x20,0x20,0x20,0x4d,0x6f,0x72,0x65,0x20,0x69,0x6e,0x66,0x6f,0x72,
|
||||
0x6d,0x61,0x74,0x69,0x6f,0x6e,0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x6c,0x77,0x49,
|
||||
0x50,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x66,0x6f,0x75,0x6e,0x64,0x20,0x61,
|
||||
0x74,0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x0d,0x0a,0x09,0x20,0x20,0x20,
|
||||
0x20,0x68,0x6f,0x6d,0x65,0x70,0x61,0x67,0x65,0x20,0x61,0x74,0x20,0x3c,0x61,0x0d,
|
||||
0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,0x74,0x74,0x70,
|
||||
0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,
|
||||
0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,
|
||||
0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,
|
||||
0x76,0x61,0x6e,0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,
|
||||
0x67,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x2f,
|
||||
0x3c,0x2f,0x61,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x6f,0x72,0x20,0x61,0x74,
|
||||
0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x20,0x77,0x69,0x6b,0x69,0x20,0x61,
|
||||
0x74,0x20,0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d,
|
||||
0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6c,0x77,0x69,0x70,0x2e,0x77,0x69,0x6b,
|
||||
0x69,0x61,0x2e,0x63,0x6f,0x6d,0x2f,0x22,0x3e,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,
|
||||
0x6c,0x77,0x69,0x70,0x2e,0x77,0x69,0x6b,0x69,0x61,0x2e,0x63,0x6f,0x6d,0x2f,0x3c,
|
||||
0x2f,0x61,0x3e,0x2e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,
|
||||
0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x26,0x6e,
|
||||
0x62,0x73,0x70,0x3b,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x2f,0x74,0x72,
|
||||
0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65,
|
||||
0x3e,0x0d,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x74,
|
||||
0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,};
|
||||
|
||||
|
||||
|
||||
const struct fsdata_file file__img_sics_gif[] = { {
|
||||
file_NULL,
|
||||
data__img_sics_gif,
|
||||
data__img_sics_gif + 16,
|
||||
sizeof(data__img_sics_gif) - 16,
|
||||
1,
|
||||
}};
|
||||
|
||||
const struct fsdata_file file__404_html[] = { {
|
||||
file__img_sics_gif,
|
||||
data__404_html,
|
||||
data__404_html + 12,
|
||||
sizeof(data__404_html) - 12,
|
||||
1,
|
||||
}};
|
||||
|
||||
const struct fsdata_file file__index_html[] = { {
|
||||
file__404_html,
|
||||
data__index_html,
|
||||
data__index_html + 12,
|
||||
sizeof(data__index_html) - 12,
|
||||
1,
|
||||
}};
|
||||
|
||||
#define FS_ROOT file__index_html
|
||||
#define FS_NUMFILES 3
|
||||
|
||||
50
src/apps/httpd/fsdata.h
Normal file
50
src/apps/httpd/fsdata.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef LWIP_FSDATA_H
|
||||
#define LWIP_FSDATA_H
|
||||
|
||||
#include "lwip/apps/httpd_opts.h"
|
||||
#include "lwip/apps/fs.h"
|
||||
|
||||
struct fsdata_file {
|
||||
const struct fsdata_file *next;
|
||||
const unsigned char *name;
|
||||
const unsigned char *data;
|
||||
int len;
|
||||
u8_t flags;
|
||||
#if HTTPD_PRECALCULATED_CHECKSUM
|
||||
u16_t chksum_count;
|
||||
const struct fsdata_chksum *chksum;
|
||||
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
|
||||
};
|
||||
|
||||
#endif /* LWIP_FSDATA_H */
|
||||
2679
src/apps/httpd/httpd.c
Normal file
2679
src/apps/httpd/httpd.c
Normal file
File diff suppressed because it is too large
Load Diff
114
src/apps/httpd/httpd_structs.h
Normal file
114
src/apps/httpd/httpd_structs.h
Normal file
@@ -0,0 +1,114 @@
|
||||
#ifndef LWIP_HTTPD_STRUCTS_H
|
||||
#define LWIP_HTTPD_STRUCTS_H
|
||||
|
||||
#include "lwip/apps/httpd.h"
|
||||
|
||||
#if LWIP_HTTPD_DYNAMIC_HEADERS
|
||||
/** This struct is used for a list of HTTP header strings for various
|
||||
* filename extensions. */
|
||||
typedef struct
|
||||
{
|
||||
const char *extension;
|
||||
const char *content_type;
|
||||
} tHTTPHeader;
|
||||
|
||||
/** A list of strings used in HTTP headers (see RFC 1945 HTTP/1.0 and
|
||||
* RFC 2616 HTTP/1.1 for header field definitions) */
|
||||
static const char * const g_psHTTPHeaderStrings[] =
|
||||
{
|
||||
"HTTP/1.0 200 OK\r\n",
|
||||
"HTTP/1.0 404 File not found\r\n",
|
||||
"HTTP/1.0 400 Bad Request\r\n",
|
||||
"HTTP/1.0 501 Not Implemented\r\n",
|
||||
"HTTP/1.1 200 OK\r\n",
|
||||
"HTTP/1.1 404 File not found\r\n",
|
||||
"HTTP/1.1 400 Bad Request\r\n",
|
||||
"HTTP/1.1 501 Not Implemented\r\n",
|
||||
"Content-Length: ",
|
||||
"Connection: Close\r\n",
|
||||
"Connection: keep-alive\r\n",
|
||||
"Connection: keep-alive\r\nContent-Length: ",
|
||||
"Server: "HTTPD_SERVER_AGENT"\r\n",
|
||||
"\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
|
||||
#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE
|
||||
,"Connection: keep-alive\r\nContent-Length: 77\r\n\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Indexes into the g_psHTTPHeaderStrings array */
|
||||
#define HTTP_HDR_OK 0 /* 200 OK */
|
||||
#define HTTP_HDR_NOT_FOUND 1 /* 404 File not found */
|
||||
#define HTTP_HDR_BAD_REQUEST 2 /* 400 Bad request */
|
||||
#define HTTP_HDR_NOT_IMPL 3 /* 501 Not Implemented */
|
||||
#define HTTP_HDR_OK_11 4 /* 200 OK */
|
||||
#define HTTP_HDR_NOT_FOUND_11 5 /* 404 File not found */
|
||||
#define HTTP_HDR_BAD_REQUEST_11 6 /* 400 Bad request */
|
||||
#define HTTP_HDR_NOT_IMPL_11 7 /* 501 Not Implemented */
|
||||
#define HTTP_HDR_CONTENT_LENGTH 8 /* Content-Length: (HTTP 1.0)*/
|
||||
#define HTTP_HDR_CONN_CLOSE 9 /* Connection: Close (HTTP 1.1) */
|
||||
#define HTTP_HDR_CONN_KEEPALIVE 10 /* Connection: keep-alive (HTTP 1.1) */
|
||||
#define HTTP_HDR_KEEPALIVE_LEN 11 /* Connection: keep-alive + Content-Length: (HTTP 1.1)*/
|
||||
#define HTTP_HDR_SERVER 12 /* Server: HTTPD_SERVER_AGENT */
|
||||
#define DEFAULT_404_HTML 13 /* default 404 body */
|
||||
#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE
|
||||
#define DEFAULT_404_HTML_PERSISTENT 14 /* default 404 body, but including Connection: keep-alive */
|
||||
#endif
|
||||
|
||||
|
||||
#define HTTP_HDR_HTML "Content-type: text/html\r\n\r\n"
|
||||
#define HTTP_HDR_SSI "Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n\r\n"
|
||||
#define HTTP_HDR_GIF "Content-type: image/gif\r\n\r\n"
|
||||
#define HTTP_HDR_PNG "Content-type: image/png\r\n\r\n"
|
||||
#define HTTP_HDR_JPG "Content-type: image/jpeg\r\n\r\n"
|
||||
#define HTTP_HDR_BMP "Content-type: image/bmp\r\n\r\n"
|
||||
#define HTTP_HDR_ICO "Content-type: image/x-icon\r\n\r\n"
|
||||
#define HTTP_HDR_APP "Content-type: application/octet-stream\r\n\r\n"
|
||||
#define HTTP_HDR_JS "Content-type: application/javascript\r\n\r\n"
|
||||
#define HTTP_HDR_RA "Content-type: application/javascript\r\n\r\n"
|
||||
#define HTTP_HDR_CSS "Content-type: text/css\r\n\r\n"
|
||||
#define HTTP_HDR_SWF "Content-type: application/x-shockwave-flash\r\n\r\n"
|
||||
#define HTTP_HDR_XML "Content-type: text/xml\r\n\r\n"
|
||||
#define HTTP_HDR_PDF "Content-type: application/pdf\r\n\r\n"
|
||||
#define HTTP_HDR_JSON "Content-type: application/json\r\n\r\n"
|
||||
|
||||
#define HTTP_HDR_DEFAULT_TYPE "Content-type: text/plain\r\n\r\n"
|
||||
|
||||
/** A list of extension-to-HTTP header strings (see outdated RFC 1700 MEDIA TYPES
|
||||
* and http://www.iana.org/assignments/media-types for registered content types
|
||||
* and subtypes) */
|
||||
static const tHTTPHeader g_psHTTPHeaders[] =
|
||||
{
|
||||
{ "html", HTTP_HDR_HTML},
|
||||
{ "htm", HTTP_HDR_HTML},
|
||||
{ "shtml",HTTP_HDR_SSI},
|
||||
{ "shtm", HTTP_HDR_SSI},
|
||||
{ "ssi", HTTP_HDR_SSI},
|
||||
{ "gif", HTTP_HDR_GIF},
|
||||
{ "png", HTTP_HDR_PNG},
|
||||
{ "jpg", HTTP_HDR_JPG},
|
||||
{ "bmp", HTTP_HDR_BMP},
|
||||
{ "ico", HTTP_HDR_ICO},
|
||||
{ "class",HTTP_HDR_APP},
|
||||
{ "cls", HTTP_HDR_APP},
|
||||
{ "js", HTTP_HDR_JS},
|
||||
{ "ram", HTTP_HDR_RA},
|
||||
{ "css", HTTP_HDR_CSS},
|
||||
{ "swf", HTTP_HDR_SWF},
|
||||
{ "xml", HTTP_HDR_XML},
|
||||
{ "xsl", HTTP_HDR_XML},
|
||||
{ "pdf", HTTP_HDR_PDF},
|
||||
{ "json", HTTP_HDR_JSON}
|
||||
};
|
||||
|
||||
#define NUM_HTTP_HEADERS (sizeof(g_psHTTPHeaders) / sizeof(tHTTPHeader))
|
||||
|
||||
#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */
|
||||
|
||||
#if LWIP_HTTPD_SSI
|
||||
static const char * const g_pcSSIExtensions[] = {
|
||||
".shtml", ".shtm", ".ssi", ".xml"
|
||||
};
|
||||
#define NUM_SHTML_EXTENSIONS (sizeof(g_pcSSIExtensions) / sizeof(const char *))
|
||||
#endif /* LWIP_HTTPD_SSI */
|
||||
|
||||
#endif /* LWIP_HTTPD_STRUCTS_H */
|
||||
97
src/apps/httpd/makefsdata/makefsdata
Normal file
97
src/apps/httpd/makefsdata/makefsdata
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
open(OUTPUT, "> fsdata.c");
|
||||
|
||||
chdir("fs");
|
||||
open(FILES, "find . -type f |");
|
||||
|
||||
while($file = <FILES>) {
|
||||
|
||||
# Do not include files in CVS directories nor backup files.
|
||||
if($file =~ /(CVS|~)/) {
|
||||
next;
|
||||
}
|
||||
|
||||
chop($file);
|
||||
|
||||
open(HEADER, "> /tmp/header") || die $!;
|
||||
if($file =~ /404/) {
|
||||
print(HEADER "HTTP/1.0 404 File not found\r\n");
|
||||
} else {
|
||||
print(HEADER "HTTP/1.0 200 OK\r\n");
|
||||
}
|
||||
print(HEADER "Server: lwIP/pre-0.6 (http://www.sics.se/~adam/lwip/)\r\n");
|
||||
if($file =~ /\.html$/) {
|
||||
print(HEADER "Content-type: text/html\r\n");
|
||||
} elsif($file =~ /\.gif$/) {
|
||||
print(HEADER "Content-type: image/gif\r\n");
|
||||
} elsif($file =~ /\.png$/) {
|
||||
print(HEADER "Content-type: image/png\r\n");
|
||||
} elsif($file =~ /\.jpg$/) {
|
||||
print(HEADER "Content-type: image/jpeg\r\n");
|
||||
} elsif($file =~ /\.class$/) {
|
||||
print(HEADER "Content-type: application/octet-stream\r\n");
|
||||
} elsif($file =~ /\.ram$/) {
|
||||
print(HEADER "Content-type: audio/x-pn-realaudio\r\n");
|
||||
} else {
|
||||
print(HEADER "Content-type: text/plain\r\n");
|
||||
}
|
||||
print(HEADER "\r\n");
|
||||
close(HEADER);
|
||||
|
||||
unless($file =~ /\.plain$/ || $file =~ /cgi/) {
|
||||
system("cat /tmp/header $file > /tmp/file");
|
||||
} else {
|
||||
system("cp $file /tmp/file");
|
||||
}
|
||||
|
||||
open(FILE, "/tmp/file");
|
||||
unlink("/tmp/file");
|
||||
unlink("/tmp/header");
|
||||
|
||||
$file =~ s/\.//;
|
||||
$fvar = $file;
|
||||
$fvar =~ s-/-_-g;
|
||||
$fvar =~ s-\.-_-g;
|
||||
print(OUTPUT "static const unsigned char data".$fvar."[] = {\n");
|
||||
print(OUTPUT "\t/* $file */\n\t");
|
||||
for($j = 0; $j < length($file); $j++) {
|
||||
printf(OUTPUT "%#02x, ", unpack("C", substr($file, $j, 1)));
|
||||
}
|
||||
printf(OUTPUT "0,\n");
|
||||
|
||||
|
||||
$i = 0;
|
||||
while(read(FILE, $data, 1)) {
|
||||
if($i == 0) {
|
||||
print(OUTPUT "\t");
|
||||
}
|
||||
printf(OUTPUT "%#02x, ", unpack("C", $data));
|
||||
$i++;
|
||||
if($i == 10) {
|
||||
print(OUTPUT "\n");
|
||||
$i = 0;
|
||||
}
|
||||
}
|
||||
print(OUTPUT "};\n\n");
|
||||
close(FILE);
|
||||
push(@fvars, $fvar);
|
||||
push(@files, $file);
|
||||
}
|
||||
|
||||
for($i = 0; $i < @fvars; $i++) {
|
||||
$file = $files[$i];
|
||||
$fvar = $fvars[$i];
|
||||
|
||||
if($i == 0) {
|
||||
$prevfile = "NULL";
|
||||
} else {
|
||||
$prevfile = "file" . $fvars[$i - 1];
|
||||
}
|
||||
print(OUTPUT "const struct fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, ");
|
||||
print(OUTPUT "data$fvar + ". (length($file) + 1) .", ");
|
||||
print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n");
|
||||
}
|
||||
|
||||
print(OUTPUT "#define FS_ROOT file$fvars[$i - 1]\n\n");
|
||||
print(OUTPUT "#define FS_NUMFILES $i\n");
|
||||
1031
src/apps/httpd/makefsdata/makefsdata.c
Normal file
1031
src/apps/httpd/makefsdata/makefsdata.c
Normal file
File diff suppressed because it is too large
Load Diff
13
src/apps/httpd/makefsdata/readme.txt
Normal file
13
src/apps/httpd/makefsdata/readme.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
This directory contains a script ('makefsdata') to create C code suitable for
|
||||
httpd for given html pages (or other files) in a directory.
|
||||
|
||||
There is also a plain C console application doing the same and extended a bit.
|
||||
|
||||
Usage: htmlgen [targetdir] [-s] [-i]s
|
||||
targetdir: relative or absolute path to files to convert
|
||||
switch -s: toggle processing of subdirectories (default is on)
|
||||
switch -e: exclude HTTP header from file (header is created at runtime, default is on)
|
||||
switch -11: include HTTP 1.1 header (1.0 is default)
|
||||
|
||||
if targetdir not specified, makefsdata will attempt to
|
||||
process files in subdirectory 'fs'.
|
||||
650
src/apps/lwiperf/lwiperf.c
Normal file
650
src/apps/lwiperf/lwiperf.c
Normal file
@@ -0,0 +1,650 @@
|
||||
/**
|
||||
* @file
|
||||
* LWIP iperf server implementation
|
||||
*
|
||||
* This is simple "Iperf" server to check your bandwith using Iperf on a PC as client.
|
||||
* It is currently a minimal implementation providing an IPv4 TCP server only.
|
||||
*
|
||||
* @todo:
|
||||
* - implement UDP mode
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014 Simon Goldschmidt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Simon Goldschmidt
|
||||
*/
|
||||
|
||||
#include "lwip/apps/lwiperf.h"
|
||||
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Currently, only TCP-over-IPv4 is implemented (does iperf support IPv6 anyway?) */
|
||||
#if LWIP_IPV4 && LWIP_TCP
|
||||
|
||||
/** Specify the idle timeout (in seconds) after that the test fails */
|
||||
#ifndef LWIPERF_TCP_MAX_IDLE_SEC
|
||||
#define LWIPERF_TCP_MAX_IDLE_SEC 10U
|
||||
#endif
|
||||
#if LWIPERF_TCP_MAX_IDLE_SEC > 255
|
||||
#error LWIPERF_TCP_MAX_IDLE_SEC must fit into an u8_t
|
||||
#endif
|
||||
|
||||
/* File internal memory allocation (struct lwiperf_*): this defaults to
|
||||
the heap */
|
||||
#ifndef LWIPERF_ALLOC
|
||||
#define LWIPERF_ALLOC(type) mem_malloc(sizeof(type))
|
||||
#define LWIPERF_FREE(type, item) mem_free(item)
|
||||
#endif
|
||||
|
||||
/** If this is 1, check that received data has the correct format */
|
||||
#ifndef LWIPERF_CHECK_RX_DATA
|
||||
#define LWIPERF_CHECK_RX_DATA 0
|
||||
#endif
|
||||
|
||||
/** This is the Iperf settings struct sent from the client */
|
||||
typedef struct _lwiperf_settings {
|
||||
#define LWIPERF_FLAGS_ANSWER_TEST 0x80000000
|
||||
#define LWIPERF_FLAGS_ANSWER_NOW 0x00000001
|
||||
u32_t flags;
|
||||
u32_t num_threads; /* unused for now */
|
||||
u32_t remote_port;
|
||||
u32_t buffer_len; /* unused for now */
|
||||
u32_t win_band; /* TCP window / UDP rate: unused for now */
|
||||
u32_t amount; /* pos. value: bytes?; neg. values: time (unit is 10ms: 1/100 second) */
|
||||
} lwiperf_settings_t;
|
||||
|
||||
/** Basic connection handle */
|
||||
struct _lwiperf_state_base;
|
||||
typedef struct _lwiperf_state_base lwiperf_state_base_t;
|
||||
struct _lwiperf_state_base {
|
||||
/* 1=tcp, 0=udp */
|
||||
u8_t tcp;
|
||||
/* 1=server, 0=client */
|
||||
u8_t server;
|
||||
lwiperf_state_base_t* next;
|
||||
lwiperf_state_base_t* related_server_state;
|
||||
};
|
||||
|
||||
/** Connection handle for a TCP iperf session */
|
||||
typedef struct _lwiperf_state_tcp {
|
||||
lwiperf_state_base_t base;
|
||||
struct tcp_pcb* server_pcb;
|
||||
struct tcp_pcb* conn_pcb;
|
||||
u32_t time_started;
|
||||
lwiperf_report_fn report_fn;
|
||||
void* report_arg;
|
||||
u8_t poll_count;
|
||||
u8_t next_num;
|
||||
u32_t bytes_transferred;
|
||||
lwiperf_settings_t settings;
|
||||
u8_t have_settings_buf;
|
||||
} lwiperf_state_tcp_t;
|
||||
|
||||
/** List of active iperf sessions */
|
||||
static lwiperf_state_base_t* lwiperf_all_connections;
|
||||
/** A const buffer to send from: we want to measure sending, not copying! */
|
||||
static const u8_t lwiperf_txbuf_const[1600] = {
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
|
||||
};
|
||||
|
||||
static err_t lwiperf_tcp_poll(void *arg, struct tcp_pcb *tpcb);
|
||||
static void lwiperf_tcp_err(void *arg, err_t err);
|
||||
|
||||
/** Add an iperf session to the 'active' list */
|
||||
static void
|
||||
lwiperf_list_add(lwiperf_state_base_t* item)
|
||||
{
|
||||
if (lwiperf_all_connections == NULL) {
|
||||
lwiperf_all_connections = item;
|
||||
} else {
|
||||
item = lwiperf_all_connections;
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove an iperf session from the 'active' list */
|
||||
static void
|
||||
lwiperf_list_remove(lwiperf_state_base_t* item)
|
||||
{
|
||||
lwiperf_state_base_t* prev = NULL;
|
||||
lwiperf_state_base_t* iter;
|
||||
for (iter = lwiperf_all_connections; iter != NULL; prev = iter, iter = iter->next) {
|
||||
if (iter == item) {
|
||||
if (prev == NULL) {
|
||||
lwiperf_all_connections = iter->next;
|
||||
} else {
|
||||
prev->next = item;
|
||||
}
|
||||
/* @debug: ensure this item is listed only once */
|
||||
for (iter = iter->next; iter != NULL; iter = iter->next) {
|
||||
LWIP_ASSERT("duplicate entry", iter != item);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Call the report function of an iperf tcp session */
|
||||
static void
|
||||
lwip_tcp_conn_report(lwiperf_state_tcp_t* conn, enum lwiperf_report_type report_type)
|
||||
{
|
||||
if ((conn != NULL) && (conn->report_fn != NULL)) {
|
||||
u32_t now, duration_ms, bandwidth_kbitpsec;
|
||||
now = sys_now();
|
||||
duration_ms = now - conn->time_started;
|
||||
if (duration_ms == 0) {
|
||||
bandwidth_kbitpsec = 0;
|
||||
} else {
|
||||
bandwidth_kbitpsec = (conn->bytes_transferred / duration_ms) * 8U;
|
||||
}
|
||||
conn->report_fn(conn->report_arg, report_type,
|
||||
&conn->conn_pcb->local_ip, conn->conn_pcb->local_port,
|
||||
&conn->conn_pcb->remote_ip, conn->conn_pcb->remote_port,
|
||||
conn->bytes_transferred, duration_ms, bandwidth_kbitpsec);
|
||||
}
|
||||
}
|
||||
|
||||
/** Close an iperf tcp session */
|
||||
static void
|
||||
lwiperf_tcp_close(lwiperf_state_tcp_t* conn, enum lwiperf_report_type report_type)
|
||||
{
|
||||
err_t err;
|
||||
|
||||
lwip_tcp_conn_report(conn, report_type);
|
||||
lwiperf_list_remove(&conn->base);
|
||||
if (conn->conn_pcb != NULL) {
|
||||
tcp_arg(conn->conn_pcb, NULL);
|
||||
tcp_poll(conn->conn_pcb, NULL, 0);
|
||||
tcp_sent(conn->conn_pcb, NULL);
|
||||
tcp_recv(conn->conn_pcb, NULL);
|
||||
tcp_err(conn->conn_pcb, NULL);
|
||||
err = tcp_close(conn->conn_pcb);
|
||||
if (err != ERR_OK) {
|
||||
/* don't want to wait for free memory here... */
|
||||
tcp_abort(conn->conn_pcb);
|
||||
}
|
||||
} else {
|
||||
/* no conn pcb, this is the server pcb */
|
||||
err = tcp_close(conn->server_pcb);
|
||||
LWIP_ASSERT("error", err != ERR_OK);
|
||||
}
|
||||
LWIPERF_FREE(lwiperf_state_tcp_t, conn);
|
||||
}
|
||||
|
||||
/** Try to send more data on an iperf tcp session */
|
||||
static err_t
|
||||
lwiperf_tcp_client_send_more(lwiperf_state_tcp_t* conn)
|
||||
{
|
||||
int send_more;
|
||||
err_t err;
|
||||
u16_t txlen;
|
||||
u16_t txlen_max;
|
||||
void* txptr;
|
||||
u8_t apiflags;
|
||||
|
||||
LWIP_ASSERT("conn invalid", (conn != NULL) && conn->base.tcp && (conn->base.server == 0));
|
||||
|
||||
do {
|
||||
send_more = 0;
|
||||
if (conn->settings.amount & PP_HTONL(0x80000000)) {
|
||||
/* this session is time-limited */
|
||||
u32_t now = sys_now();
|
||||
u32_t diff_ms = now - conn->time_started;
|
||||
u32_t time = (u32_t)-(s32_t)htonl(conn->settings.amount);
|
||||
u32_t time_ms = time * 10;
|
||||
if (diff_ms >= time_ms) {
|
||||
/* time specified by the client is over -> close the connection */
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_CLIENT);
|
||||
return ERR_OK;
|
||||
}
|
||||
} else {
|
||||
/* this session is byte-limited */
|
||||
u32_t amount_bytes = htonl(conn->settings.amount);
|
||||
/* @todo: this can send up to 1*MSS more than requested... */
|
||||
if (amount_bytes >= conn->bytes_transferred) {
|
||||
/* all requested bytes transferred -> close the connection */
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_CLIENT);
|
||||
return ERR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if (conn->bytes_transferred < 24) {
|
||||
/* transmit the settings a first time */
|
||||
txptr = &((u8_t*)&conn->settings)[conn->bytes_transferred];
|
||||
txlen_max = (u16_t)(24 - conn->bytes_transferred);
|
||||
apiflags = TCP_WRITE_FLAG_COPY;
|
||||
} else if (conn->bytes_transferred < 48) {
|
||||
/* transmit the settings a second time */
|
||||
txptr = &((u8_t*)&conn->settings)[conn->bytes_transferred - 24];
|
||||
txlen_max = (u16_t)(48 - conn->bytes_transferred);
|
||||
apiflags = TCP_WRITE_FLAG_COPY | TCP_WRITE_FLAG_MORE;
|
||||
send_more = 1;
|
||||
} else {
|
||||
/* transmit data */
|
||||
/* @todo: every x bytes, transmit the settings again */
|
||||
txptr = (void*)(size_t)&lwiperf_txbuf_const[conn->bytes_transferred % 10];
|
||||
txlen_max = TCP_MSS;
|
||||
if (conn->bytes_transferred == 48) { /* @todo: fix this for intermediate settings, too */
|
||||
txlen_max = TCP_MSS - 24;
|
||||
}
|
||||
apiflags = 0; /* no copying needed */
|
||||
send_more = 1;
|
||||
}
|
||||
txlen = txlen_max;
|
||||
do {
|
||||
err = tcp_write(conn->conn_pcb, txptr, txlen, apiflags);
|
||||
if (err == ERR_MEM) {
|
||||
txlen /= 2;
|
||||
}
|
||||
} while ((err == ERR_MEM) && (txlen >= (TCP_MSS/2)));
|
||||
|
||||
if (err == ERR_OK) {
|
||||
conn->bytes_transferred += txlen;
|
||||
} else {
|
||||
send_more = 0;
|
||||
}
|
||||
} while(send_more);
|
||||
|
||||
tcp_output(conn->conn_pcb);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/** TCP sent callback, try to send more data */
|
||||
static err_t
|
||||
lwiperf_tcp_client_sent(void *arg, struct tcp_pcb *tpcb, u16_t len)
|
||||
{
|
||||
lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg;
|
||||
/* @todo: check 'len' (e.g. to time ACK of all data)? for now, we just send more... */
|
||||
LWIP_ASSERT("invalid conn", conn->conn_pcb == tpcb);
|
||||
LWIP_UNUSED_ARG(tpcb);
|
||||
LWIP_UNUSED_ARG(len);
|
||||
|
||||
conn->poll_count = 0;
|
||||
|
||||
return lwiperf_tcp_client_send_more(conn);
|
||||
}
|
||||
|
||||
/** TCP connected callback (active connection), send data now */
|
||||
static err_t
|
||||
lwiperf_tcp_client_connected(void *arg, struct tcp_pcb *tpcb, err_t err)
|
||||
{
|
||||
lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg;
|
||||
LWIP_ASSERT("invalid conn", conn->conn_pcb == tpcb);
|
||||
LWIP_UNUSED_ARG(tpcb);
|
||||
if (err != ERR_OK) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE);
|
||||
return ERR_OK;
|
||||
}
|
||||
conn->poll_count = 0;
|
||||
conn->time_started = sys_now();
|
||||
return lwiperf_tcp_client_send_more(conn);
|
||||
}
|
||||
|
||||
/** Start TCP connection back to the client (either parallel or after the
|
||||
* receive test has finished.
|
||||
*/
|
||||
static err_t
|
||||
lwiperf_tx_start(lwiperf_state_tcp_t* conn)
|
||||
{
|
||||
err_t err;
|
||||
lwiperf_state_tcp_t* client_conn;
|
||||
struct tcp_pcb* newpcb;
|
||||
ip_addr_t remote_addr;
|
||||
u16_t remote_port;
|
||||
|
||||
client_conn = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t);
|
||||
if (client_conn == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
newpcb = tcp_new();
|
||||
if (newpcb == NULL) {
|
||||
LWIPERF_FREE(lwiperf_state_tcp_t, client_conn);
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
memcpy(client_conn, conn, sizeof(lwiperf_state_tcp_t));
|
||||
client_conn->base.server = 0;
|
||||
client_conn->server_pcb = NULL;
|
||||
client_conn->conn_pcb = newpcb;
|
||||
client_conn->time_started = sys_now(); /* TODO: set this again on 'connected' */
|
||||
client_conn->poll_count = 0;
|
||||
client_conn->next_num = 4; /* initial nr is '4' since the header has 24 byte */
|
||||
client_conn->bytes_transferred = 0;
|
||||
client_conn->settings.flags = 0; /* prevent the remote side starting back as client again */
|
||||
|
||||
tcp_arg(newpcb, client_conn);
|
||||
tcp_sent(newpcb, lwiperf_tcp_client_sent);
|
||||
tcp_poll(newpcb, lwiperf_tcp_poll, 2U);
|
||||
tcp_err(newpcb, lwiperf_tcp_err);
|
||||
|
||||
ip_addr_copy(remote_addr, conn->conn_pcb->remote_ip);
|
||||
remote_port = (u16_t)htonl(client_conn->settings.remote_port);
|
||||
|
||||
err = tcp_connect(newpcb, &remote_addr, remote_port, lwiperf_tcp_client_connected);
|
||||
if (err != ERR_OK) {
|
||||
lwiperf_tcp_close(client_conn, LWIPERF_TCP_ABORTED_LOCAL);
|
||||
return err;
|
||||
}
|
||||
lwiperf_list_add(&client_conn->base);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/** Receive data on an iperf tcp session */
|
||||
static err_t
|
||||
lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
|
||||
{
|
||||
u16_t tot_len;
|
||||
u32_t packet_idx;
|
||||
struct pbuf* q;
|
||||
lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg;
|
||||
|
||||
LWIP_ASSERT("pcb mismatch", conn->conn_pcb == tpcb);
|
||||
LWIP_UNUSED_ARG(tpcb);
|
||||
|
||||
if (err != ERR_OK) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE);
|
||||
return ERR_OK;
|
||||
}
|
||||
if (p == NULL) {
|
||||
/* connection closed -> test done */
|
||||
if ((conn->settings.flags & PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) ==
|
||||
PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST)) {
|
||||
/* client requested transmission after end of test */
|
||||
lwiperf_tx_start(conn);
|
||||
}
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_SERVER);
|
||||
return ERR_OK;
|
||||
}
|
||||
tot_len = p->tot_len;
|
||||
|
||||
conn->poll_count = 0;
|
||||
|
||||
if ((!conn->have_settings_buf) || ((conn->bytes_transferred -24) % (1024*128) == 0)) {
|
||||
/* wait for 24-byte header */
|
||||
if (p->tot_len < sizeof(lwiperf_settings_t)) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR);
|
||||
pbuf_free(p);
|
||||
return ERR_VAL;
|
||||
}
|
||||
if (!conn->have_settings_buf) {
|
||||
if (pbuf_copy_partial(p, &conn->settings, sizeof(lwiperf_settings_t), 0) != sizeof(lwiperf_settings_t)) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL);
|
||||
pbuf_free(p);
|
||||
return ERR_VAL;
|
||||
}
|
||||
conn->have_settings_buf = 1;
|
||||
if ((conn->settings.flags & PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) ==
|
||||
PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) {
|
||||
/* client requested parallel transmission test */
|
||||
err_t err2 = lwiperf_tx_start(conn);
|
||||
if (err2 != ERR_OK) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_TXERROR);
|
||||
pbuf_free(p);
|
||||
return err2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (pbuf_memcmp(p, 0, &conn->settings, sizeof(lwiperf_settings_t)) != 0) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR);
|
||||
pbuf_free(p);
|
||||
return ERR_VAL;
|
||||
}
|
||||
}
|
||||
conn->bytes_transferred += sizeof(lwiperf_settings_t);
|
||||
if(conn->bytes_transferred <= 24) {
|
||||
conn->time_started = sys_now();
|
||||
tcp_recved(tpcb, p->tot_len);
|
||||
pbuf_free(p);
|
||||
return ERR_OK;
|
||||
}
|
||||
conn->next_num = 4; /* 24 bytes received... */
|
||||
err = pbuf_header(p, -24);
|
||||
LWIP_ASSERT("pbuf_header failed", err == ERR_OK);
|
||||
}
|
||||
|
||||
packet_idx = 0;
|
||||
for (q = p; q != NULL; q = q->next) {
|
||||
#if LWIPERF_CHECK_RX_DATA
|
||||
const u8_t* payload = (const u8_t*)q->payload;
|
||||
u16_t i;
|
||||
for (i = 0; i < q->len; i++) {
|
||||
u8_t val = payload[i];
|
||||
u8_t num = val - '0';
|
||||
if (num == conn->next_num) {
|
||||
conn->next_num++;
|
||||
if (conn->next_num == 10) {
|
||||
conn->next_num = 0;
|
||||
}
|
||||
} else {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR);
|
||||
pbuf_free(p);
|
||||
return ERR_VAL;
|
||||
}
|
||||
}
|
||||
packet_idx += i;
|
||||
#else
|
||||
packet_idx += q->len;
|
||||
#endif
|
||||
}
|
||||
LWIP_ASSERT("count mismatch", packet_idx == p->tot_len);
|
||||
conn->bytes_transferred += packet_idx;
|
||||
tcp_recved(tpcb, tot_len);
|
||||
pbuf_free(p);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/** Error callback, iperf tcp session aborted */
|
||||
static void
|
||||
lwiperf_tcp_err(void *arg, err_t err)
|
||||
{
|
||||
lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg;
|
||||
LWIP_UNUSED_ARG(err);
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE);
|
||||
}
|
||||
|
||||
/** TCP poll callback, try to send more data */
|
||||
static err_t
|
||||
lwiperf_tcp_poll(void *arg, struct tcp_pcb *tpcb)
|
||||
{
|
||||
lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg;
|
||||
LWIP_ASSERT("pcb mismatch", conn->conn_pcb == tpcb);
|
||||
LWIP_UNUSED_ARG(tpcb);
|
||||
if (++conn->poll_count >= LWIPERF_TCP_MAX_IDLE_SEC) {
|
||||
lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL);
|
||||
return ERR_OK; /* lwiperf_tcp_close frees conn */
|
||||
}
|
||||
|
||||
if (!conn->base.server) {
|
||||
lwiperf_tcp_client_send_more(conn);
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/** This is called when a new client connects for an iperf tcp session */
|
||||
static err_t
|
||||
lwiperf_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err)
|
||||
{
|
||||
lwiperf_state_tcp_t *s, *conn;
|
||||
if ((err != ERR_OK) || (newpcb == NULL) || (arg == NULL)) {
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
s = (lwiperf_state_tcp_t*)arg;
|
||||
conn = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t);
|
||||
if (conn == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
memset(conn, 0, sizeof(lwiperf_state_tcp_t));
|
||||
conn->base.tcp = 1;
|
||||
conn->base.server = 1;
|
||||
conn->base.related_server_state = &s->base;
|
||||
conn->server_pcb = s->server_pcb;
|
||||
conn->conn_pcb = newpcb;
|
||||
conn->time_started = sys_now();
|
||||
conn->report_fn = s->report_fn;
|
||||
conn->report_arg = s->report_arg;
|
||||
|
||||
/* setup the tcp rx connection */
|
||||
tcp_arg(newpcb, conn);
|
||||
tcp_recv(newpcb, lwiperf_tcp_recv);
|
||||
tcp_poll(newpcb, lwiperf_tcp_poll, 2U);
|
||||
tcp_err(conn->conn_pcb, lwiperf_tcp_err);
|
||||
|
||||
lwiperf_list_add(&conn->base);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/** Start a TCP iperf server on the default TCP port (5001) and listen for
|
||||
* incoming connections from iperf clients.
|
||||
*
|
||||
* @returns a connection handle that can be used to abort the server
|
||||
* by calling @ref lwiperf_abort()
|
||||
*/
|
||||
void*
|
||||
lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg)
|
||||
{
|
||||
return lwiperf_start_tcp_server(IP_ADDR_ANY, LWIPERF_TCP_PORT_DEFAULT,
|
||||
report_fn, report_arg);
|
||||
}
|
||||
|
||||
/** Start a TCP iperf server on a specific IP address and port and listen for
|
||||
* incoming connections from iperf clients.
|
||||
*
|
||||
* @returns a connection handle that can be used to abort the server
|
||||
* by calling @ref lwiperf_abort()
|
||||
*/
|
||||
void*
|
||||
lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port,
|
||||
lwiperf_report_fn report_fn, void* report_arg)
|
||||
{
|
||||
err_t err;
|
||||
struct tcp_pcb* pcb;
|
||||
lwiperf_state_tcp_t* s;
|
||||
|
||||
if(local_addr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t);
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
memset(s, 0, sizeof(lwiperf_state_tcp_t));
|
||||
s->base.tcp = 1;
|
||||
s->base.server = 1;
|
||||
s->report_fn = report_fn;
|
||||
s->report_arg = report_arg;
|
||||
|
||||
pcb = tcp_new();
|
||||
if (pcb != NULL) {
|
||||
err = tcp_bind(pcb, local_addr, local_port);
|
||||
if (err == ERR_OK) {
|
||||
s->server_pcb = tcp_listen_with_backlog(pcb, 1);
|
||||
}
|
||||
}
|
||||
if (s->server_pcb == NULL) {
|
||||
if (pcb != NULL) {
|
||||
tcp_close(pcb);
|
||||
}
|
||||
LWIPERF_FREE(lwiperf_state_tcp_t, s);
|
||||
return NULL;
|
||||
}
|
||||
pcb = NULL;
|
||||
|
||||
tcp_arg(s->server_pcb, s);
|
||||
tcp_accept(s->server_pcb, lwiperf_tcp_accept);
|
||||
|
||||
lwiperf_list_add(&s->base);
|
||||
return s;
|
||||
}
|
||||
|
||||
/** Abort an iperf session (handle returned by lwiperf_start_tcp_server*()) */
|
||||
void
|
||||
lwiperf_abort(void* lwiperf_session)
|
||||
{
|
||||
lwiperf_state_base_t* i, *dealloc, *last = NULL;
|
||||
|
||||
for (i = lwiperf_all_connections; i != NULL; ) {
|
||||
if ((i == lwiperf_session) || (i->related_server_state == lwiperf_session)) {
|
||||
dealloc = i;
|
||||
i = i->next;
|
||||
if (last != NULL) {
|
||||
last->next = i;
|
||||
}
|
||||
LWIPERF_FREE(lwiperf_state_tcp_t, dealloc); /* TODO: type? */
|
||||
} else {
|
||||
last = i;
|
||||
i = i->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LWIP_IPV4 && LWIP_TCP */
|
||||
350
src/apps/netbiosns/netbiosns.c
Normal file
350
src/apps/netbiosns/netbiosns.c
Normal file
@@ -0,0 +1,350 @@
|
||||
/**
|
||||
* @file
|
||||
* NetBIOS name service responder
|
||||
*
|
||||
* This is an example implementation of a NetBIOS name server.
|
||||
* It responds to name queries for a configurable name.
|
||||
* Name resolving is not supported.
|
||||
*
|
||||
* Note that the device doesn't broadcast it's own name so can't
|
||||
* detect duplicate names!
|
||||
*/
|
||||
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/apps/netbiosns.h"
|
||||
|
||||
#if LWIP_IPV4 && LWIP_UDP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/** default port number for "NetBIOS Name service */
|
||||
#define NETBIOS_PORT 137
|
||||
|
||||
/** size of a NetBIOS name */
|
||||
#define NETBIOS_NAME_LEN 16
|
||||
|
||||
/** The Time-To-Live for NetBIOS name responds (in seconds)
|
||||
* Default is 300000 seconds (3 days, 11 hours, 20 minutes) */
|
||||
#define NETBIOS_NAME_TTL 300000u
|
||||
|
||||
/** NetBIOS header flags */
|
||||
#define NETB_HFLAG_RESPONSE 0x8000U
|
||||
#define NETB_HFLAG_OPCODE 0x7800U
|
||||
#define NETB_HFLAG_OPCODE_NAME_QUERY 0x0000U
|
||||
#define NETB_HFLAG_AUTHORATIVE 0x0400U
|
||||
#define NETB_HFLAG_TRUNCATED 0x0200U
|
||||
#define NETB_HFLAG_RECURS_DESIRED 0x0100U
|
||||
#define NETB_HFLAG_RECURS_AVAILABLE 0x0080U
|
||||
#define NETB_HFLAG_BROADCAST 0x0010U
|
||||
#define NETB_HFLAG_REPLYCODE 0x0008U
|
||||
#define NETB_HFLAG_REPLYCODE_NOERROR 0x0000U
|
||||
|
||||
/** NetBIOS name flags */
|
||||
#define NETB_NFLAG_UNIQUE 0x8000U
|
||||
#define NETB_NFLAG_NODETYPE 0x6000U
|
||||
#define NETB_NFLAG_NODETYPE_HNODE 0x6000U
|
||||
#define NETB_NFLAG_NODETYPE_MNODE 0x4000U
|
||||
#define NETB_NFLAG_NODETYPE_PNODE 0x2000U
|
||||
#define NETB_NFLAG_NODETYPE_BNODE 0x0000U
|
||||
|
||||
/** NetBIOS message header */
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct netbios_hdr {
|
||||
PACK_STRUCT_FIELD(u16_t trans_id);
|
||||
PACK_STRUCT_FIELD(u16_t flags);
|
||||
PACK_STRUCT_FIELD(u16_t questions);
|
||||
PACK_STRUCT_FIELD(u16_t answerRRs);
|
||||
PACK_STRUCT_FIELD(u16_t authorityRRs);
|
||||
PACK_STRUCT_FIELD(u16_t additionalRRs);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/** NetBIOS message name part */
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct netbios_name_hdr {
|
||||
PACK_STRUCT_FLD_8(u8_t nametype);
|
||||
PACK_STRUCT_FLD_8(u8_t encname[(NETBIOS_NAME_LEN*2)+1]);
|
||||
PACK_STRUCT_FIELD(u16_t type);
|
||||
PACK_STRUCT_FIELD(u16_t cls);
|
||||
PACK_STRUCT_FIELD(u32_t ttl);
|
||||
PACK_STRUCT_FIELD(u16_t datalen);
|
||||
PACK_STRUCT_FIELD(u16_t flags);
|
||||
PACK_STRUCT_FLD_S(ip4_addr_p_t addr);
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
/** NetBIOS message */
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/bpstruct.h"
|
||||
#endif
|
||||
PACK_STRUCT_BEGIN
|
||||
struct netbios_resp
|
||||
{
|
||||
struct netbios_hdr resp_hdr;
|
||||
struct netbios_name_hdr resp_name;
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
# include "arch/epstruct.h"
|
||||
#endif
|
||||
|
||||
#ifdef NETBIOS_LWIP_NAME
|
||||
#define NETBIOS_LOCAL_NAME NETBIOS_LWIP_NAME
|
||||
#else
|
||||
static char netbiosns_local_name[NETBIOS_NAME_LEN];
|
||||
#define NETBIOS_LOCAL_NAME netbiosns_local_name
|
||||
#endif
|
||||
|
||||
struct udp_pcb *netbiosns_pcb;
|
||||
|
||||
/** Decode a NetBIOS name (from packet to string) */
|
||||
static int
|
||||
netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len)
|
||||
{
|
||||
char *pname;
|
||||
char cname;
|
||||
char cnbname;
|
||||
int idx = 0;
|
||||
|
||||
LWIP_UNUSED_ARG(name_dec_len);
|
||||
|
||||
/* Start decoding netbios name. */
|
||||
pname = name_enc;
|
||||
for (;;) {
|
||||
/* Every two characters of the first level-encoded name
|
||||
* turn into one character in the decoded name. */
|
||||
cname = *pname;
|
||||
if (cname == '\0')
|
||||
break; /* no more characters */
|
||||
if (cname == '.')
|
||||
break; /* scope ID follows */
|
||||
if (cname < 'A' || cname > 'Z') {
|
||||
/* Not legal. */
|
||||
return -1;
|
||||
}
|
||||
cname -= 'A';
|
||||
cnbname = cname << 4;
|
||||
pname++;
|
||||
|
||||
cname = *pname;
|
||||
if (cname == '\0' || cname == '.') {
|
||||
/* No more characters in the name - but we're in
|
||||
* the middle of a pair. Not legal. */
|
||||
return -1;
|
||||
}
|
||||
if (cname < 'A' || cname > 'Z') {
|
||||
/* Not legal. */
|
||||
return -1;
|
||||
}
|
||||
cname -= 'A';
|
||||
cnbname |= cname;
|
||||
pname++;
|
||||
|
||||
/* Do we have room to store the character? */
|
||||
if (idx < NETBIOS_NAME_LEN) {
|
||||
/* Yes - store the character. */
|
||||
name_dec[idx++] = (cnbname!=' '?cnbname:'\0');
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0 /* function currently unused */
|
||||
/** Encode a NetBIOS name (from string to packet) - currently unused because
|
||||
we don't ask for names. */
|
||||
static int
|
||||
netbiosns_name_encode(char *name_enc, char *name_dec, int name_dec_len)
|
||||
{
|
||||
char *pname;
|
||||
char cname;
|
||||
unsigned char ucname;
|
||||
int idx = 0;
|
||||
|
||||
/* Start encoding netbios name. */
|
||||
pname = name_enc;
|
||||
|
||||
for (;;) {
|
||||
/* Every two characters of the first level-encoded name
|
||||
* turn into one character in the decoded name. */
|
||||
cname = *pname;
|
||||
if (cname == '\0')
|
||||
break; /* no more characters */
|
||||
if (cname == '.')
|
||||
break; /* scope ID follows */
|
||||
if ((cname < 'A' || cname > 'Z') && (cname < '0' || cname > '9')) {
|
||||
/* Not legal. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Do we have room to store the character? */
|
||||
if (idx >= name_dec_len) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Yes - store the character. */
|
||||
ucname = cname;
|
||||
name_dec[idx++] = ('A'+((ucname>>4) & 0x0F));
|
||||
name_dec[idx++] = ('A'+( ucname & 0x0F));
|
||||
pname++;
|
||||
}
|
||||
|
||||
/* Fill with "space" coding */
|
||||
for (;idx < name_dec_len - 1;) {
|
||||
name_dec[idx++] = 'C';
|
||||
name_dec[idx++] = 'A';
|
||||
}
|
||||
|
||||
/* Terminate string */
|
||||
name_dec[idx] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
/** NetBIOS Name service recv callback */
|
||||
static void
|
||||
netbiosns_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
|
||||
{
|
||||
LWIP_UNUSED_ARG(arg);
|
||||
|
||||
/* if packet is valid */
|
||||
if (p != NULL) {
|
||||
char netbios_name[NETBIOS_NAME_LEN+1];
|
||||
struct netbios_hdr* netbios_hdr = (struct netbios_hdr*)p->payload;
|
||||
struct netbios_name_hdr* netbios_name_hdr = (struct netbios_name_hdr*)(netbios_hdr+1);
|
||||
|
||||
/* we only answer if we got a default interface */
|
||||
if (netif_default != NULL) {
|
||||
/* @todo: do we need to check answerRRs/authorityRRs/additionalRRs? */
|
||||
/* if the packet is a NetBIOS name query question */
|
||||
if (((netbios_hdr->flags & PP_NTOHS(NETB_HFLAG_OPCODE)) == PP_NTOHS(NETB_HFLAG_OPCODE_NAME_QUERY)) &&
|
||||
((netbios_hdr->flags & PP_NTOHS(NETB_HFLAG_RESPONSE)) == 0) &&
|
||||
(netbios_hdr->questions == PP_NTOHS(1))) {
|
||||
/* decode the NetBIOS name */
|
||||
netbiosns_name_decode((char*)(netbios_name_hdr->encname), netbios_name, sizeof(netbios_name));
|
||||
/* if the packet is for us */
|
||||
if (NETBIOS_STRCMP(netbios_name, NETBIOS_LOCAL_NAME) == 0) {
|
||||
struct pbuf *q;
|
||||
struct netbios_resp *resp;
|
||||
|
||||
q = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct netbios_resp), PBUF_RAM);
|
||||
if (q != NULL) {
|
||||
resp = (struct netbios_resp*)q->payload;
|
||||
|
||||
/* prepare NetBIOS header response */
|
||||
resp->resp_hdr.trans_id = netbios_hdr->trans_id;
|
||||
resp->resp_hdr.flags = PP_HTONS(NETB_HFLAG_RESPONSE |
|
||||
NETB_HFLAG_OPCODE_NAME_QUERY |
|
||||
NETB_HFLAG_AUTHORATIVE |
|
||||
NETB_HFLAG_RECURS_DESIRED);
|
||||
resp->resp_hdr.questions = 0;
|
||||
resp->resp_hdr.answerRRs = PP_HTONS(1);
|
||||
resp->resp_hdr.authorityRRs = 0;
|
||||
resp->resp_hdr.additionalRRs = 0;
|
||||
|
||||
/* prepare NetBIOS header datas */
|
||||
MEMCPY( resp->resp_name.encname, netbios_name_hdr->encname, sizeof(netbios_name_hdr->encname));
|
||||
resp->resp_name.nametype = netbios_name_hdr->nametype;
|
||||
resp->resp_name.type = netbios_name_hdr->type;
|
||||
resp->resp_name.cls = netbios_name_hdr->cls;
|
||||
resp->resp_name.ttl = PP_HTONL(NETBIOS_NAME_TTL);
|
||||
resp->resp_name.datalen = PP_HTONS(sizeof(resp->resp_name.flags)+sizeof(resp->resp_name.addr));
|
||||
resp->resp_name.flags = PP_HTONS(NETB_NFLAG_NODETYPE_BNODE);
|
||||
ip4_addr_copy(resp->resp_name.addr, *netif_ip4_addr(netif_default));
|
||||
|
||||
/* send the NetBIOS response */
|
||||
udp_sendto(upcb, q, addr, port);
|
||||
|
||||
/* free the "reference" pbuf */
|
||||
pbuf_free(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* free the pbuf */
|
||||
pbuf_free(p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
netbiosns_init(void)
|
||||
{
|
||||
#ifdef NETBIOS_LWIP_NAME
|
||||
LWIP_ASSERT("NetBIOS name is too long!", strlen(NETBIOS_LWIP_NAME) < NETBIOS_NAME_LEN);
|
||||
#endif
|
||||
|
||||
netbiosns_pcb = udp_new_ip_type(IPADDR_TYPE_ANY);
|
||||
if (netbiosns_pcb != NULL) {
|
||||
/* we have to be allowed to send broadcast packets! */
|
||||
netbiosns_pcb->so_options |= SOF_BROADCAST;
|
||||
udp_bind(netbiosns_pcb, IP_ANY_TYPE, NETBIOS_PORT);
|
||||
udp_recv(netbiosns_pcb, netbiosns_recv, netbiosns_pcb);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NETBIOS_LWIP_NAME
|
||||
/* ATTENTION: the hostname must be <= 15 characters! */
|
||||
void
|
||||
netbiosns_set_name(const char* hostname)
|
||||
{
|
||||
size_t copy_len = strlen(hostname);
|
||||
LWIP_ASSERT("NetBIOS name is too long!", copy_len < NETBIOS_NAME_LEN);
|
||||
if(copy_len >= NETBIOS_NAME_LEN) {
|
||||
copy_len = NETBIOS_NAME_LEN - 1;
|
||||
}
|
||||
memcpy(netbiosns_local_name, hostname, copy_len + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
netbiosns_stop(void)
|
||||
{
|
||||
if (netbiosns_pcb != NULL) {
|
||||
udp_remove(netbiosns_pcb);
|
||||
netbiosns_pcb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LWIP_IPV4 && LWIP_UDP */
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CCodeGeneration</RootNamespace>
|
||||
<AssemblyName>CCodeGeneration</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CFile.cs" />
|
||||
<Compile Include="Code.cs" />
|
||||
<Compile Include="CodeContainerBase.cs" />
|
||||
<Compile Include="CodeElement.cs" />
|
||||
<Compile Include="Comment.cs" />
|
||||
<Compile Include="EmptyLine.cs" />
|
||||
<Compile Include="Function.cs" />
|
||||
<Compile Include="CGenerator.cs" />
|
||||
<Compile Include="IfThenElse.cs" />
|
||||
<Compile Include="PlainText.cs" />
|
||||
<Compile Include="Switch.cs" />
|
||||
<Compile Include="PP_If.cs" />
|
||||
<Compile Include="PP_Ifdef.cs" />
|
||||
<Compile Include="PP_Include.cs" />
|
||||
<Compile Include="FunctionDeclaration.cs" />
|
||||
<Compile Include="PP_Macro.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="VariableDeclaration.cs" />
|
||||
<Compile Include="VariablePrototype.cs" />
|
||||
<Compile Include="VariableType.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
54
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CFile.cs
Normal file
54
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CFile.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class CFile: CodeContainerBase
|
||||
{
|
||||
public CFile()
|
||||
{
|
||||
base.IncreaseLevel = false;
|
||||
}
|
||||
|
||||
public void Save(CGenerator generator)
|
||||
{
|
||||
if (generator == null)
|
||||
{
|
||||
throw new ArgumentNullException("generator");
|
||||
}
|
||||
|
||||
this.GenerateCode(0, generator);
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CGenerator.cs
Normal file
119
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CGenerator.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class CGenerator
|
||||
{
|
||||
public TextWriter OutputStream { get; private set; }
|
||||
public string File { get; private set; }
|
||||
public uint IndentCount { get; private set; }
|
||||
public string IndentChar { get; private set; }
|
||||
public string NewLine { get; private set; }
|
||||
|
||||
public CGenerator(System.IO.TextWriter outputStream, string file, uint indentCount, string indentChar, string newLine)
|
||||
{
|
||||
this.OutputStream = outputStream;
|
||||
this.File = file;
|
||||
this.IndentCount = indentCount;
|
||||
this.IndentChar = indentChar;
|
||||
this.NewLine = newLine;
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.File))
|
||||
{
|
||||
return Path.GetFileName(this.File);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteSequence(string value, uint repetitions)
|
||||
{
|
||||
while (repetitions > 0)
|
||||
{
|
||||
this.OutputStream.Write(value);
|
||||
repetitions--;
|
||||
}
|
||||
}
|
||||
|
||||
public void IndentLine(int level)
|
||||
{
|
||||
while (level > 0)
|
||||
{
|
||||
WriteSequence(this.IndentChar, this.IndentCount);
|
||||
level--;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteNewLine()
|
||||
{
|
||||
this.OutputStream.Write(this.NewLine);
|
||||
}
|
||||
|
||||
public void WriteMultilineString(string value, int level = 0)
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// only \n and \r\n are recognized as linebreaks
|
||||
string[] lines = value.Split(new char[] { '\n' }, StringSplitOptions.None);
|
||||
|
||||
for (int l = 0; l < (lines.Length - 1); l++)
|
||||
{
|
||||
if (lines[l].EndsWith("\r"))
|
||||
{
|
||||
this.OutputStream.Write(lines[l].Substring(0, lines[l].Length-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OutputStream.Write(lines[l]);
|
||||
}
|
||||
|
||||
this.WriteNewLine();
|
||||
this.IndentLine(level);
|
||||
}
|
||||
|
||||
this.OutputStream.Write(lines[lines.Length - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
56
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Code.cs
Normal file
56
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Code.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class Code: CodeElement
|
||||
{
|
||||
public string Code_ { get; set; }
|
||||
|
||||
public Code()
|
||||
{
|
||||
}
|
||||
|
||||
public Code(string code)
|
||||
{
|
||||
this.Code_ = code;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.WriteMultilineString(this.Code_, level);
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class CodeContainerBase: CodeElement
|
||||
{
|
||||
private readonly List<CodeElement> declarations = new List<CodeElement>();
|
||||
private readonly List<CodeElement> innerElements = new List<CodeElement>();
|
||||
private bool increaseLevel = true;
|
||||
|
||||
public List<CodeElement> Declarations
|
||||
{
|
||||
get { return this.declarations; }
|
||||
}
|
||||
|
||||
public List<CodeElement> InnerElements
|
||||
{
|
||||
get { return this.innerElements; }
|
||||
}
|
||||
|
||||
protected bool IncreaseLevel
|
||||
{
|
||||
get { return this.increaseLevel; }
|
||||
set { this.increaseLevel = value; }
|
||||
}
|
||||
|
||||
public void AddElements(IList<CodeElement> elements, params CodeElement[] spacerElements)
|
||||
{
|
||||
if (elements != null)
|
||||
{
|
||||
if ((spacerElements == null) || (spacerElements.Length == 0))
|
||||
{
|
||||
this.innerElements.AddRange(elements);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool spacerAdded = false;
|
||||
|
||||
foreach (CodeElement element in elements)
|
||||
{
|
||||
this.innerElements.Add(element);
|
||||
this.innerElements.AddRange(spacerElements);
|
||||
spacerAdded = true;
|
||||
}
|
||||
|
||||
if (spacerAdded)
|
||||
{
|
||||
// remove last spacer again
|
||||
this.innerElements.RemoveRange(this.innerElements.Count - spacerElements.Length, spacerElements.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CodeElement AddElement(CodeElement element)
|
||||
{
|
||||
if (element != null)
|
||||
{
|
||||
this.innerElements.Add(element);
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
public Code AddCode(string code)
|
||||
{
|
||||
return this.AddElement(new Code(code)) as Code;
|
||||
}
|
||||
|
||||
public Code AddCodeFormat(string codeFormat, params object[] args)
|
||||
{
|
||||
return this.AddElement(new Code(String.Format(codeFormat, args))) as Code;
|
||||
}
|
||||
|
||||
public CodeElement AddDeclaration(CodeElement declaration)
|
||||
{
|
||||
if (declaration != null)
|
||||
{
|
||||
this.declarations.Add(declaration);
|
||||
}
|
||||
|
||||
return declaration;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (this.increaseLevel)
|
||||
level++;
|
||||
|
||||
if (this.declarations.Count > 0)
|
||||
{
|
||||
foreach (CodeElement element in this.declarations)
|
||||
{
|
||||
element.GenerateCode(level, generator);
|
||||
}
|
||||
|
||||
EmptyLine.SingleLine.GenerateCode(level, generator);
|
||||
}
|
||||
|
||||
foreach (CodeElement element in this.innerElements)
|
||||
{
|
||||
element.GenerateCode(level, generator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CodeElement.cs
Normal file
41
src/apps/snmp/LwipMibCompiler/CCodeGeneration/CodeElement.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class CodeElement
|
||||
{
|
||||
public virtual void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
75
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Comment.cs
Normal file
75
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Comment.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class Comment: CodeElement
|
||||
{
|
||||
public const string CommentStart = "/*";
|
||||
public const string CommentEnd = "*/";
|
||||
|
||||
public string Comment_ { get; set; }
|
||||
public bool SingleLine { get; set; }
|
||||
|
||||
public Comment()
|
||||
{
|
||||
}
|
||||
|
||||
public Comment(string comment, bool singleLine = false)
|
||||
{
|
||||
this.Comment_ = comment;
|
||||
this.SingleLine = singleLine;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write(CommentStart);
|
||||
|
||||
if (!this.SingleLine)
|
||||
{
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.WriteMultilineString(this.Comment_, level);
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write(" " + Comment_ + " ");
|
||||
}
|
||||
|
||||
generator.OutputStream.Write(CommentEnd);
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
64
src/apps/snmp/LwipMibCompiler/CCodeGeneration/EmptyLine.cs
Normal file
64
src/apps/snmp/LwipMibCompiler/CCodeGeneration/EmptyLine.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class EmptyLine : CodeElement
|
||||
{
|
||||
public static readonly EmptyLine SingleLine = new EmptyLine();
|
||||
public static readonly EmptyLine TwoLines = new EmptyLine(2);
|
||||
public static readonly EmptyLine ThreeLines = new EmptyLine(3);
|
||||
|
||||
public uint Count { get; set; }
|
||||
|
||||
public EmptyLine()
|
||||
{
|
||||
this.Count = 1;
|
||||
}
|
||||
|
||||
public EmptyLine(uint count)
|
||||
{
|
||||
this.Count = count;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
uint c = this.Count;
|
||||
|
||||
while (c > 0)
|
||||
{
|
||||
generator.WriteNewLine();
|
||||
c--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
129
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Function.cs
Normal file
129
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Function.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class Function: CodeContainerBase
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public bool IsStatic { get; set; }
|
||||
|
||||
private readonly List<VariableType> parameter = new List<VariableType>();
|
||||
private VariableType returnType = VariableType.Void;
|
||||
|
||||
public Function()
|
||||
{
|
||||
}
|
||||
|
||||
public Function(string name, bool isStatic = false)
|
||||
{
|
||||
this.Name = name;
|
||||
this.IsStatic = isStatic;
|
||||
}
|
||||
|
||||
public List<VariableType> Parameter
|
||||
{
|
||||
get { return this.parameter; }
|
||||
}
|
||||
|
||||
public VariableType ReturnType
|
||||
{
|
||||
get { return this.returnType; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("ReturnValue");
|
||||
}
|
||||
this.returnType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static Function FromDeclaration(FunctionDeclaration decl)
|
||||
{
|
||||
Function result = new Function(decl.Name, decl.IsStatic);
|
||||
result.ReturnType = decl.ReturnType.Clone() as VariableType;
|
||||
|
||||
foreach (VariableType param in decl.Parameter)
|
||||
{
|
||||
result.parameter.Add(param.Clone() as VariableType);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
|
||||
if (this.IsStatic)
|
||||
{
|
||||
generator.OutputStream.Write("static ");
|
||||
}
|
||||
|
||||
this.returnType.GenerateCode(generator);
|
||||
generator.OutputStream.Write(" " + this.Name + "(");
|
||||
|
||||
if (this.Parameter.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < this.parameter.Count; i++)
|
||||
{
|
||||
this.parameter[i].GenerateCode(generator);
|
||||
|
||||
if (i < (this.parameter.Count - 1))
|
||||
{
|
||||
generator.OutputStream.Write(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write("void");
|
||||
}
|
||||
|
||||
generator.OutputStream.Write(")");
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level, generator);
|
||||
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class FunctionDeclaration: CodeElement
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public bool IsStatic { get; set; }
|
||||
public bool IsExtern { get; set; }
|
||||
|
||||
private readonly List<VariableType> parameter = new List<VariableType>();
|
||||
private VariableType returnType = VariableType.Void;
|
||||
|
||||
public FunctionDeclaration()
|
||||
{
|
||||
}
|
||||
|
||||
public FunctionDeclaration(string name, bool isStatic = false, bool isExtern = false)
|
||||
{
|
||||
this.Name = name;
|
||||
this.IsStatic = isStatic;
|
||||
this.IsExtern = isExtern;
|
||||
}
|
||||
|
||||
public List<VariableType> Parameter
|
||||
{
|
||||
get { return this.parameter; }
|
||||
}
|
||||
|
||||
public VariableType ReturnType
|
||||
{
|
||||
get { return this.returnType; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("ReturnValue");
|
||||
}
|
||||
this.returnType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
|
||||
if (this.IsExtern)
|
||||
{
|
||||
generator.OutputStream.Write("extern ");
|
||||
}
|
||||
|
||||
if (this.IsStatic)
|
||||
{
|
||||
generator.OutputStream.Write("static ");
|
||||
}
|
||||
|
||||
this.returnType.GenerateCode(generator);
|
||||
generator.OutputStream.Write(" " + this.Name + "(");
|
||||
|
||||
if (this.Parameter.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < this.parameter.Count; i++)
|
||||
{
|
||||
this.parameter[i].GenerateCode(generator);
|
||||
|
||||
if (i < (this.parameter.Count - 1))
|
||||
{
|
||||
generator.OutputStream.Write(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write("void");
|
||||
}
|
||||
|
||||
generator.OutputStream.Write(");");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
137
src/apps/snmp/LwipMibCompiler/CCodeGeneration/IfThenElse.cs
Normal file
137
src/apps/snmp/LwipMibCompiler/CCodeGeneration/IfThenElse.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class ElseIf : CodeContainerBase
|
||||
{
|
||||
public string Condition { get; set; }
|
||||
|
||||
public ElseIf()
|
||||
{
|
||||
}
|
||||
|
||||
public ElseIf(string condition)
|
||||
{
|
||||
this.Condition = condition;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Condition))
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write(String.Format("else if ({0})", this.Condition));
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level, generator);
|
||||
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class IfThenElse: CodeContainerBase
|
||||
{
|
||||
public string Condition { get; set; }
|
||||
|
||||
private List<ElseIf> elseIf = new List<ElseIf>();
|
||||
private CodeContainerBase else_ = new CodeContainerBase();
|
||||
|
||||
public IfThenElse()
|
||||
{
|
||||
}
|
||||
|
||||
public IfThenElse(string condition)
|
||||
{
|
||||
this.Condition = condition;
|
||||
}
|
||||
|
||||
public List<ElseIf> ElseIf
|
||||
{
|
||||
get { return this.elseIf; }
|
||||
}
|
||||
|
||||
public CodeContainerBase Else
|
||||
{
|
||||
get { return this.else_; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Condition))
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write(String.Format("if ({0})", this.Condition));
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level, generator);
|
||||
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
|
||||
foreach (ElseIf elif in this.elseIf)
|
||||
{
|
||||
elif.GenerateCode(level, generator);
|
||||
}
|
||||
|
||||
if (this.else_.InnerElements.Count > 0)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("else");
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
this.else_.GenerateCode(level, generator);
|
||||
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_If.cs
Normal file
67
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_If.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class PP_If: CodeContainerBase
|
||||
{
|
||||
public string Condition { get; set; }
|
||||
|
||||
public PP_If()
|
||||
{
|
||||
base.IncreaseLevel = false;
|
||||
}
|
||||
|
||||
public PP_If(string condition)
|
||||
: this()
|
||||
{
|
||||
this.Condition = condition;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Condition))
|
||||
{
|
||||
generator.OutputStream.Write("#if " + this.Condition);
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level, generator);
|
||||
|
||||
generator.OutputStream.Write("#endif /* " + this.Condition + " */");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
76
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Ifdef.cs
Normal file
76
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Ifdef.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class PP_Ifdef: CodeContainerBase
|
||||
{
|
||||
public string Macro { get; set; }
|
||||
public bool Inverted { get; set; }
|
||||
|
||||
public PP_Ifdef()
|
||||
{
|
||||
base.IncreaseLevel = false;
|
||||
}
|
||||
|
||||
public PP_Ifdef(string macro, bool inverted = false)
|
||||
: this()
|
||||
{
|
||||
this.Macro = macro;
|
||||
this.Inverted = inverted;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Macro))
|
||||
{
|
||||
if (this.Inverted)
|
||||
{
|
||||
generator.OutputStream.Write("#ifndef " + this.Macro);
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write("#ifdef " + this.Macro);
|
||||
}
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level, generator);
|
||||
|
||||
generator.OutputStream.Write("#endif /* " + this.Macro + " */");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
71
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Include.cs
Normal file
71
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Include.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class PP_Include : CodeElement
|
||||
{
|
||||
public string File { get; set; }
|
||||
public bool IsLocal { get; set; }
|
||||
|
||||
public PP_Include()
|
||||
{
|
||||
this.IsLocal = true;
|
||||
}
|
||||
|
||||
public PP_Include(string file, bool isLocal = true)
|
||||
{
|
||||
this.File = file;
|
||||
this.IsLocal = isLocal;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.File))
|
||||
{
|
||||
// includes are never indented
|
||||
if (this.IsLocal)
|
||||
{
|
||||
generator.OutputStream.Write("#include \"" + this.File + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write("#include <" + this.File + ">");
|
||||
}
|
||||
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Macro.cs
Normal file
59
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PP_Macro.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class PP_Macro: CodeElement
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
public PP_Macro()
|
||||
{
|
||||
}
|
||||
|
||||
public PP_Macro(string name, string value)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
// macros are not indented at all
|
||||
generator.OutputStream.Write("#define " + this.Name + " ");
|
||||
generator.WriteMultilineString(this.Value);
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PlainText.cs
Normal file
49
src/apps/snmp/LwipMibCompiler/CCodeGeneration/PlainText.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class PlainText : CodeElement
|
||||
{
|
||||
public string Value { get; set; }
|
||||
|
||||
public PlainText(string value)
|
||||
{
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
generator.WriteMultilineString(this.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("CCodeGeneration")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CCodeGeneration")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("8f07a0fa-86f4-48a0-97c7-f94fc5c3f103")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
146
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Switch.cs
Normal file
146
src/apps/snmp/LwipMibCompiler/CCodeGeneration/Switch.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class SwitchCase : CodeContainerBase
|
||||
{
|
||||
public string Value { get; set; }
|
||||
|
||||
public SwitchCase()
|
||||
{
|
||||
}
|
||||
|
||||
public SwitchCase(string value)
|
||||
{
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
public bool IsDefault
|
||||
{
|
||||
get { return (this.Value.ToLowerInvariant() == "default"); }
|
||||
}
|
||||
|
||||
public static SwitchCase GenerateDefault()
|
||||
{
|
||||
return new SwitchCase("default");
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Value))
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
if (this.IsDefault)
|
||||
{
|
||||
generator.OutputStream.Write("default:");
|
||||
}
|
||||
else
|
||||
{
|
||||
generator.OutputStream.Write(String.Format("case {0}:", this.Value));
|
||||
}
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level + 1);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
base.GenerateCode(level + 1, generator);
|
||||
|
||||
generator.IndentLine(level + 1);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
|
||||
generator.IndentLine(level + 1);
|
||||
generator.OutputStream.Write("break;");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Switch: CodeElement
|
||||
{
|
||||
public string SwitchVar { get; set; }
|
||||
|
||||
private List<SwitchCase> switches = new List<SwitchCase>();
|
||||
|
||||
public Switch()
|
||||
{
|
||||
}
|
||||
|
||||
public Switch(string switchVar)
|
||||
{
|
||||
this.SwitchVar = switchVar;
|
||||
}
|
||||
|
||||
public List<SwitchCase> Switches
|
||||
{
|
||||
get { return this.switches; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.SwitchVar))
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write(String.Format("switch ({0})", this.SwitchVar));
|
||||
generator.WriteNewLine();
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("{");
|
||||
generator.WriteNewLine();
|
||||
|
||||
SwitchCase defaultCase = null; // generate 'default' always as last case
|
||||
foreach (SwitchCase switchCase in this.switches)
|
||||
{
|
||||
if (switchCase.IsDefault)
|
||||
{
|
||||
defaultCase = switchCase;
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCase.GenerateCode(level + 1, generator);
|
||||
}
|
||||
}
|
||||
if (defaultCase != null)
|
||||
{
|
||||
defaultCase.GenerateCode(level + 1, generator);
|
||||
}
|
||||
|
||||
generator.IndentLine(level);
|
||||
generator.OutputStream.Write("}");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class VariableDeclaration : CodeElement
|
||||
{
|
||||
public VariableType Type { get; set; }
|
||||
public string InitialValue { get; set; }
|
||||
public bool IsStatic { get; set; }
|
||||
|
||||
public VariableDeclaration()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public VariableDeclaration(VariableType type, string initialValue = null, bool isStatic = false) :
|
||||
base()
|
||||
{
|
||||
this.Type = type;
|
||||
this.InitialValue = initialValue;
|
||||
this.IsStatic = isStatic;
|
||||
}
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (this.Type != null)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
|
||||
if (this.IsStatic)
|
||||
{
|
||||
generator.OutputStream.Write("static ");
|
||||
}
|
||||
|
||||
// declare the variable
|
||||
this.Type.GenerateCode(generator);
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(this.InitialValue))
|
||||
{
|
||||
// add initialization value
|
||||
generator.OutputStream.Write(" = ");
|
||||
generator.WriteMultilineString(this.InitialValue, level);
|
||||
}
|
||||
|
||||
generator.OutputStream.Write(";");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public class VariablePrototype : CodeElement
|
||||
{
|
||||
public VariableType Type { get; set; }
|
||||
|
||||
public VariablePrototype()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public VariablePrototype(VariableType type) :
|
||||
base()
|
||||
{
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public static VariablePrototype FromVariableDeclaration(VariableDeclaration declaration)
|
||||
{
|
||||
return new VariablePrototype(declaration.Type);
|
||||
}
|
||||
|
||||
|
||||
public override void GenerateCode(int level, CGenerator generator)
|
||||
{
|
||||
if (this.Type != null)
|
||||
{
|
||||
generator.IndentLine(level);
|
||||
|
||||
generator.OutputStream.Write("extern ");
|
||||
|
||||
// declare the variable
|
||||
this.Type.GenerateCode(generator);
|
||||
|
||||
generator.OutputStream.Write(";");
|
||||
generator.WriteNewLine();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
130
src/apps/snmp/LwipMibCompiler/CCodeGeneration/VariableType.cs
Normal file
130
src/apps/snmp/LwipMibCompiler/CCodeGeneration/VariableType.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace CCodeGeneration
|
||||
{
|
||||
public enum ConstType
|
||||
{
|
||||
None,
|
||||
Value,
|
||||
Indirection,
|
||||
Both
|
||||
}
|
||||
|
||||
public class VariableType : ICloneable
|
||||
{
|
||||
public const string VoidString = "void";
|
||||
public static readonly VariableType Void = new VariableType(null, "void");
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string Indirection { get; set; }
|
||||
public ConstType Const { get; set; }
|
||||
public string ArraySpecifier { get; set; }
|
||||
|
||||
public VariableType()
|
||||
{
|
||||
}
|
||||
|
||||
public VariableType(string name, string type, string indirection = null, ConstType const_ = ConstType.None, string arraySpecifier = null)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Type = type;
|
||||
this.Indirection = indirection;
|
||||
this.Const = const_;
|
||||
this.ArraySpecifier = arraySpecifier;
|
||||
}
|
||||
|
||||
public void GenerateCode(CGenerator generator)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Type))
|
||||
{
|
||||
generator.OutputStream.Write(this.ToString().Trim());
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Type))
|
||||
{
|
||||
StringBuilder vt = new StringBuilder();
|
||||
|
||||
if ((this.Const == ConstType.Value) || (this.Const == ConstType.Both))
|
||||
{
|
||||
vt.Append("const ");
|
||||
}
|
||||
|
||||
vt.Append(this.Type);
|
||||
vt.Append(" ");
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(this.Indirection))
|
||||
{
|
||||
vt.Append(this.Indirection);
|
||||
}
|
||||
|
||||
if ((this.Const == ConstType.Indirection) || (this.Const == ConstType.Both))
|
||||
{
|
||||
vt.Append("const ");
|
||||
}
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(this.Name))
|
||||
{
|
||||
vt.Append(this.Name);
|
||||
}
|
||||
|
||||
if (this.ArraySpecifier != null)
|
||||
{
|
||||
vt.Append("[");
|
||||
vt.Append(this.ArraySpecifier);
|
||||
vt.Append("]");
|
||||
}
|
||||
|
||||
return vt.ToString().Trim();
|
||||
}
|
||||
|
||||
return base.ToString();
|
||||
}
|
||||
|
||||
#region ICloneable Member
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
// we only have value types as members -> simply use .net base function
|
||||
return this.MemberwiseClone();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
47
src/apps/snmp/LwipMibCompiler/LwipMibCompiler.sln
Normal file
47
src/apps/snmp/LwipMibCompiler/LwipMibCompiler.sln
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LwipMibCompiler", "LwipMibCompiler\LwipMibCompiler.csproj", "{C25D5640-D999-49BD-82E0-A1975296A91E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LwipSnmpCodeGeneration", "LwipSnmpCodeGeneration\LwipSnmpCodeGeneration.csproj", "{AABCAB90-1540-45D4-A159-14831A54E9A3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCodeGeneration", "CCodeGeneration\CCodeGeneration.csproj", "{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSnmpLib.Mib", "SharpSnmpLib\SharpSnmpLib.Mib.csproj", "{CBE20411-5DB7-487D-825D-7694267BB6F5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LwipMibViewer", "LwipMibViewer\LwipMibViewer.csproj", "{86CC0B65-7985-4017-A252-0A7A18DCAEF3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86CC0B65-7985-4017-A252-0A7A18DCAEF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86CC0B65-7985-4017-A252-0A7A18DCAEF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86CC0B65-7985-4017-A252-0A7A18DCAEF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86CC0B65-7985-4017-A252-0A7A18DCAEF3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AABCAB90-1540-45D4-A159-14831A54E9A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AABCAB90-1540-45D4-A159-14831A54E9A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AABCAB90-1540-45D4-A159-14831A54E9A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AABCAB90-1540-45D4-A159-14831A54E9A3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C25D5640-D999-49BD-82E0-A1975296A91E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C25D5640-D999-49BD-82E0-A1975296A91E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C25D5640-D999-49BD-82E0-A1975296A91E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C25D5640-D999-49BD-82E0-A1975296A91E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CBE20411-5DB7-487D-825D-7694267BB6F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CBE20411-5DB7-487D-825D-7694267BB6F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CBE20411-5DB7-487D-825D-7694267BB6F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CBE20411-5DB7-487D-825D-7694267BB6F5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = LwipMibCompiler\LwipMibCompiler.csproj
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C25D5640-D999-49BD-82E0-A1975296A91E}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LwipMibCompiler</RootNamespace>
|
||||
<AssemblyName>LwipMibCompiler</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CCodeGeneration\CCodeGeneration.csproj">
|
||||
<Project>{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}</Project>
|
||||
<Name>CCodeGeneration</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\LwipSnmpCodeGeneration\LwipSnmpCodeGeneration.csproj">
|
||||
<Project>{AABCAB90-1540-45D4-A159-14831A54E9A3}</Project>
|
||||
<Name>LwipSnmpCodeGeneration</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SharpSnmpLib\SharpSnmpLib.Mib.csproj">
|
||||
<Project>{CBE20411-5DB7-487D-825D-7694267BB6F5}</Project>
|
||||
<Name>SharpSnmpLib.Mib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
480
src/apps/snmp/LwipMibCompiler/LwipMibCompiler/Program.cs
Normal file
480
src/apps/snmp/LwipMibCompiler/LwipMibCompiler/Program.cs
Normal file
@@ -0,0 +1,480 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using CCodeGeneration;
|
||||
using Lextm.SharpSnmpLib.Mib;
|
||||
using Lextm.SharpSnmpLib.Mib.Elements.Entities;
|
||||
using Lextm.SharpSnmpLib.Mib.Elements.Types;
|
||||
using LwipSnmpCodeGeneration;
|
||||
|
||||
namespace LwipMibCompiler
|
||||
{
|
||||
class Program
|
||||
{
|
||||
private static readonly Regex _alphaNumericRegex = new Regex("[^a-zA-Z0-9]");
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("lwIP MIB Compiler");
|
||||
Console.WriteLine("");
|
||||
|
||||
// check args
|
||||
if ((args.Length < 2) || String.IsNullOrWhiteSpace(args[0]) || String.IsNullOrWhiteSpace(args[1]))
|
||||
{
|
||||
PrintUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
string mibFile = args[0];
|
||||
if (!File.Exists(mibFile))
|
||||
{
|
||||
Console.WriteLine(String.Format("Unable to find file '{0}'!", mibFile));
|
||||
}
|
||||
|
||||
string destFile = args[1];
|
||||
string destHeaderFile;
|
||||
|
||||
if (Directory.Exists(destFile))
|
||||
{
|
||||
// only directory passed -> create dest filename from mib filename
|
||||
string mibFileName = Path.GetFileNameWithoutExtension(mibFile).ToLowerInvariant();
|
||||
destFile = Path.Combine(destFile, mibFileName + ".c");
|
||||
}
|
||||
|
||||
string destFileExt = Path.GetExtension(destFile);
|
||||
if (!String.IsNullOrEmpty(destFileExt))
|
||||
{
|
||||
destHeaderFile = destFile.Substring(0, destFile.Length - destFileExt.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
destHeaderFile = destFile;
|
||||
}
|
||||
destHeaderFile += ".h";
|
||||
|
||||
for (int i=2; i<args.Length; i++)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(args[i]) && Directory.Exists(args[i]))
|
||||
{
|
||||
MibTypesResolver.RegisterResolver(new FileSystemMibResolver(args[i], true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// read and resolve MIB
|
||||
Console.WriteLine(" Reading MIB file...");
|
||||
|
||||
MibDocument md = new MibDocument(mibFile);
|
||||
MibTypesResolver.ResolveTypes(md.Modules[0]);
|
||||
MibTree mt = new MibTree(md.Modules[0] as MibModule);
|
||||
|
||||
if (mt.Root.Count == 0)
|
||||
{
|
||||
Console.WriteLine("No root element found inside MIB!");
|
||||
return;
|
||||
}
|
||||
|
||||
MibCFile generatedFile = new MibCFile();
|
||||
MibHeaderFile generatedHeaderFile = new MibHeaderFile();
|
||||
|
||||
foreach (MibTreeNode mibTreeNode in mt.Root)
|
||||
{
|
||||
// create LWIP object tree from MIB structure
|
||||
Console.WriteLine(" Creating lwIP object tree " + mibTreeNode.Entity.Name);
|
||||
|
||||
SnmpMib snmpMib = new SnmpMib();
|
||||
snmpMib.Oid = mibTreeNode.Entity.Value;
|
||||
snmpMib.BaseOid = MibTypesResolver.ResolveOid(mibTreeNode.Entity).GetOidValues();
|
||||
snmpMib.Name = mibTreeNode.Entity.Name;
|
||||
|
||||
ProcessMibTreeNode(mibTreeNode, snmpMib);
|
||||
|
||||
// let the tree transform itself depending on node structure
|
||||
snmpMib.Analyze();
|
||||
|
||||
if (snmpMib.ChildNodes.Count != 0)
|
||||
{
|
||||
// generate code from LWIP object tree
|
||||
Console.WriteLine(" Generating code " + snmpMib.Name);
|
||||
snmpMib.Generate(generatedFile, generatedHeaderFile);
|
||||
}
|
||||
}
|
||||
|
||||
string preservedCode = MibCFile.GetPreservedCode(destFile);
|
||||
if (!string.IsNullOrEmpty(preservedCode))
|
||||
{
|
||||
generatedFile.PreservedCode.Add(new PlainText(preservedCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
generatedFile.PreservedCode.AddRange(generatedFile.Implementation);
|
||||
}
|
||||
generatedFile.Implementation.Clear();
|
||||
|
||||
|
||||
using (StreamWriter fileWriter = new StreamWriter(destHeaderFile))
|
||||
{
|
||||
CGenerator cGenerator = new CGenerator(fileWriter, destHeaderFile, 3, " ", Environment.NewLine);
|
||||
generatedHeaderFile.Save(cGenerator);
|
||||
}
|
||||
using (StreamWriter fileWriter = new StreamWriter(destFile))
|
||||
{
|
||||
CGenerator cGenerator = new CGenerator(fileWriter, destFile, 3, " ", Environment.NewLine);
|
||||
generatedFile.Save(cGenerator);
|
||||
}
|
||||
|
||||
Console.WriteLine(" Done");
|
||||
}
|
||||
|
||||
private static void PrintUsage()
|
||||
{
|
||||
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
|
||||
string appName = Path.GetFileName(codeBase);
|
||||
|
||||
Console.WriteLine("Usage:");
|
||||
Console.WriteLine(String.Format(" {0} <source MIB file> <dest C file> [<search path 1 for referred MIB's> <search path 2 for referred MIB's> ...]", appName));
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine(" <source MIB file>");
|
||||
Console.WriteLine(" Path and filename of MIB file to convert.");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine(" <dest C file>");
|
||||
Console.WriteLine(" Destination path and file. If a path is passed only, filename is auto");
|
||||
Console.WriteLine(" generated from MIB file name.");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine(" <search path X for referred MIB's>");
|
||||
Console.WriteLine(" It's important to provide all referred MIB's in order to correctly ");
|
||||
Console.WriteLine(" resolve all used types.");
|
||||
Console.WriteLine("");
|
||||
}
|
||||
|
||||
|
||||
#region Generation of LWIP Object Tree
|
||||
|
||||
private static void ProcessMibTreeNode(MibTreeNode mibTreeNode, SnmpTreeNode assignedSnmpNode)
|
||||
{
|
||||
foreach (MibTreeNode mtn in mibTreeNode.ChildNodes)
|
||||
{
|
||||
// in theory container nodes may also be scalars or tables at the same time (for now only process real containers)
|
||||
if (mtn.NodeType == MibTreeNodeType.Container)
|
||||
{
|
||||
SnmpTreeNode snmpTreeNode = GenerateSnmpTreeNode(mtn, assignedSnmpNode);
|
||||
assignedSnmpNode.ChildNodes.Add(snmpTreeNode);
|
||||
|
||||
ProcessMibTreeNode(mtn, snmpTreeNode);
|
||||
}
|
||||
else if ((mtn.NodeType & MibTreeNodeType.Scalar) != 0)
|
||||
{
|
||||
SnmpScalarNode snmpScalarNode = GenerateSnmpScalarNode(mtn, assignedSnmpNode);
|
||||
if (snmpScalarNode != null)
|
||||
{
|
||||
assignedSnmpNode.ChildNodes.Add(snmpScalarNode);
|
||||
}
|
||||
}
|
||||
else if ((mtn.NodeType & MibTreeNodeType.Table) != 0)
|
||||
{
|
||||
SnmpTableNode snmpTableNode = GenerateSnmpTableNode(mtn, assignedSnmpNode);
|
||||
if (snmpTableNode != null)
|
||||
{
|
||||
assignedSnmpNode.ChildNodes.Add(snmpTableNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static SnmpTreeNode GenerateSnmpTreeNode(MibTreeNode mibTreeNode, SnmpTreeNode parentNode)
|
||||
{
|
||||
SnmpTreeNode result = new SnmpTreeNode(parentNode);
|
||||
result.Name = _alphaNumericRegex.Replace (mibTreeNode.Entity.Name, "");
|
||||
result.Oid = mibTreeNode.Entity.Value;
|
||||
result.FullOid = MibTypesResolver.ResolveOid(mibTreeNode.Entity).GetOidString();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static SnmpScalarNode GenerateSnmpScalarNode(MibTreeNode mibTreeNode, SnmpTreeNode parentNode, bool ignoreAccessibleFlag = false)
|
||||
{
|
||||
ObjectType ote = mibTreeNode.Entity as ObjectType;
|
||||
if (ote != null)
|
||||
{
|
||||
return GenerateSnmpScalarNode(ote, parentNode, ignoreAccessibleFlag);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static SnmpScalarNode GenerateSnmpScalarNode(ObjectType ote, SnmpTreeNode parentNode, bool ignoreAccessibleFlag = false)
|
||||
{
|
||||
SnmpScalarNode result;
|
||||
|
||||
ITypeAssignment mibType = ote.BaseType;
|
||||
IntegerType it = (mibType as IntegerType);
|
||||
if (it != null)
|
||||
{
|
||||
if (ote.ReferredType.Name == Symbol.TruthValue.ToString())
|
||||
{
|
||||
result = new SnmpScalarNodeTruthValue(parentNode);
|
||||
}
|
||||
else if ((it.Type == IntegerType.Types.Integer) || (it.Type == IntegerType.Types.Integer32))
|
||||
{
|
||||
result = new SnmpScalarNodeInt(parentNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(String.Format("Unsupported IntegerType '{0}'!", it.Type));
|
||||
return null;
|
||||
}
|
||||
if (it.IsEnumeration)
|
||||
{
|
||||
result.Restrictions.AddRange(CreateRestrictions(it.Enumeration));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Restrictions.AddRange(CreateRestrictions(it.Ranges));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UnsignedType ut = (mibType as UnsignedType);
|
||||
if (ut != null)
|
||||
{
|
||||
if ((ut.Type == UnsignedType.Types.Unsigned32) ||
|
||||
(ut.Type == UnsignedType.Types.Gauge32))
|
||||
{
|
||||
result = new SnmpScalarNodeUint(SnmpDataType.Gauge, parentNode);
|
||||
}
|
||||
else if (ut.Type == UnsignedType.Types.Counter32)
|
||||
{
|
||||
result = new SnmpScalarNodeUint(SnmpDataType.Counter, parentNode);
|
||||
}
|
||||
else if (ut.Type == UnsignedType.Types.TimeTicks)
|
||||
{
|
||||
result = new SnmpScalarNodeUint(SnmpDataType.TimeTicks, parentNode);
|
||||
}
|
||||
else if (ut.Type == UnsignedType.Types.Counter64)
|
||||
{
|
||||
result = new SnmpScalarNodeCounter64(parentNode);
|
||||
if ((ut.Ranges != null) && (ut.Ranges.Count > 0))
|
||||
{
|
||||
Console.WriteLine(String.Format("Generation of ranges is not supported for Counter64 type!"));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(String.Format("Unsupported UnsignedType '{0}'!", ut.Type));
|
||||
return null;
|
||||
}
|
||||
result.Restrictions.AddRange(CreateRestrictions(ut.Ranges));
|
||||
}
|
||||
else if (mibType is IpAddressType)
|
||||
{
|
||||
result = new SnmpScalarNodeOctetString(SnmpDataType.IpAddress, parentNode);
|
||||
result.Restrictions.AddRange(CreateRestrictions((mibType as OctetStringType).Size));
|
||||
}
|
||||
else if (mibType is OpaqueType)
|
||||
{
|
||||
result = new SnmpScalarNodeOctetString(SnmpDataType.Opaque, parentNode);
|
||||
result.Restrictions.AddRange(CreateRestrictions((mibType as OctetStringType).Size));
|
||||
}
|
||||
else if (mibType is OctetStringType)
|
||||
{
|
||||
result = new SnmpScalarNodeOctetString(SnmpDataType.OctetString, parentNode);
|
||||
result.Restrictions.AddRange(CreateRestrictions((mibType as OctetStringType).Size));
|
||||
}
|
||||
else if (mibType is ObjectIdentifierType)
|
||||
{
|
||||
result = new SnmpScalarNodeObjectIdentifier(parentNode);
|
||||
}
|
||||
else if (mibType is BitsType)
|
||||
{
|
||||
result = new SnmpScalarNodeBits(parentNode, (uint)((mibType as BitsType).Map.GetHighestValue() + 1));
|
||||
result.Restrictions.AddRange(CreateRestrictions(mibType as BitsType));
|
||||
}
|
||||
else
|
||||
{
|
||||
TypeAssignment ta = mibType as TypeAssignment;
|
||||
if (ta != null)
|
||||
{
|
||||
Console.WriteLine(String.Format("Unsupported BaseType: Module='{0}', Name='{1}', Type='{2}'!", ta.Module.Name, ta.Name, ta.Type));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(String.Format("Unsupported BaseType: Module='{0}', Name='{1}'!", mibType.Module, mibType.Name));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
result.Name = _alphaNumericRegex.Replace(ote.Name, "");
|
||||
result.Oid = ote.Value;
|
||||
|
||||
if (ote.Access == MaxAccess.readWrite)
|
||||
{
|
||||
result.AccessMode = SnmpAccessMode.ReadWrite;
|
||||
}
|
||||
else if (ote.Access == MaxAccess.readOnly)
|
||||
{
|
||||
result.AccessMode = SnmpAccessMode.ReadOnly;
|
||||
}
|
||||
else if (ote.Access == MaxAccess.readCreate)
|
||||
{
|
||||
result.AccessMode = SnmpAccessMode.ReadOnly;
|
||||
}
|
||||
else if (ignoreAccessibleFlag && (ote.Access == MaxAccess.notAccessible))
|
||||
{
|
||||
result.AccessMode = SnmpAccessMode.NotAccessible;
|
||||
}
|
||||
else
|
||||
{
|
||||
// not accessible or unsupported accress type
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IEnumerable<IRestriction> CreateRestrictions(ValueRanges ranges)
|
||||
{
|
||||
List<IRestriction> result = new List<IRestriction>();
|
||||
|
||||
if (ranges != null)
|
||||
{
|
||||
foreach (ValueRange range in ranges)
|
||||
{
|
||||
if (!range.End.HasValue)
|
||||
{
|
||||
result.Add(new IsEqualRestriction(range.Start));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(new IsInRangeRestriction(range.Start, range.End.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static IEnumerable<IRestriction> CreateRestrictions(ValueMap map)
|
||||
{
|
||||
if ((map != null) && (map.Count > 0))
|
||||
{
|
||||
return CreateRestrictions(map.GetContinousRanges());
|
||||
}
|
||||
|
||||
return new List<IRestriction>();
|
||||
}
|
||||
|
||||
private static IEnumerable<IRestriction> CreateRestrictions(BitsType bt)
|
||||
{
|
||||
List<IRestriction> result = new List<IRestriction>();
|
||||
|
||||
if ((bt != null) && (bt.Map != null))
|
||||
{
|
||||
result.Add(new BitMaskRestriction(bt.Map.GetBitMask()));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static SnmpTableNode GenerateSnmpTableNode(MibTreeNode mibTreeNode, SnmpTreeNode parentNode)
|
||||
{
|
||||
SnmpTableNode result = new SnmpTableNode(parentNode);
|
||||
result.Name = mibTreeNode.Entity.Name;
|
||||
result.Oid = mibTreeNode.Entity.Value;
|
||||
|
||||
// expect exactly one row entry
|
||||
if ((mibTreeNode.ChildNodes.Count != 1) || ((mibTreeNode.ChildNodes[0].NodeType & MibTreeNodeType.TableRow) == 0) || (mibTreeNode.ChildNodes[0].Entity.Value != 1))
|
||||
{
|
||||
Console.WriteLine("Found table with unsupported properties! Table needs exactly one (fixed) TableRow with OID=1 ! (" + mibTreeNode.Entity.Name + ")");
|
||||
return null;
|
||||
}
|
||||
|
||||
MibTreeNode rowNode = mibTreeNode.ChildNodes[0];
|
||||
|
||||
ObjectType rot = rowNode.Entity as ObjectType;
|
||||
if (rot != null)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(rot.Augments))
|
||||
{
|
||||
result.AugmentedTableRow = rot.Augments;
|
||||
|
||||
// the indeces from another table shall be used because this table is only an extension of it
|
||||
rot = MibTypesResolver.ResolveDeclaration(rot.Module, rot.Augments) as ObjectType;
|
||||
}
|
||||
|
||||
if (rot.Indices != null)
|
||||
{
|
||||
foreach (string index in rot.Indices)
|
||||
{
|
||||
ObjectType indexEntity = MibTypesResolver.ResolveDeclaration(rot.Module, index) as ObjectType;
|
||||
if (indexEntity == null)
|
||||
{
|
||||
Console.WriteLine(String.Format("Could not resolve index '{0}' for table '{1}'! Table omitted!", index, result.Name));
|
||||
return null;
|
||||
}
|
||||
|
||||
result.IndexNodes.Add(GenerateSnmpScalarNode(indexEntity, parentNode, ignoreAccessibleFlag: true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result.IndexNodes.Count == 0)
|
||||
{
|
||||
// a table cannot be used without index
|
||||
Console.WriteLine("Found table without any index column ! (" + mibTreeNode.Entity.Name + ")");
|
||||
return null;
|
||||
}
|
||||
|
||||
// add child nodes
|
||||
foreach (MibTreeNode cellNode in rowNode.ChildNodes)
|
||||
{
|
||||
SnmpScalarNode ssn = GenerateSnmpScalarNode(cellNode, parentNode);
|
||||
if (ssn != null)
|
||||
{
|
||||
result.CellNodes.Add(ssn);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("ConsoleApplication28")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ConsoleApplication28")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("0abf7541-6a96-43cd-9e24-462e074b2c96")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
3
src/apps/snmp/LwipMibCompiler/LwipMibCompiler/app.config
Normal file
3
src/apps/snmp/LwipMibCompiler/LwipMibCompiler/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
166
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.Designer.cs
generated
Normal file
166
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.Designer.cs
generated
Normal file
@@ -0,0 +1,166 @@
|
||||
namespace LwipMibViewer
|
||||
{
|
||||
partial class FormMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Windows Form-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
|
||||
this.treeMib = new System.Windows.Forms.TreeView();
|
||||
this.imagelistTreeNodeImages = new System.Windows.Forms.ImageList(this.components);
|
||||
this.splitContainerMain = new System.Windows.Forms.SplitContainer();
|
||||
this.listviewNodeDetails = new System.Windows.Forms.ListView();
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.toolStripMain = new System.Windows.Forms.ToolStrip();
|
||||
this.toolbuttonOpenMib = new System.Windows.Forms.ToolStripButton();
|
||||
this.dialogOpenMib = new System.Windows.Forms.OpenFileDialog();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainerMain)).BeginInit();
|
||||
this.splitContainerMain.Panel1.SuspendLayout();
|
||||
this.splitContainerMain.Panel2.SuspendLayout();
|
||||
this.splitContainerMain.SuspendLayout();
|
||||
this.toolStripMain.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// treeMib
|
||||
//
|
||||
this.treeMib.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treeMib.ImageIndex = 0;
|
||||
this.treeMib.ImageList = this.imagelistTreeNodeImages;
|
||||
this.treeMib.Location = new System.Drawing.Point(0, 0);
|
||||
this.treeMib.Name = "treeMib";
|
||||
this.treeMib.SelectedImageIndex = 0;
|
||||
this.treeMib.Size = new System.Drawing.Size(1028, 418);
|
||||
this.treeMib.TabIndex = 0;
|
||||
this.treeMib.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMib_AfterSelect);
|
||||
//
|
||||
// imagelistTreeNodeImages
|
||||
//
|
||||
this.imagelistTreeNodeImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imagelistTreeNodeImages.ImageStream")));
|
||||
this.imagelistTreeNodeImages.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(0, "ntimgContainer");
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(1, "ntimgTable");
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(2, "ntimgRow");
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(3, "ntimgColumn");
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(4, "ntimgScalar");
|
||||
this.imagelistTreeNodeImages.Images.SetKeyName(5, "ntimgUnknown");
|
||||
//
|
||||
// splitContainerMain
|
||||
//
|
||||
this.splitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainerMain.Location = new System.Drawing.Point(0, 25);
|
||||
this.splitContainerMain.Name = "splitContainerMain";
|
||||
this.splitContainerMain.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainerMain.Panel1
|
||||
//
|
||||
this.splitContainerMain.Panel1.Controls.Add(this.treeMib);
|
||||
//
|
||||
// splitContainerMain.Panel2
|
||||
//
|
||||
this.splitContainerMain.Panel2.Controls.Add(this.listviewNodeDetails);
|
||||
this.splitContainerMain.Size = new System.Drawing.Size(1028, 625);
|
||||
this.splitContainerMain.SplitterDistance = 418;
|
||||
this.splitContainerMain.TabIndex = 1;
|
||||
//
|
||||
// listviewNodeDetails
|
||||
//
|
||||
this.listviewNodeDetails.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeader1,
|
||||
this.columnHeader2});
|
||||
this.listviewNodeDetails.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listviewNodeDetails.FullRowSelect = true;
|
||||
this.listviewNodeDetails.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.listviewNodeDetails.Location = new System.Drawing.Point(0, 0);
|
||||
this.listviewNodeDetails.Name = "listviewNodeDetails";
|
||||
this.listviewNodeDetails.Size = new System.Drawing.Size(1028, 203);
|
||||
this.listviewNodeDetails.TabIndex = 0;
|
||||
this.listviewNodeDetails.UseCompatibleStateImageBehavior = false;
|
||||
this.listviewNodeDetails.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
this.columnHeader1.Text = "";
|
||||
this.columnHeader1.Width = 150;
|
||||
//
|
||||
// columnHeader2
|
||||
//
|
||||
this.columnHeader2.Text = "";
|
||||
this.columnHeader2.Width = 777;
|
||||
//
|
||||
// toolStripMain
|
||||
//
|
||||
this.toolStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolbuttonOpenMib});
|
||||
this.toolStripMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStripMain.Name = "toolStripMain";
|
||||
this.toolStripMain.Size = new System.Drawing.Size(1028, 25);
|
||||
this.toolStripMain.TabIndex = 2;
|
||||
//
|
||||
// toolbuttonOpenMib
|
||||
//
|
||||
this.toolbuttonOpenMib.Image = ((System.Drawing.Image)(resources.GetObject("toolbuttonOpenMib.Image")));
|
||||
this.toolbuttonOpenMib.Name = "toolbuttonOpenMib";
|
||||
this.toolbuttonOpenMib.Size = new System.Drawing.Size(65, 22);
|
||||
this.toolbuttonOpenMib.Text = "Open...";
|
||||
this.toolbuttonOpenMib.Click += new System.EventHandler(this.toolbuttonOpenMib_Click);
|
||||
//
|
||||
// FormMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1028, 650);
|
||||
this.Controls.Add(this.splitContainerMain);
|
||||
this.Controls.Add(this.toolStripMain);
|
||||
this.Name = "FormMain";
|
||||
this.Text = "MIB Viewer";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.splitContainerMain.Panel1.ResumeLayout(false);
|
||||
this.splitContainerMain.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainerMain)).EndInit();
|
||||
this.splitContainerMain.ResumeLayout(false);
|
||||
this.toolStripMain.ResumeLayout(false);
|
||||
this.toolStripMain.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TreeView treeMib;
|
||||
private System.Windows.Forms.SplitContainer splitContainerMain;
|
||||
private System.Windows.Forms.ListView listviewNodeDetails;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader2;
|
||||
private System.Windows.Forms.ImageList imagelistTreeNodeImages;
|
||||
private System.Windows.Forms.ToolStrip toolStripMain;
|
||||
private System.Windows.Forms.ToolStripButton toolbuttonOpenMib;
|
||||
private System.Windows.Forms.OpenFileDialog dialogOpenMib;
|
||||
}
|
||||
}
|
||||
|
||||
217
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.cs
Normal file
217
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Windows.Forms;
|
||||
using Lextm.SharpSnmpLib.Mib;
|
||||
using Lextm.SharpSnmpLib.Mib.Elements;
|
||||
using Lextm.SharpSnmpLib.Mib.Elements.Types;
|
||||
using Lextm.SharpSnmpLib.Mib.Elements.Entities;
|
||||
using System.IO;
|
||||
|
||||
namespace LwipMibViewer
|
||||
{
|
||||
public partial class FormMain : Form
|
||||
{
|
||||
readonly ListViewGroup listviewgroupAbstract;
|
||||
readonly ListViewGroup listviewgroupElement;
|
||||
readonly ListViewGroup listviewgroupBaseType;
|
||||
readonly ListViewGroup listviewgroupTypeChain;
|
||||
|
||||
public FormMain()
|
||||
{
|
||||
this.Font = SystemInformation.MenuFont;
|
||||
InitializeComponent();
|
||||
|
||||
this.listviewgroupAbstract = new ListViewGroup("Abstract", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
this.listviewgroupElement = new ListViewGroup("Element Properties", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
this.listviewgroupBaseType = new ListViewGroup("Element Base Type", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
this.listviewgroupTypeChain = new ListViewGroup("Element Type Chain", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
this.listviewNodeDetails.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
|
||||
listviewgroupAbstract,
|
||||
listviewgroupElement,
|
||||
listviewgroupBaseType,
|
||||
listviewgroupTypeChain});
|
||||
|
||||
try
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath));
|
||||
if (dirInfo != null)
|
||||
{
|
||||
dirInfo = dirInfo.Parent;
|
||||
if (dirInfo != null)
|
||||
{
|
||||
dirInfo = dirInfo.Parent;
|
||||
if (dirInfo != null)
|
||||
{
|
||||
dirInfo = new DirectoryInfo(Path.Combine(dirInfo.FullName, "Mibs"));
|
||||
if (dirInfo.Exists)
|
||||
{
|
||||
MibTypesResolver.RegisterResolver(new FileSystemMibResolver(dirInfo.FullName, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
#region GUI Event Handler
|
||||
|
||||
private void toolbuttonOpenMib_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
if (this.dialogOpenMib.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
OpenMib(this.dialogOpenMib.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
private void treeMib_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
listviewNodeDetails.Items.Clear();
|
||||
|
||||
if (e.Node != null)
|
||||
{
|
||||
MibTreeNode mtn = e.Node.Tag as MibTreeNode;
|
||||
if (mtn != null)
|
||||
{
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Abstract", mtn.NodeType.ToString() }, this.listviewgroupAbstract));
|
||||
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Module", (mtn.Entity.Module != null) ? mtn.Entity.Module.Name : "" }, this.listviewgroupElement));
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Type", mtn.Entity.GetType().Name }, this.listviewgroupElement));
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Name", mtn.Entity.Name }, this.listviewgroupElement));
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Description", mtn.Entity.Description }, this.listviewgroupElement));
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "OID", mtn.Entity.Value.ToString() }, this.listviewgroupElement));
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Full OID", MibTypesResolver.ResolveOid(mtn.Entity).GetOidString() }, this.listviewgroupElement));
|
||||
if (mtn.Entity is ObjectType)
|
||||
{
|
||||
listviewNodeDetails.Items.Add(new ListViewItem(new string[] { "Access", (mtn.Entity as ObjectType).Access.ToString() }, this.listviewgroupElement));
|
||||
}
|
||||
|
||||
ITypeReferrer tr = mtn.Entity as ITypeReferrer;
|
||||
if (tr != null)
|
||||
{
|
||||
ShowTypeDetails(listviewNodeDetails, this.listviewgroupBaseType, tr.BaseType);
|
||||
ShowTypeChain(listviewNodeDetails, tr.ReferredType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void OpenMib(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
MibDocument md = new MibDocument(file);
|
||||
MibTypesResolver.ResolveTypes(md.Modules[0]);
|
||||
|
||||
this.treeMib.Nodes.Clear();
|
||||
this.listviewNodeDetails.Items.Clear();
|
||||
|
||||
MibTree mt = new MibTree(md.Modules[0] as MibModule);
|
||||
foreach (MibTreeNode mibTreeNode in mt.Root)
|
||||
{
|
||||
AddNode(mibTreeNode, this.treeMib.Nodes);
|
||||
|
||||
foreach (TreeNode node in this.treeMib.Nodes)
|
||||
{
|
||||
node.Expand();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void AddNode(MibTreeNode mibNode, TreeNodeCollection parentNodes)
|
||||
{
|
||||
int imgIndex = 5; //unknown
|
||||
if ((mibNode.NodeType & MibTreeNodeType.Table) != 0)
|
||||
{
|
||||
imgIndex = 1;
|
||||
}
|
||||
else if ((mibNode.NodeType & MibTreeNodeType.TableRow) != 0)
|
||||
{
|
||||
imgIndex = 2;
|
||||
}
|
||||
else if ((mibNode.NodeType & MibTreeNodeType.TableCell) != 0)
|
||||
{
|
||||
imgIndex = 3;
|
||||
}
|
||||
else if ((mibNode.NodeType & MibTreeNodeType.Scalar) != 0)
|
||||
{
|
||||
imgIndex = 4;
|
||||
}
|
||||
else if ((mibNode.NodeType & MibTreeNodeType.Container) != 0)
|
||||
{
|
||||
imgIndex = 0;
|
||||
}
|
||||
|
||||
TreeNode newNode = new TreeNode(mibNode.Entity.Name, imgIndex, imgIndex);
|
||||
newNode.Tag = mibNode;
|
||||
|
||||
parentNodes.Add(newNode);
|
||||
|
||||
foreach (MibTreeNode child in mibNode.ChildNodes)
|
||||
{
|
||||
AddNode(child, newNode.Nodes);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowTypeChain(ListView lv, ITypeAssignment type)
|
||||
{
|
||||
ShowTypeDetails(lv, this.listviewgroupTypeChain, type);
|
||||
|
||||
ITypeReferrer tr = type as ITypeReferrer;
|
||||
if ((tr != null) && (tr.ReferredType != null))
|
||||
{
|
||||
lv.Items.Add(new ListViewItem(new string[] { " >>>", "" }, this.listviewgroupTypeChain));
|
||||
ShowTypeChain(listviewNodeDetails, tr.ReferredType);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowTypeDetails(ListView lv, ListViewGroup lvg, ITypeAssignment type)
|
||||
{
|
||||
lv.Items.Add(new ListViewItem(new string[] { "Module", (type.Module != null) ? type.Module.Name : "" }, lvg));
|
||||
lv.Items.Add(new ListViewItem(new string[] { "Type", type.GetType().Name }, lvg));
|
||||
lv.Items.Add(new ListViewItem(new string[] { "Name", type.Name }, lvg));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
298
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.resx
Normal file
298
src/apps/snmp/LwipMibCompiler/LwipMibViewer/FormMain.resx
Normal file
@@ -0,0 +1,298 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="imagelistTreeNodeImages.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="imagelistTreeNodeImages.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABo
|
||||
IQAAAk1TRnQBSQFMAgEBBgEAARABAAEQAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
|
||||
AwABIAMAAQEBAAEgBgABIBIAAwQBBQMWAR4DIgEyAzEBTwJGAUQBhwMvAUsDHgErAxsBJgMYASIDFQEd
|
||||
AxIBGAMNARIDCgENAwcBCQMEAQUDAQECAwQBBQMWAR4DIgEyAzEBTgJGAUQBhwMvAUsDHgErAxsBJgMb
|
||||
ASYDIQExAyEBMAMdASoDGwEmAxgBIQMLAQ8DAQECgAADAgEDAwwBEAMrAUMCRgFEAYIC/wHwAf8CRgFE
|
||||
AYIDKgFAAw8BFAMNAREDCwEPAwkBDAMHAQoDBQEHAwQBBQMCAQMDAAEBAwIBAwMLAQ8DKwFDAkYBRAGC
|
||||
Av8B8AH/AkYBRAGCAyoBQAMOARMDEgEZAT0COwFpAVwBRQFCAawBZwE+AToBxAFaAUUBQwGqATwBOwE6
|
||||
AWYDEAEWAwABAYQAAx4BKwJEAUIBewL/AfAB/wLpAdoD/wHxAf8CRAFCAXsDHgErJAADHgErAkQBQgF7
|
||||
Av8B8AH/AukB2gP/AfEB/wJEAUIBewMeASsBLgItAUcBdwFHATwByQG7AVQBPQHxA+4B/wG7AVMBPAHx
|
||||
AXcBRgE8AckBLgItAUeEAAMdASoCRAFCAXcC/wHwAf8B6wHdAbEB/wH3AcEBNwH/Ae0B3wGzA/8B8gH/
|
||||
AkQBQgF3Ax0BKhwAAx0BKgJEAUIBdwL/AfAB/wLpAdoB/wLqAdwB/wLrAd4D/wHyAf8CRAFCAXcBZAFJ
|
||||
AUIBrwG2AVkBQQHxAc0BVAEyAf8BvQF5AWIB/wHFAVABLgH/AbEBUQE1AfEBXAFIAUQBn4QAAkMBQQF2
|
||||
Av8B8AH/AukB2gH/AecBqwEhAf8B5wGrASEB/wHnAasBIQH/AeoB2wGwA/8B9AH/AkMBQQF2Ax0BKhgA
|
||||
AkMBQQF2Av8B8AH/AukB2gH/AuoB3AH/AusB3gH/AuwB3wH/Au0B4QP/AfQB/wGAAUQBMQHaAc4BcAFN
|
||||
AfwBugFMASoB/wPSAf8BvgGLAXgB/wG7AVIBMgH8AW8BSQE/AbqEAAMdASkCQwFBAXQC/wHxAf8B5wHX
|
||||
AasB/wHXAZYBDAH/AdcBlgEMAf8B1wGWAQwB/wHoAdgBrgP/AfUB/wJDAUEBdAMdASkUAAMdASkCQwFB
|
||||
AXQC/wHxAf8C6wHeAf8C7AHfAf8C7QHhAf8C7gHjAf8C7wHlAf8BzQF5AV4B/wHOAXcBWAH3AbwBVAEy
|
||||
Af8BtAFMASoB/wPmAf8BtwFlAUsB8AFdAUkBRAGdiAADHQEpAkIBQQFyAv8B8gH/AeUB1AGpAf8BzQGJ
|
||||
AQAB/wHNAYkBAAH/Ac0BiQEAAf8B6AHXAa8D/wH3Af8CQgFBAXIDHAEoFAADHQEpAkIBQQFyAv8B8gH/
|
||||
Au0B4QH/Au4B4wH/Au8B5QH/AvAB5wH/AeABuwGqAf8BzgFpAUgB/wHjAcsBwQH5BP8B3gHHAb0B9QF+
|
||||
AU8BQgHEAi0BLAFFjAADHAEoAkEBQAFxAv8B9AH/AecB1gGsAf8B0QGOAQQB/wHRAY4BBAH/AdEBjgEE
|
||||
Af8B7AHbAbMD/wH4Af8CQQFAAXEDHAEoFAADHAEoAkEBQAFxAv8B9AH/Au8B5QH/AvAB5wH/AvEB6QH/
|
||||
AvMB6gH/AeQBvgGsAf8B1AGBAWIB/wGGAUoBNAHXAWYBTQFEAaoCLQEsAUWUAAMcAScCQQFAAW8C/wH1
|
||||
Af8B7AHcAbMB/wHfAaEBFwH/Ad8BoQEXAf8B3wGhARcB/wHxAeIBuwP/AfoB/wJBAUABbwMcAScUAAMc
|
||||
AScCQQFAAW8C/wH1Af8C8QHpAf8C8wHqAf8C9AHsAf8C9QHuAf8C9gHwA/8B+gH/AkEBQAFvAxwBJ5gA
|
||||
AxwBJwJAAT8BbQL/AfcB/wHyAeMBuwH/AfABuAEuAf8B8AG4AS4B/wHwAbgBLgH/AvgB9AP/AfsB/wJA
|
||||
AT8BbQMcAScUAAMcAScCQAE/AW0C/wH3Af8C9AHsAf8C9QHuAf8C9gHwAf8C9wHyAf8C+AH0A/8B+wH/
|
||||
AkABPwFtAxwBJ5gAAxsBJgJAAT8BbAL/AfgB/wH3AeoBwwH/Af0ByQE/Af8B+QHsAccB/wL7AfcB/wL8
|
||||
AfkD/wH8Af8CQAE/AWwDGwEmFAADGwEmAkABPwFsAv8B+AH/AvYB8AH/AvcB8gH/AvgB9AH/AvsB9wH/
|
||||
AvwB+QP/AfwB/wJAAT8BbAMbASaYAAMbASYCPwE+AWsC/wH6Af8C+AH0Af8C+wH3Af8C3wHVAf8CyQG5
|
||||
Af8C4AHWA/8B/gH/Aj8BPgFrGAADGwEmAj8BPgFrAv8B+gH/AvgB9AH/AvsB9wH/At8B1QH/AskBuQH/
|
||||
AuAB1gP/Af4B/wI/AT4Ba5wAAxoBJQI/AT0BaQL/AfsB/wL8AfkB/wK8AawB/wQAArwBrAP/Af4B/wI/
|
||||
AT0BaRwAAxoBJQI/AT0BaQL/AfsB/wL8AfkB/wK8AawB/wQAArwBrAP/Af4B/wI/AT0BaaAAAxoBJQI+
|
||||
AT0BaAL/AfwB/wLLAcEB/wKgAZAB/wLLAcED/wH+Af8CPgE9AWggAAMaASUCPgE9AWgC/wH8Af8CywHB
|
||||
Af8CoAGQAf8CywHBA/8B/gH/Aj4BPQFopAADGgElAj4BPQFnAv8B/gP/Af4D/wH+Bf8CPgE9AWckAAMa
|
||||
ASUCPgE9AWcC/wH+A/8B/gP/Af4F/wI+AT0BZ6gAAxoBJAI+AT0BZgI+AT0BZgI+AT0BZgI+AT0BZgMx
|
||||
AU0oAAMaASQCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYDMQFNlAADIQEwAUABRgFIAXwBQwFOAVIBkgMF
|
||||
AQccAAMHAQkDEAEWAxMBGgMTARoDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEa
|
||||
AxABFgMHAQkDBwEJAxABFgMTARoDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEa
|
||||
AxMBGgMQARYDBwEJAwcBCQMQARYDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEaAxMBGgMTARoDEwEa
|
||||
AxMBGgMTARoDEAEWAwcBCQwAAjIBMwFQAUMBUQFXAZkBRQFkAXQBwAFYAYsBogHgATwBWAFqAcEDEwEa
|
||||
AwUBBxgAAjwBOwFpAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGH
|
||||
AkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAjwBOwFpAjkBNAFpAkABNwGHAkABNwGH
|
||||
AkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGHAkABNwGH
|
||||
AkABNwGHAkABNwGHAjkBNAFpAjwBOwFpAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGH
|
||||
AkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAkYBRAGHAjwBOwFpAw0BEQMa
|
||||
ASQBRAFNAVEBmAE8AYkBrAHyAWcBrwHTAfoBggHLAewB/wGFAc4B7gH/ARUBWwGCAe8BOgFXAWYBxAE6
|
||||
AVcBZgHEAT4BWgFqAb4BPgFaAWoBvgE+AVoBagG+AUQBTQFRAZgDGgEkAw0BEQJGAUMBgQL5AekB/wLz
|
||||
AeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLz
|
||||
AeIB/wLzAeIB/wL5AekB/wJGAUMBgQJDAToBgQL5AekB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLz
|
||||
AeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wL5AekB/wJDAToBgQJG
|
||||
AUMBgQL5AekB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLzAeIB/wLz
|
||||
AeIB/wLzAeIB/wLzAeIB/wLzAeIB/wL5AekB/wJGAUMBgQMHAQkDDQESAUIBWwFmAbIBiAHQAe8B/wF9
|
||||
AcoB6QH/AX0BygHpAf8BhwHQAe8B/wEkAXsBqQH/AX0BvAHbAf8BfQG8AdsB/wGNAdEB8wH/AY0B0QHz
|
||||
Af8BkAHUAfUB/wFCAVsBZgGyATACMQFNAwcBCQJEAUMBegL0AeQC/wHMAUIB/wH+AcsBQQH/AewB0gGG
|
||||
Af8C2gHJAf8C2AHHAf8C1gHFAf8C1AHDAf8C0wHCAf8C0QHAAf8CzwG+Af8CzgG9Af8CzQG8Af8C9AHk
|
||||
Af8CRAFDAXoCRgE+AXoC9AHkAv8BzAFDAf8B/gHLAUIB/wHsAdIBhgH/AtoByQH/AtgBxwH/AtYBxQH/
|
||||
AtQBwwH/AtMBwgH/AtEBwAH/As8BvgH/As4BvQH/As0BvAH/AvQB5AH/AkYBPgF6AkQBQwF6AvQB5AL/
|
||||
AcwBQgH/Af4BywFBAf8B7AHSAYYB/wLaAckB/wLYAccB/wHnAWEBPwH/AecBYQE/Af8B5wFhAT8B/wHn
|
||||
AWEBPwH/As8BvgH/As4BvQH/As0BvAH/AvQB5AH/AkQBQwF6CAABQwFXAWABpAGKAdMB8AH/AYIBzQHr
|
||||
Af8BggHNAesB/wGKAdMB8AH/ASQBfAGrAf8BegG5AdgB/wF6AbkB2AH/AYoBzgHwAf8BigHOAfAB/wGP
|
||||
AdMB9AH/AfQBtgEsAf8BQwFXAWABpAQAAkQBQgF3AvUB5gL/AcwBQgL/Ae4BiAH/AewB0gGGAf8C9QHu
|
||||
Af8C9QHuAf8C1gHFAf8C9QHuAf8C9QHuAf8C0QHAAf8C9QHuAf8C9QHuAf8CzQG8Af8C9QHmAf8CRAFC
|
||||
AXcCRwE/AXcC9QHmAv8BzAFDAv8B7gGIAf8B7AHSAYYB/wL1Ae4B/wL1Ae4B/wLWAcUB/wL1Ae4B/wL1
|
||||
Ae4B/wLRAcAB/wL1Ae4B/wL1Ae4B/wLNAbwB/wL1AeYB/wJHAT8BdwJEAUIBdwL1AeYC/wHMAUIC/wHu
|
||||
AYgB/wHsAdIBhgH/AvUB7gH/AvUB7gH/AdkBWAE2Af8B8gHJAbgB/wHyAckBuAH/AdkBWAE2Af8C9QHu
|
||||
Af8C9QHuAf8CzQG8Af8C9QHmAf8CRAFCAXcIAAFDAVUBXgGeAY4B1gHyAf8BhwHQAe0B/wGHAdAB7QH/
|
||||
AY4B1gHyAf8BJgGCAa8B/wF7AboB2AH/AXsBugHYAf8BiwHPAfEB/wGLAc8B8QH/AZEB1QH1Af8B/gHJ
|
||||
AT8B/wFDAVUBXgGeBAACQwFBAXUC9gHpAv8BzAFCAf8B/gHLAUEB/wHsAdIBhgH/AtoByQH/AtgBxwH/
|
||||
AtwBzAH/AtQBwwH/AtMBwgH/AtgByAH/As8BvgH/As4BvQH/As0BvAH/AvYB6QH/AkMBQQF1AkcBPwF1
|
||||
AvYB6QL/AcwBQwH/Af4BywFCAf8B7AHSAYYB/wLaAckB/wLYAccB/wLcAcwB/wLUAcMB/wLTAcIB/wLY
|
||||
AcgB/wLPAb4B/wLOAb0B/wLNAbwB/wL2AekB/wJHAT8BdQJDAUEBdQL2AekC/wHMAUIB/wH+AcsBQQH/
|
||||
AewB0gGGAf8C2gHJAf8C2AHHAf8ByAFPAS0B/wHeAbYBngH/Ad4BtQGdAf8ByAFPAS0B/wLPAb4B/wLO
|
||||
Ab0B/wLNAbwB/wL2AekB/wJDAUEBdQgAAUQBVQFdAZsBkgHaAfQB/wGLAdQB8AH/AYsB1AHwAf8BkgHa
|
||||
AfQB/wEpAYUBswH/AX0BvAHaAf8BfQG8AdoB/wGNAdEB8wH/AY0B0QHzAf8BkwHXAfYB/wLrAd0B/wFE
|
||||
AVUBXQGbBAACQgFBAXMC9wHrAv8BzAFCAv8B7gGIAf8B7AHSAYYB/wL3AfEB/wL3AfEB/wLWAcUB/wL3
|
||||
AfEB/wL3AfEB/wLRAcAB/wL3AfEB/wL3AfEB/wLNAbwB/wL3AesB/wJCAUEBcwJHAT8BcwL3AesC/wHM
|
||||
AUMC/wHuAYgB/wHsAdIBhgH/AvcB8QH/AvcB8QH/AtYBxQH/AvcB8QH/AvcB8QH/AtEBwAH/AvcB8QH/
|
||||
AvcB8QH/As0BvAH/AvcB6wH/AkcBPwFzAkIBQQFzAvcB6wL/AcwBQgL/Ae4BiAH/AewB0gGGAf8C9wHx
|
||||
Af8C9wHxAf8BuAFHASUB/wHzAcsBuQH/AfMBywG5Af8BuAFHASUB/wL3AfEB/wL3AfEB/wLNAbwB/wL3
|
||||
AesB/wJCAUEBcwgAAUQBUwFbApcB3gH2Af8BkAHYAfIB/wGQAdgB8gH/AZcB3gH2Af8BKwGJAbcB/wGA
|
||||
Ab0B3AH/AYABvQHcAf8BjwHTAfUB/wGPAdMB9QH/AZUB2QH4Af8C9QHuAf8BRAFTAVsBlwQAAkIBQQFy
|
||||
AvgB7gL/AcwBQgH/Af4BywFBAf8B7AHSAYYB/wLaAckB/wLYAccB/wLdAc4B/wLUAcMB/wLTAcIB/wLZ
|
||||
AcoB/wLPAb4B/wLOAb0B/wLNAbwB/wL4Ae4B/wJCAUEBcgJIAUABcgL4Ae4B/wHsAYYBYwH/AeIBewFZ
|
||||
Af8B1AFuAUwB/wHEAWABPgH/AbYBUgEwAf8BrQFHASUB/wGrAUMBIQH/AbEBRAEiAf8BvQFKASgB/wHM
|
||||
AVIBMAH/AdsBWgE4Af8B6AFiAUAB/wL4Ae4B/wJIAUABcgJCAUEBcgL4Ae4C/wHMAUIB/wH+AcsBQQH/
|
||||
AewB0gGGAf8C2gHJAf8C2AHHAf8BrQFCASAB/wHeAbYBngH/Ad4BtQGdAf8BrQFCASAB/wLPAb4B/wLO
|
||||
Ab0B/wLNAbwB/wL4Ae4B/wJCAUEBcggAAUQBUwFaAZQBmwHhAfcB/wGUAdsB9AH/AZQB2wH0Af8BmwHh
|
||||
AfcB/wEuAY0BvAH/AYEBvgHdAf8BgQG+Ad0B/wGQAdQB9gH/AZAB1AH2Af8BlwHbAfkB/wL+Af0B/wFE
|
||||
AVMBWgGUBAACQQFAAXAC+QHxAv8BzAFCAv8B7gGIAf8B7AHSAYYB/wL5AfUB/wL5AfUB/wLWAcUB/wL5
|
||||
AfUB/wL5AfUB/wLRAcAB/wL5AfUB/wL5AfUB/wLNAbwB/wL5AfEB/wJBAUABcAJHAUABcAL5AfEB/wHs
|
||||
AYYBYwH/AfgBxQF5Af8B7QG1AXgB/wH1AcwBvAH/AfUBzAG8Af8B4AG3AZ8B/wH1AcwBvAH/AfUBzAG8
|
||||
Af8B3QG0AZwB/wH1AcwBvAH/AfUBzAG8Af8B6AFiAUAB/wL5AfEB/wJHAUABcAJBAUABcAL5AfEC/wHM
|
||||
AUIC/wHuAYgB/wHsAdIBhgH/AvkB9QH/AvkB9QH/AasBRAEiAf8B9QHMAbwB/wH1AcwBvAH/AasBRAEi
|
||||
Af8C+QH1Af8C+QH1Af8CzQG8Af8C+QHxAf8CQQFAAXAIAAFEAVEBVwGQAZ4B5QH5Af8BmAHfAfYB/wGY
|
||||
Ad8B9gH/AZ4B5QH5Af8BMAGQAcAB/wGDAcAB3wH/AYMBwAHfAf8BkgHWAfgB/wGSAdYB+AH/AZkB3QH6
|
||||
Af8BRAFRAVcBkAMjATMEAAJBAUABbgL7AfQC/wHMAUIB/wH+AcsBQQH/AewB0gGGAf8C2gHJAf8C2AHH
|
||||
Af8C3gHQAf8C1AHDAf8C0wHCAf8C2gHMAf8CzwG+Af8CzgG9Af8CzQG8Af8C+wH0Af8CQQFAAW4CRwFA
|
||||
AW4C+wH0Af8B7AGGAWMB/wHiAXsBWQH/AdQBbgFMAf8BxAFgAT4B/wG2AVIBMAH/Aa0BRwElAf8BqwFD
|
||||
ASEB/wGxAUQBIgH/Ab0BSgEoAf8BzAFSATAB/wHbAVoBOAH/AegBYgFAAf8C+wH0Af8CRwFAAW4CQQFA
|
||||
AW4C+wH0Av8BzAFCAf8B/gHLAUEB/wHsAdIBhgH/AtoByQH/AtgBxwH/AbIBTAEqAf8B3gG2AZ4B/wHe
|
||||
AbUBnQH/AbIBTAEqAf8CzwG+Af8CzgG9Af8CzQG8Af8C+wH0Af8CQQFAAW4IAAFDAU8BVQGNAaMB6AH7
|
||||
Af8BnQHjAfkB/wGdAeMB+QH/AaMB6AH7Af8BMwGUAcUB/wGFAcIB4QH/AYUBwgHhAf8BlAHYAfoB/wGU
|
||||
AdgB+gH/AZsB3wH8Af8BQwFPAVUBjQgAAkABPwFtAvwB9wL/AcwBQgL/Ae4BiAH/AewB0gGGAf8C/AH6
|
||||
Af8C/AH6Af8C1gHFAf8C/AH6Af8C/AH6Af8C0QHAAf8C/AH6Af8C/AH6Af8CzQG8Af8C/AH3Af8CQAE/
|
||||
AW0CRwFAAW0C/AH3Av8BzAFDAv8B7gGIAf8B7AHSAYYB/wL8AfoB/wL8AfoB/wLWAcUB/wL8AfoB/wL8
|
||||
AfoB/wLRAcAB/wL8AfoB/wL8AfoB/wLNAbwB/wL8AfcB/wJHAUABbQJAAT8BbQL8AfcC/wHMAUIC/wHu
|
||||
AYgB/wHsAdIBhgH/AvwB+gH/AvwB+gH/AcABWgE4Af8B9gHOAb8B/wH2Ac4BvwH/AcABWgE4Af8C/AH6
|
||||
Af8C/AH6Af8CzQG8Af8C/AH3Af8CQAE/AW0IAAFDAU8BVAGKAaYB6wH8Af8BoQHmAfsB/wGhAeYB+wH/
|
||||
AaYB6wH8Af8BOgGdAc8B/wGHAcQB4gH/AYcBxAHiAf8BlgHaAfwB/wGWAdoB/AH/AZ4B4gH9Af8BQwFP
|
||||
AVQBiggAAj8BPgFrAv0B+QL/AcwBQgH/Af4BywFBAf8B9QHOAWIB/wHrAdIBhQH/AekB0AGDAf8B5wHO
|
||||
AYEB/wHlAcwBgAH/AeQBywF8Af8B4gHJAXoB/wHgAccBeAH/Ad8BxgF3Af8B3gHFAXYB/wL9AfkB/wI/
|
||||
AT4BawJHAUABawL9AfkC/wHMAUMB/wH+AcsBQgH/AfUBzgFjAf8B6wHSAYUB/wHpAdABgwH/AecBzgGB
|
||||
Af8B5QHMAYAB/wHkAcsBfQH/AeIByQF7Af8B4AHHAXkB/wHfAcYBeAH/Ad4BxQF3Af8C/QH5Af8CRwFA
|
||||
AWsCPwE+AWsC/QH5Av8BzAFCAf8B/gHLAUEB/wH1Ac4BYgH/AesB0gGFAf8B6QHQAYMB/wHRAWoBSAH/
|
||||
AekBsQF0Af8B6AGwAXMB/wHRAWoBSAH/AeABxwF4Af8B3wHGAXcB/wHeAcUBdgH/Av0B+QH/Aj8BPgFr
|
||||
CAABQgFNAVIBhwGpAe4B/QH/AaQB6QH8Af8BpAHpAfwB/wGqAe8B/QH/AUABoQHRAf8BkAHRAfEB/wGW
|
||||
AdoB+wH/AZcB2wH9Af8BlwHbAf0B/wGfAeMB/gH/AUIBTQFSAYcIAAI/AT4BagL+AfwC/wHMAUIC/wHu
|
||||
AYgB/wH9AcoBQAH/AfwB6wGFAf8B+wHqAYQB/wH4AcUBOwH/AfYB5QF9Af8B9AHjAXsB/wHzAcABNgH/
|
||||
AfEB4AF4Af8B7wHeAXYB/wHvAbwBMgH/Av4B/AH/Aj8BPgFqAkcBQAFqAv4B/AL/AcwBQwL/Ae4BiAH/
|
||||
Af0BygFBAf8B/AHrAYUB/wH7AeoBhAH/AfgBxQE8Af8B9gHlAX4B/wH0AeMBfAH/AfMBwAE3Af8B8QHg
|
||||
AXkB/wHvAd4BdwH/Ae8BvAEzAf8C/gH8Af8CRwFAAWoCPwE+AWoC/gH8Av8BzAFCAv8B7gGIAf8B/QHK
|
||||
AUAB/wH8AesBhQH/AfsB6gGEAf8B4QF5AVcB/wHzAcABcwH/AfIBvwFyAf8B4QF5AVcB/wHxAeABeAH/
|
||||
Ae8B3gF2Af8B7wG8ATIB/wL+AfwB/wI/AT4BaggAAUMBTAFSAYUBrQHxAv8BqwHvAf4B/wGVAeIB+AH/
|
||||
AWwByQHtAf8BRgGpAdkB/wGYAdwB/gH/AZgB3AH+Af8BmAHcAf4B/wGYAdwB/gH/AaEB5QL/AUMBTAFS
|
||||
AYUIAAI+AT0BaAL/Af4C/wHMAUIB/wH+AcsBQQH/Af0BygFAAf8B/AHJAT8B/wH6AccBPQH/AfgBxQE7
|
||||
Af8B9gHDAToB/wH1AcIBOAH/AfMBwAE2Af8B8QG+ATQB/wHwAb0BMwH/Ae8BvAEyA/8B/gH/Aj4BPQFo
|
||||
AkcBQAFoAv8B/gL/AcwBQwH/Af4BywFCAf8B/QHKAUEB/wH8AckBQAH/AfoBxwE+Af8B+AHFATwB/wH2
|
||||
AcMBOwH/AfUBwgE5Af8B8wHAATcB/wHxAb4BNQH/AfABvQE0Af8B7wG8ATMD/wH+Af8CRwFAAWgCPgE9
|
||||
AWgC/wH+Av8BzAFCAf8B/gHLAUEB/wH9AcoBQAH/AfwByQE/Af8B+gHHAT0B/wHsAYYBYgH/AewBhgFi
|
||||
Af8B7AGGAWIB/wHsAYYBYgH/AfEBvgE0Af8B8AG9ATMB/wHvAbwBMgP/Af4B/wI+AT0BaAgAAUMBTAFQ
|
||||
AYMBiAHcAfQB/wFeAcAB6QH/AV0BvwHqAf8BgAHTAfQB/wGcAeMB/QH/AaIB5gL/AaIB5gL/AaIB5gL/
|
||||
AaIB5gL/AaYB6gL/AUMBTAFQAYMIAAI+AT0BZzj/Aj4BPQFnAkcBQAFnOP8CRwFAAWcCPgE9AWc4/wI+
|
||||
AT0BZwgAATkBOwE9AWEBQgFLAU8BgQFCAUsBTwGBAUIBSwFPAYEBQgFLAU8BgQFCAUsBTwGBAUIBSwFP
|
||||
AYEBQgFLAU8BgQFCAUsBTwGBAUIBSwFPAYEBQgFLAU8BgQE5ATsBPQFhCAADMQFNAj4BPQFmAj4BPQFm
|
||||
Aj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFmAj4BPQFm
|
||||
Aj4BPQFmAj4BPQFmAzEBTQI3ATQBTQJHAUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgJH
|
||||
AUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgJHAUABZgI3ATQBTQMxAU0CPgE9
|
||||
AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9AWYCPgE9
|
||||
AWYCPgE9AWYCPgE9AWYCPgE9AWYDMQFNAUIBTQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYA
|
||||
A/8RAAGAAf8BgAEBBQABfwEAAQEFAAE/AQABAQUAAR8BAAEBBAABgAEPAYABAQQAAcABBwHAAQMEAAHg
|
||||
AQMB4AEDBAAB8AEBAfABAQQAAfgBAAH4BQAB/AEAAfwFAAH+AQgB/gEIBAAB/wEAAf8FAAH/AYAB/wGA
|
||||
BAAB/wHAAf8BwAQAAfgBfwYAAeABPxYAAcABAQYAAcABAQYAAcABAQYAAcABAQYAAcABAQYAAcABAQYA
|
||||
AcABAwYAAcABAwYAAcABAwYAAcABAwYAAcABAwYAAcABAwYACw==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolStripMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>211, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="toolbuttonOpenMib.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAK6SURBVDhPjZNbSNNRHMfPU9DtwR71oZf5IgkF0YMEEYb2
|
||||
EGgG5YNgGQmGSUoYimbel5KKmlM0u3jJSpv3ad7WnGkzb2yO4bByF3WuuTnnnLv47Zw/9YclQQc+/L//
|
||||
P+d8/r/f+Z8/Ib/HjJDcmhaS3P+Bzf2zjr8qiki+QyuE6dNNbIzFw6F8DJ++AVh97c9GK9jcA4LJAlKI
|
||||
rQ7sW9/DpauGZSoFg6JwfJSU+TE0XIXOgqCaAwJ5ASn2bb6F19TM4bO+w4z4HgwWC9YcDugpK3Y7umQy
|
||||
FOZEDMRkZQX7SWS5pMRrboVn9RUHy1/aEqDSajGn0WDZbIZ6bQ0t/f1gIzojI8lPMvaIPPWsN2FP/5yD
|
||||
ZdmLWLwUi/FhZASSqSlOUtXczBMcGZnFVzGUTSr2jI1wfq/lYHms4Tqkc3MYnZ2F0mDAqs3GV8LaiUhN
|
||||
TeYFA5mkenelHg5tNQfLw3UxaOrpQZdUiu7xca5/Mc0do6PQb28jPDk5hRf0PiQi5zcR7JoKDpYHaqIg
|
||||
VyohW1jg+lcZjVwlCzod1p1OXEhMvM8LOtNJvWOpEjZVKQfL/ZVX0NrXh165HP2Tk5hQqzGuUmFQocCm
|
||||
y4XzCQlpvKA9jTTa1WWwzBdzsNxdfhmfFxcxQRct0Q3UmEzY2t2FdWcHdrcb5+LiHvCC1hTSbFOWwDyT
|
||||
x8GyuDQCbRIJ3tBPp6CfU0pbcdA3M4mDCs7ExqYzwWHKibo7pNs6T4+yIofDSqtof3IJBtqzTq+Hx+uF
|
||||
y+OBky5kkh2aT0VFZTNBAEWQFEFqhyvO2pclSe6f03nYnC1EW9FFGOnGGSi+/X14KW6fD3tUtkdzYFiY
|
||||
0O801iWSaNFtUteWGST92nL1R/q1Q7ojAkHV0ZCQkuOhocV/c0wguHvgn2APyuPJ6dI4kpV/gzyjtycp
|
||||
gf8g4Begs1B6Kbj3cQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="dialogOpenMib.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>337, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{86CC0B65-7985-4017-A252-0A7A18DCAEF3}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LwipMibViewer</RootNamespace>
|
||||
<AssemblyName>LwipMibViewer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FormMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormMain.Designer.cs">
|
||||
<DependentUpon>FormMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FormMain.resx">
|
||||
<DependentUpon>FormMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SharpSnmpLib\SharpSnmpLib.Mib.csproj">
|
||||
<Project>{CBE20411-5DB7-487D-825D-7694267BB6F5}</Project>
|
||||
<Name>SharpSnmpLib.Mib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
51
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Program.cs
Normal file
51
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Program.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LwipMibViewer
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new FormMain());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("LwipMibViewer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LwipMibViewer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("7ffbd1c1-1c64-45bb-b243-2400446c649d")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
63
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Properties/Resources.Designer.cs
generated
Normal file
63
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.225
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace LwipMibViewer.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LwipMibViewer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Properties/Settings.Designer.cs
generated
Normal file
26
src/apps/snmp/LwipMibCompiler/LwipMibViewer/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.225
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace LwipMibViewer.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
3
src/apps/snmp/LwipMibCompiler/LwipMibViewer/app.config
Normal file
3
src/apps/snmp/LwipMibCompiler/LwipMibViewer/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public interface IRestriction
|
||||
{
|
||||
string GetCheckCodeValid(string varNameToCheck);
|
||||
string GetCheckCodeInvalid(string varNameToCheck);
|
||||
}
|
||||
|
||||
public class BitMaskRestriction : IRestriction
|
||||
{
|
||||
UInt32 mask;
|
||||
|
||||
public BitMaskRestriction(UInt32 mask)
|
||||
{
|
||||
this.mask = mask;
|
||||
}
|
||||
|
||||
public string GetCheckCodeValid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("(({0} & {1}) == {0})", varNameToCheck, this.mask);
|
||||
}
|
||||
|
||||
public string GetCheckCodeInvalid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("(({0} & {1}) != {0})", varNameToCheck, this.mask);
|
||||
}
|
||||
}
|
||||
|
||||
public class IsEqualRestriction : IRestriction
|
||||
{
|
||||
private Int64 value;
|
||||
|
||||
public IsEqualRestriction(Int64 value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public long Value
|
||||
{
|
||||
get { return value; }
|
||||
}
|
||||
|
||||
public string GetCheckCodeValid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("({0} == {1})", varNameToCheck, this.value);
|
||||
}
|
||||
|
||||
public string GetCheckCodeInvalid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("({0} != {1})", varNameToCheck, this.value);
|
||||
}
|
||||
}
|
||||
|
||||
public class IsInRangeRestriction : IRestriction
|
||||
{
|
||||
private Int64 rangeStart;
|
||||
private Int64 rangeEnd;
|
||||
|
||||
public IsInRangeRestriction(Int64 rangeStart, Int64 rangeEnd)
|
||||
{
|
||||
this.rangeStart = rangeStart;
|
||||
this.rangeEnd = rangeEnd;
|
||||
}
|
||||
|
||||
public long RangeStart
|
||||
{
|
||||
get { return this.rangeStart; }
|
||||
}
|
||||
|
||||
public long RangeEnd
|
||||
{
|
||||
get { return this.rangeEnd; }
|
||||
}
|
||||
|
||||
public string GetCheckCodeValid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("(({0} >= {1}) && ({0} <= {2}))", varNameToCheck, this.rangeStart, this.rangeEnd);
|
||||
}
|
||||
|
||||
public string GetCheckCodeInvalid(string varNameToCheck)
|
||||
{
|
||||
return String.Format("(({0} < {1}) || ({0} > {2}))", varNameToCheck, this.rangeStart, this.rangeEnd);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
199
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmp.cs
Normal file
199
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmp.cs
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public static class LwipOpts
|
||||
{
|
||||
public static bool GenerateEmptyFolders = false;
|
||||
/// <summary>
|
||||
/// If a tree node only has scalar nodes as child nodes, it is replaced by
|
||||
/// a single scalar array node in order to save memory and have only one single get/test/set method for all scalars.
|
||||
/// </summary>
|
||||
public static bool GenerateScalarArrays = true;
|
||||
/// <summary>
|
||||
/// If a tree node has multiple scalars as subnodes as well as other treenodes it
|
||||
/// defines a single get/test/set method for all scalar child node.
|
||||
/// (without other treenodes as child it would have been converted to scalar array node).
|
||||
/// </summary>
|
||||
public static bool GenerateSingleAccessMethodsForTreeNodeScalars = GenerateScalarArrays;
|
||||
}
|
||||
|
||||
public static class LwipDefs
|
||||
{
|
||||
public const string Null = "NULL";
|
||||
public const string Vt_U8 = "u8_t";
|
||||
public const string Vt_U16 = "u16_t";
|
||||
public const string Vt_U32 = "u32_t";
|
||||
public const string Vt_S8 = "s8_t";
|
||||
public const string Vt_S16 = "s16_t";
|
||||
public const string Vt_S32 = "s32_t";
|
||||
public const string Vt_Snmp_err = "snmp_err_t";
|
||||
|
||||
public const string Incl_SnmpOpts = "lwip/apps/snmp_opts.h";
|
||||
public const string Opt_SnmpEnabled = "LWIP_SNMP";
|
||||
|
||||
public const string Vt_StMib = "struct snmp_mib";
|
||||
public const string Vt_StObjectId = "struct snmp_obj_id";
|
||||
public const string Vt_StNode = "struct snmp_node";
|
||||
public const string Vt_StNodeInstance = "struct snmp_node_instance";
|
||||
public const string Vt_StTreeNode = "struct snmp_tree_node";
|
||||
public const string Vt_StScalarNode = "struct snmp_scalar_node";
|
||||
public const string Vt_StScalarArrayNode = "struct snmp_scalar_array_node";
|
||||
public const string Vt_StScalarArrayNodeDef = "struct snmp_scalar_array_node_def";
|
||||
public const string Vt_StTableNode = "struct snmp_table_node";
|
||||
public const string Vt_StTableColumnDef = "struct snmp_table_col_def";
|
||||
public const string Vt_StNextOidState = "struct snmp_next_oid_state";
|
||||
|
||||
public const string Def_NodeAccessReadOnly = "SNMP_NODE_INSTANCE_READ_ONLY";
|
||||
public const string Def_NodeAccessReadWrite = "SNMP_NODE_INSTANCE_READ_WRITE";
|
||||
public const string Def_NodeAccessWriteOnly = "SNMP_NODE_INSTANCE_WRITE_ONLY";
|
||||
public const string Def_NodeAccessNotAccessible = "SNMP_NODE_INSTANCE_NOT_ACCESSIBLE";
|
||||
|
||||
public const string Def_ErrorCode_Ok = "SNMP_ERR_NOERROR";
|
||||
public const string Def_ErrorCode_WrongValue = "SNMP_ERR_WRONGVALUE";
|
||||
public const string Def_ErrorCode_NoSuchInstance = "SNMP_ERR_NOSUCHINSTANCE";
|
||||
|
||||
public const string FnctSuffix_GetValue = "_get_value";
|
||||
public const string FnctSuffix_SetTest = "_set_test";
|
||||
public const string FnctSuffix_SetValue = "_set_value";
|
||||
public const string FnctSuffix_GetInstance = "_get_instance";
|
||||
public const string FnctSuffix_GetNextInstance = "_get_next_instance";
|
||||
|
||||
public const string FnctName_SetTest_Ok = "snmp_set_test_ok";
|
||||
|
||||
public static string GetLwipDefForSnmpAccessMode(SnmpAccessMode am)
|
||||
{
|
||||
switch (am)
|
||||
{
|
||||
case SnmpAccessMode.ReadOnly: return Def_NodeAccessReadOnly;
|
||||
case SnmpAccessMode.ReadWrite: return Def_NodeAccessReadWrite;
|
||||
case SnmpAccessMode.NotAccessible: return Def_NodeAccessNotAccessible;
|
||||
case SnmpAccessMode.WriteOnly: return Def_NodeAccessWriteOnly;
|
||||
default: throw new NotSupportedException("Unknown SnmpAccessMode!");
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetAsn1DefForSnmpDataType(SnmpDataType dt)
|
||||
{
|
||||
switch (dt)
|
||||
{
|
||||
// primitive
|
||||
case SnmpDataType.Null:
|
||||
return "SNMP_ASN1_TYPE_NULL";
|
||||
case SnmpDataType.Bits:
|
||||
case SnmpDataType.OctetString:
|
||||
return "SNMP_ASN1_TYPE_OCTET_STRING";
|
||||
case SnmpDataType.ObjectIdentifier:
|
||||
return "SNMP_ASN1_TYPE_OBJECT_ID";
|
||||
case SnmpDataType.Integer:
|
||||
return "SNMP_ASN1_TYPE_INTEGER";
|
||||
|
||||
// application
|
||||
case SnmpDataType.IpAddress:
|
||||
return "SNMP_ASN1_TYPE_IPADDR";
|
||||
case SnmpDataType.Counter:
|
||||
return "SNMP_ASN1_TYPE_COUNTER";
|
||||
case SnmpDataType.Gauge:
|
||||
return "SNMP_ASN1_TYPE_GAUGE";
|
||||
case SnmpDataType.TimeTicks:
|
||||
return "SNMP_ASN1_TYPE_TIMETICKS";
|
||||
case SnmpDataType.Opaque:
|
||||
return "SNMP_ASN1_TYPE_OPAQUE";
|
||||
case SnmpDataType.Counter64:
|
||||
return "SNMP_ASN1_TYPE_COUNTER64";
|
||||
default:
|
||||
throw new NotSupportedException("Unknown SnmpDataType!");
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetLengthForSnmpDataType(SnmpDataType dt)
|
||||
{
|
||||
switch (dt)
|
||||
{
|
||||
case SnmpDataType.Null:
|
||||
return "0";
|
||||
|
||||
case SnmpDataType.Integer:
|
||||
case SnmpDataType.Counter:
|
||||
case SnmpDataType.IpAddress:
|
||||
case SnmpDataType.Gauge:
|
||||
case SnmpDataType.TimeTicks:
|
||||
return "4";
|
||||
|
||||
case SnmpDataType.Counter64:
|
||||
return "8";
|
||||
|
||||
case SnmpDataType.OctetString:
|
||||
case SnmpDataType.ObjectIdentifier:
|
||||
case SnmpDataType.Bits:
|
||||
case SnmpDataType.Opaque:
|
||||
return null;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("Unknown SnmpDataType!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum SnmpDataType
|
||||
{
|
||||
Null,
|
||||
|
||||
Integer, // INTEGER, Integer32
|
||||
|
||||
Counter, // Counter, Counter32
|
||||
Gauge, // Gauge, Gauge32, Unsigned32
|
||||
TimeTicks,
|
||||
|
||||
Counter64,
|
||||
|
||||
OctetString,
|
||||
Opaque,
|
||||
Bits,
|
||||
|
||||
ObjectIdentifier,
|
||||
|
||||
IpAddress,
|
||||
}
|
||||
|
||||
public enum SnmpAccessMode
|
||||
{
|
||||
ReadOnly,
|
||||
ReadWrite,
|
||||
WriteOnly,
|
||||
NotAccessible
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AABCAB90-1540-45D4-A159-14831A54E9A3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LwipSnmpCodeGeneration</RootNamespace>
|
||||
<AssemblyName>LwipSnmpCodeGeneration</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IRestriction.cs" />
|
||||
<Compile Include="SnmpScalarNodeCounter64.cs" />
|
||||
<Compile Include="SnmpScalarNodeTruthValue.cs" />
|
||||
<Compile Include="SnmpScalarAggregationNode.cs" />
|
||||
<Compile Include="SnmpTableNode.cs" />
|
||||
<Compile Include="SnmpScalarArrayNode.cs" />
|
||||
<Compile Include="MibHeaderFile.cs" />
|
||||
<Compile Include="SnmpScalarNodeBits.cs" />
|
||||
<Compile Include="SnmpMib.cs" />
|
||||
<Compile Include="SnmpScalarNodeInt.cs" />
|
||||
<Compile Include="SnmpScalarNodeObjectIdentifier.cs" />
|
||||
<Compile Include="SnmpScalarNodeOctetString.cs" />
|
||||
<Compile Include="SnmpScalarNodeUint.cs" />
|
||||
<Compile Include="SnmpTreeNode.cs" />
|
||||
<Compile Include="LwipSnmp.cs" />
|
||||
<Compile Include="MibCFile.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SnmpNode.cs" />
|
||||
<Compile Include="SnmpScalarNode.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CCodeGeneration\CCodeGeneration.csproj">
|
||||
<Project>{7DA7C0AB-0982-4BF5-9324-F59A7A08D65B}</Project>
|
||||
<Name>CCodeGeneration</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
196
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/MibCFile.cs
Normal file
196
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/MibCFile.cs
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using CCodeGeneration;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class MibCFile
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private const string PreservedSectionMarker = "LWIP MIB generator - preserved section begin";
|
||||
private const string PreservedSectionHeader =
|
||||
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" +
|
||||
PreservedSectionMarker + "\n" +
|
||||
"Code below is preserved on regeneration. Remove these comment lines to regenerate code.\n" +
|
||||
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
|
||||
|
||||
private readonly List<CodeElement> includes = new List<CodeElement>();
|
||||
private readonly List<CodeElement> defines = new List<CodeElement>();
|
||||
private readonly List<CodeElement> declarations = new List<CodeElement>();
|
||||
private readonly List<CodeElement> implementation = new List<CodeElement>();
|
||||
private readonly List<CodeElement> preservedCode = new List<CodeElement>();
|
||||
|
||||
#endregion
|
||||
|
||||
public MibCFile()
|
||||
{
|
||||
}
|
||||
|
||||
#region Accessors
|
||||
|
||||
public List<CodeElement> Includes
|
||||
{
|
||||
get { return this.includes; }
|
||||
}
|
||||
|
||||
public List<CodeElement> Defines
|
||||
{
|
||||
get { return this.defines; }
|
||||
}
|
||||
|
||||
public List<CodeElement> Declarations
|
||||
{
|
||||
get { return this.declarations; }
|
||||
}
|
||||
|
||||
public List<CodeElement> Implementation
|
||||
{
|
||||
get { return this.implementation; }
|
||||
}
|
||||
|
||||
public List<CodeElement> PreservedCode
|
||||
{
|
||||
get { return this.preservedCode; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void Save(CGenerator cGenerator)
|
||||
{
|
||||
CFile cFile = new CFile();
|
||||
|
||||
cFile.AddElement(new Comment("Generated by LwipMibCompiler"));
|
||||
cFile.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
cFile.AddElement(new PP_Include(LwipDefs.Incl_SnmpOpts));
|
||||
CodeContainerBase e = cFile.AddElement(new PP_If(LwipDefs.Opt_SnmpEnabled)) as CodeContainerBase;
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
// include header file
|
||||
string file = cGenerator.FileName;
|
||||
if (!String.IsNullOrWhiteSpace(file))
|
||||
{
|
||||
string ext = System.IO.Path.GetExtension(file);
|
||||
|
||||
string headerFile = !String.IsNullOrEmpty(ext) ? file.Substring(0, file.Length - ext.Length) : file;
|
||||
headerFile += ".h";
|
||||
|
||||
e.AddElement(new PP_Include(headerFile));
|
||||
}
|
||||
|
||||
// include common snmp files
|
||||
e.AddElement(new PP_Include("lwip/apps/snmp.h"));
|
||||
e.AddElement(new PP_Include("lwip/apps/snmp_core.h"));
|
||||
e.AddElement(new PP_Include("lwip/apps/snmp_scalar.h"));
|
||||
e.AddElement(new PP_Include("lwip/apps/snmp_table.h"));
|
||||
|
||||
if (this.includes.Count > 0)
|
||||
{
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
e.AddElements(this.includes);
|
||||
}
|
||||
|
||||
if (this.defines.Count > 0)
|
||||
{
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
e.AddElements(this.defines);
|
||||
}
|
||||
|
||||
if (this.declarations.Count > 0)
|
||||
{
|
||||
e.AddElement(EmptyLine.TwoLines);
|
||||
e.AddElements(this.declarations);
|
||||
}
|
||||
|
||||
if (this.implementation.Count > 0)
|
||||
{
|
||||
e.AddElement(EmptyLine.TwoLines);
|
||||
e.AddElements(this.implementation);
|
||||
}
|
||||
|
||||
if (this.preservedCode.Count > 0)
|
||||
{
|
||||
e.AddElement(EmptyLine.TwoLines);
|
||||
e.AddElement(new Comment(PreservedSectionHeader));
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
e.AddElements(this.preservedCode);
|
||||
}
|
||||
|
||||
cFile.Save(cGenerator);
|
||||
}
|
||||
|
||||
public static string GetPreservedCode(string file)
|
||||
{
|
||||
if (File.Exists(file))
|
||||
{
|
||||
using (StreamReader fileStream = new StreamReader(file))
|
||||
{
|
||||
while (!fileStream.EndOfStream)
|
||||
{
|
||||
string line = fileStream.ReadLine();
|
||||
if (line == PreservedSectionMarker)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fileStream.EndOfStream)
|
||||
{
|
||||
// skip the rest of the comment + spacer line
|
||||
fileStream.ReadLine(); // "Code below is preserved...
|
||||
fileStream.ReadLine(); // "+++++++++++++++++++++++...
|
||||
fileStream.ReadLine(); // */
|
||||
fileStream.ReadLine(); //
|
||||
|
||||
string preservedCode = fileStream.ReadToEnd();
|
||||
|
||||
int lastEndif = preservedCode.LastIndexOf("#endif", StringComparison.Ordinal);
|
||||
preservedCode = preservedCode.Remove(lastEndif);
|
||||
|
||||
return preservedCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class MibHeaderFile
|
||||
{
|
||||
|
||||
#region Fields
|
||||
|
||||
private readonly List<CodeElement> defines = new List<CodeElement>();
|
||||
private readonly List<CodeElement> includes = new List<CodeElement>();
|
||||
private readonly List<CodeElement> functionDeclarations = new List<CodeElement>();
|
||||
private readonly List<CodeElement> variableDeclarations = new List<CodeElement>();
|
||||
|
||||
#endregion
|
||||
|
||||
public MibHeaderFile()
|
||||
{
|
||||
}
|
||||
|
||||
#region Accessors
|
||||
|
||||
public List<CodeElement> Defines
|
||||
{
|
||||
get { return this.defines; }
|
||||
}
|
||||
|
||||
public List<CodeElement> Includes
|
||||
{
|
||||
get { return this.includes; }
|
||||
}
|
||||
|
||||
public List<CodeElement> FunctionDeclarations
|
||||
{
|
||||
get { return this.functionDeclarations; }
|
||||
}
|
||||
|
||||
public List<CodeElement> VariableDeclarations
|
||||
{
|
||||
get { return this.variableDeclarations; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void Save(CGenerator cGenerator)
|
||||
{
|
||||
CFile cFile = new CFile();
|
||||
|
||||
cFile.AddElement(new Comment("Generated by LwipMibCompiler"));
|
||||
cFile.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
string headerDefine = cGenerator.FileName;
|
||||
headerDefine = new Regex("[^a-zA-Z0-9]").Replace(headerDefine, "_");
|
||||
headerDefine = headerDefine.ToUpperInvariant();
|
||||
|
||||
CodeContainerBase e = cFile.AddElement(new PP_Ifdef(headerDefine, inverted: true)) as CodeContainerBase;
|
||||
e.AddElement(new PP_Macro(headerDefine, headerDefine));
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
e.AddElement(new PP_Include(LwipDefs.Incl_SnmpOpts));
|
||||
e = e.AddElement(new PP_If(LwipDefs.Opt_SnmpEnabled)) as CodeContainerBase;
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
CodeContainerBase cplusplusopen = e.AddElement(new PP_Ifdef("__cplusplus")) as CodeContainerBase;
|
||||
cplusplusopen.AddElement(new Code("extern \"C\" {"));
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
|
||||
if (this.includes.Count > 0)
|
||||
{
|
||||
e.AddElements(this.includes);
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
}
|
||||
|
||||
if (this.defines.Count > 0)
|
||||
{
|
||||
e.AddElements(this.defines);
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
}
|
||||
|
||||
e.AddElements(this.functionDeclarations, EmptyLine.SingleLine);
|
||||
e.AddElements(this.variableDeclarations, EmptyLine.SingleLine);
|
||||
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
CodeContainerBase cplusplusclose = e.AddElement(new PP_Ifdef("__cplusplus")) as CodeContainerBase;
|
||||
cplusplusclose.AddElement(new Code("}"));
|
||||
|
||||
e.AddElement(EmptyLine.SingleLine);
|
||||
cFile.Save(cGenerator);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("LwipSnmpCodeGeneration")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LwipSnmpCodeGeneration")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("8cfbbb8b-dfbb-4dd5-80c9-e07845dd58c9")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpMib : SnmpTreeNode
|
||||
{
|
||||
public uint[] BaseOid { get; set; }
|
||||
|
||||
public SnmpMib()
|
||||
: base(null)
|
||||
{
|
||||
}
|
||||
|
||||
public SnmpMib(uint[] baseOid)
|
||||
: base(null)
|
||||
{
|
||||
this.BaseOid = baseOid;
|
||||
}
|
||||
|
||||
public override string FullNodeName
|
||||
{
|
||||
get { return this.Name.ToLowerInvariant() + "_root"; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(MibCFile mibFile)
|
||||
{
|
||||
base.GenerateCode(mibFile);
|
||||
|
||||
System.Diagnostics.Debug.Assert((this.BaseOid != null) && (this.BaseOid.Length > 0));
|
||||
|
||||
// create and add BaseOID declarations
|
||||
StringBuilder boidInitialization = new StringBuilder("{");
|
||||
foreach (uint t in this.BaseOid)
|
||||
{
|
||||
boidInitialization.Append(t);
|
||||
boidInitialization.Append(",");
|
||||
}
|
||||
boidInitialization.Length -= 1;
|
||||
boidInitialization.Append("}");
|
||||
|
||||
VariableDeclaration boidDecl = new VariableDeclaration(
|
||||
new VariableType(this.Name.ToLowerInvariant() + "_base_oid", LwipDefs.Vt_U32, null, ConstType.Value, String.Empty),
|
||||
boidInitialization.ToString(), true);
|
||||
|
||||
mibFile.Declarations.Add(boidDecl);
|
||||
mibFile.Declarations.Add(GetExportDeclaration());
|
||||
}
|
||||
|
||||
public override void GenerateHeaderCode(MibHeaderFile mibHeaderFile)
|
||||
{
|
||||
mibHeaderFile.Includes.Add(new PP_Include("lwip/apps/snmp_core.h"));
|
||||
|
||||
mibHeaderFile.VariableDeclarations.Add(VariablePrototype.FromVariableDeclaration(GetExportDeclaration()));
|
||||
}
|
||||
|
||||
VariableDeclaration GetExportDeclaration()
|
||||
{
|
||||
return new VariableDeclaration(
|
||||
new VariableType(this.Name.ToLowerInvariant(), LwipDefs.Vt_StMib, null, ConstType.Value),
|
||||
String.Format("{{{0}_base_oid, LWIP_ARRAYSIZE({0}_base_oid), &{1}.node}}", this.Name.ToLowerInvariant(), this.FullNodeName));
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpNode.cs
Normal file
119
src/apps/snmp/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpNode.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public abstract class SnmpNode
|
||||
{
|
||||
public static readonly Regex NameValidationRegex = new Regex(@"^\w+$");
|
||||
|
||||
private string name;
|
||||
private readonly SnmpTreeNode parentNode;
|
||||
|
||||
protected SnmpNode(SnmpTreeNode parentNode)
|
||||
{
|
||||
this.parentNode = parentNode;
|
||||
}
|
||||
|
||||
public SnmpTreeNode ParentNode
|
||||
{
|
||||
get { return this.parentNode; }
|
||||
}
|
||||
|
||||
public virtual uint Oid { get; set; }
|
||||
|
||||
public abstract string FullNodeName
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public virtual string Name
|
||||
{
|
||||
get { return this.name; }
|
||||
set
|
||||
{
|
||||
if (value != this.name)
|
||||
{
|
||||
// check for valid name
|
||||
if (!NameValidationRegex.IsMatch(value))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Name");
|
||||
}
|
||||
|
||||
this.name = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Generate(MibCFile generatedFile, MibHeaderFile generatedHeaderFile)
|
||||
{
|
||||
int declCount = generatedFile.Declarations.Count;
|
||||
int implCount = generatedFile.Implementation.Count;
|
||||
|
||||
this.GenerateHeaderCode(generatedHeaderFile);
|
||||
this.GenerateCode(generatedFile);
|
||||
|
||||
if (generatedFile.Declarations.Count != declCount)
|
||||
{
|
||||
generatedFile.Declarations.Add(EmptyLine.SingleLine);
|
||||
}
|
||||
if (generatedFile.Implementation.Count != implCount)
|
||||
{
|
||||
generatedFile.Implementation.Add(EmptyLine.SingleLine);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void GenerateCode(MibCFile mibFile);
|
||||
|
||||
public virtual void GenerateHeaderCode(MibHeaderFile mibHeaderFile)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called after node structure creation is completed and before code is created.
|
||||
/// Offers the possibility to perform operations depending on properties/subnodes.
|
||||
/// If the node shall be transformed to another node(-type) than the own instance
|
||||
/// may be replaced on parent node by the transformed instance.
|
||||
/// Calling sequence is always from leafs up to root. So a tree node can assume
|
||||
/// that the analyze method was already called on all child nodes.
|
||||
/// E.g. a tree node only has scalar sub nodes -> it transforms itself to a scalar array node
|
||||
/// </summary>
|
||||
/// <returns>The transformed node or null if nothing shall be changed in parent structure.</returns>
|
||||
public virtual void Analyze()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public abstract class SnmpScalarAggregationNode: SnmpNode
|
||||
{
|
||||
private bool getMethodRequired = false;
|
||||
private bool testMethodRequired = false;
|
||||
private bool setMethodRequired = false;
|
||||
|
||||
protected SnmpScalarAggregationNode(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual string GetMethodName
|
||||
{
|
||||
get { return this.FullNodeName + LwipDefs.FnctSuffix_GetValue; }
|
||||
}
|
||||
|
||||
protected bool GetMethodRequired
|
||||
{
|
||||
get { return this.getMethodRequired; }
|
||||
}
|
||||
|
||||
protected virtual string TestMethodName
|
||||
{
|
||||
get { return this.FullNodeName + LwipDefs.FnctSuffix_SetTest; }
|
||||
}
|
||||
|
||||
protected bool TestMethodRequired
|
||||
{
|
||||
get { return this.testMethodRequired; }
|
||||
}
|
||||
|
||||
protected virtual string SetMethodName
|
||||
{
|
||||
get { return this.FullNodeName + LwipDefs.FnctSuffix_SetValue; }
|
||||
}
|
||||
|
||||
protected bool SetMethodRequired
|
||||
{
|
||||
get { return this.setMethodRequired; }
|
||||
}
|
||||
|
||||
protected abstract IEnumerable<SnmpScalarNode> AggregatedScalarNodes
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public override void Analyze()
|
||||
{
|
||||
base.Analyze();
|
||||
|
||||
this.getMethodRequired = false;
|
||||
this.testMethodRequired = false;
|
||||
this.setMethodRequired = false;
|
||||
|
||||
foreach (SnmpScalarNode scalarNode in this.AggregatedScalarNodes)
|
||||
{
|
||||
if ((scalarNode.AccessMode == SnmpAccessMode.ReadOnly) || (scalarNode.AccessMode == SnmpAccessMode.ReadWrite))
|
||||
{
|
||||
this.getMethodRequired = true;
|
||||
}
|
||||
if ((scalarNode.AccessMode == SnmpAccessMode.WriteOnly) || (scalarNode.AccessMode == SnmpAccessMode.ReadWrite))
|
||||
{
|
||||
this.testMethodRequired = true;
|
||||
this.setMethodRequired = true;
|
||||
}
|
||||
|
||||
if (this.getMethodRequired && this.setMethodRequired)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void GenerateAggregatedCode(MibCFile mibFile, VariableType instanceType, string switchSelector, bool generateDeclarations = true, bool generateImplementations = true)
|
||||
{
|
||||
if (this.getMethodRequired)
|
||||
{
|
||||
FunctionDeclaration getMethodDecl = new FunctionDeclaration(this.GetMethodName, isStatic: true);
|
||||
getMethodDecl.Parameter.Add(instanceType);
|
||||
getMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
getMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_U16);
|
||||
|
||||
if (generateDeclarations)
|
||||
{
|
||||
mibFile.Declarations.Add(getMethodDecl);
|
||||
}
|
||||
if (generateImplementations)
|
||||
{
|
||||
Function getMethod = Function.FromDeclaration(getMethodDecl);
|
||||
GenerateGetMethodCode(getMethod, switchSelector);
|
||||
mibFile.Implementation.Add(getMethod);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.testMethodRequired)
|
||||
{
|
||||
FunctionDeclaration testMethodDecl = new FunctionDeclaration(this.TestMethodName, isStatic: true);
|
||||
testMethodDecl.Parameter.Add(instanceType);
|
||||
testMethodDecl.Parameter.Add(new VariableType("len", LwipDefs.Vt_U16));
|
||||
testMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
testMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
|
||||
if (generateDeclarations)
|
||||
{
|
||||
mibFile.Declarations.Add(testMethodDecl);
|
||||
}
|
||||
if (generateImplementations)
|
||||
{
|
||||
Function testMethod = Function.FromDeclaration(testMethodDecl);
|
||||
GenerateTestMethodCode(testMethod, switchSelector);
|
||||
mibFile.Implementation.Add(testMethod);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.setMethodRequired)
|
||||
{
|
||||
FunctionDeclaration setMethodDecl = new FunctionDeclaration(this.SetMethodName, isStatic: true);
|
||||
setMethodDecl.Parameter.Add(instanceType);
|
||||
setMethodDecl.Parameter.Add(new VariableType("len", LwipDefs.Vt_U16));
|
||||
setMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
setMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
|
||||
if (generateDeclarations)
|
||||
{
|
||||
mibFile.Declarations.Add(setMethodDecl);
|
||||
}
|
||||
if (generateImplementations)
|
||||
{
|
||||
Function setMethod = Function.FromDeclaration(setMethodDecl);
|
||||
GenerateSetMethodCode(setMethod, switchSelector);
|
||||
mibFile.Implementation.Add(setMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void GenerateGetMethodCode(Function getMethod, string switchSelector)
|
||||
{
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)getMethod.ReturnType.Clone());
|
||||
returnValue.Type.Name = "value_len";
|
||||
getMethod.Declarations.Add(returnValue);
|
||||
Switch sw = new Switch(switchSelector);
|
||||
|
||||
bool valueVarUsed = false;
|
||||
|
||||
foreach (SnmpScalarNode scalarNode in this.AggregatedScalarNodes)
|
||||
{
|
||||
if ((scalarNode.AccessMode == SnmpAccessMode.ReadOnly) || (scalarNode.AccessMode == SnmpAccessMode.ReadWrite))
|
||||
{
|
||||
SwitchCase sc = new SwitchCase(scalarNode.Oid.ToString(CultureInfo.InvariantCulture));
|
||||
sc.Declarations.Add(new Comment(scalarNode.Name, singleLine: true));
|
||||
|
||||
scalarNode.GenerateGetMethodCode(sc, getMethod.Parameter[1].Name, ref valueVarUsed, returnValue.Type.Name);
|
||||
|
||||
sw.Switches.Add(sc);
|
||||
}
|
||||
}
|
||||
|
||||
SwitchCase scd = SwitchCase.GenerateDefault();
|
||||
scd.AddCodeFormat("LWIP_DEBUGF(SNMP_MIB_DEBUG,(\"{0}(): unknown id: %\"S32_F\"\\n\", {1}));", getMethod.Name, switchSelector);
|
||||
scd.AddCodeFormat("{0} = 0;", returnValue.Type.Name);
|
||||
sw.Switches.Add(scd);
|
||||
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
getMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
getMethod.AddElement(sw);
|
||||
|
||||
getMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
}
|
||||
|
||||
protected virtual void GenerateTestMethodCode(Function testMethod, string switchSelector)
|
||||
{
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)testMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_WrongValue);
|
||||
returnValue.Type.Name = "err";
|
||||
testMethod.Declarations.Add(returnValue);
|
||||
Switch sw = new Switch(switchSelector);
|
||||
|
||||
bool valueVarUsed = false;
|
||||
bool lenVarUsed = false;
|
||||
|
||||
foreach (SnmpScalarNode scalarNode in this.AggregatedScalarNodes)
|
||||
{
|
||||
if ((scalarNode.AccessMode == SnmpAccessMode.WriteOnly) || (scalarNode.AccessMode == SnmpAccessMode.ReadWrite))
|
||||
{
|
||||
SwitchCase sc = new SwitchCase(scalarNode.Oid.ToString(CultureInfo.InvariantCulture));
|
||||
sc.Declarations.Add(new Comment(scalarNode.Name, singleLine: true));
|
||||
|
||||
scalarNode.GenerateTestMethodCode(sc, testMethod.Parameter[2].Name, ref valueVarUsed, testMethod.Parameter[1].Name, ref lenVarUsed, returnValue.Type.Name);
|
||||
|
||||
sw.Switches.Add(sc);
|
||||
}
|
||||
}
|
||||
|
||||
SwitchCase scd = SwitchCase.GenerateDefault();
|
||||
scd.AddCodeFormat("LWIP_DEBUGF(SNMP_MIB_DEBUG,(\"{0}(): unknown id: %\"S32_F\"\\n\", {1}));", testMethod.Name, switchSelector);
|
||||
sw.Switches.Add(scd);
|
||||
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
testMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", testMethod.Parameter[2].Name);
|
||||
}
|
||||
if (!lenVarUsed)
|
||||
{
|
||||
testMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", testMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
testMethod.AddElement(sw);
|
||||
|
||||
testMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
}
|
||||
|
||||
protected virtual void GenerateSetMethodCode(Function setMethod, string switchSelector)
|
||||
{
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)setMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_Ok);
|
||||
returnValue.Type.Name = "err";
|
||||
setMethod.Declarations.Add(returnValue);
|
||||
Switch sw = new Switch(switchSelector);
|
||||
|
||||
bool valueVarUsed = false;
|
||||
bool lenVarUsed = false;
|
||||
|
||||
foreach (SnmpScalarNode scalarNode in this.AggregatedScalarNodes)
|
||||
{
|
||||
if ((scalarNode.AccessMode == SnmpAccessMode.WriteOnly) || (scalarNode.AccessMode == SnmpAccessMode.ReadWrite))
|
||||
{
|
||||
SwitchCase sc = new SwitchCase(scalarNode.Oid.ToString(CultureInfo.InvariantCulture));
|
||||
sc.Declarations.Add(new Comment(scalarNode.Name, singleLine: true));
|
||||
|
||||
scalarNode.GenerateSetMethodCode(sc, setMethod.Parameter[2].Name, ref valueVarUsed, setMethod.Parameter[1].Name, ref lenVarUsed, returnValue.Type.Name);
|
||||
|
||||
sw.Switches.Add(sc);
|
||||
}
|
||||
}
|
||||
|
||||
SwitchCase scd = SwitchCase.GenerateDefault();
|
||||
scd.AddCodeFormat("LWIP_DEBUGF(SNMP_MIB_DEBUG,(\"{0}(): unknown id: %\"S32_F\"\\n\", {1}));", setMethod.Name, switchSelector);
|
||||
sw.Switches.Add(scd);
|
||||
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
setMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", setMethod.Parameter[2].Name);
|
||||
}
|
||||
if (!lenVarUsed)
|
||||
{
|
||||
setMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", setMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
setMethod.AddElement(sw);
|
||||
|
||||
setMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarArrayNode : SnmpScalarAggregationNode
|
||||
{
|
||||
private readonly List<SnmpScalarNode> scalarNodes;
|
||||
|
||||
public SnmpScalarArrayNode(List<SnmpScalarNode> scalarNodes, SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
this.scalarNodes = scalarNodes;
|
||||
}
|
||||
|
||||
public override string FullNodeName
|
||||
{
|
||||
get { return this.Name.ToLowerInvariant() + "_scalars"; }
|
||||
}
|
||||
|
||||
protected override IEnumerable<SnmpScalarNode> AggregatedScalarNodes
|
||||
{
|
||||
get { return this.scalarNodes; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(MibCFile mibFile)
|
||||
{
|
||||
VariableType instanceType = new VariableType("node", LwipDefs.Vt_StScalarArrayNodeDef, "*", ConstType.Value);
|
||||
GenerateAggregatedCode(
|
||||
mibFile,
|
||||
instanceType,
|
||||
instanceType.Name + "->oid");
|
||||
|
||||
|
||||
// create and add node definitions
|
||||
StringBuilder nodeDefs = new StringBuilder();
|
||||
foreach (SnmpScalarNode scalarNode in this.scalarNodes)
|
||||
{
|
||||
nodeDefs.AppendFormat(" {{{0}, {1}, {2}}}, /* {3} */ \n",
|
||||
scalarNode.Oid,
|
||||
LwipDefs.GetAsn1DefForSnmpDataType(scalarNode.DataType),
|
||||
LwipDefs.GetLwipDefForSnmpAccessMode(scalarNode.AccessMode),
|
||||
scalarNode.Name);
|
||||
}
|
||||
if (nodeDefs.Length > 0)
|
||||
nodeDefs.Length--;
|
||||
|
||||
VariableDeclaration nodeDefsDecl = new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName + "_nodes", LwipDefs.Vt_StScalarArrayNodeDef, null, ConstType.Value, String.Empty),
|
||||
"{\n" + nodeDefs + "\n}" ,
|
||||
isStatic: true);
|
||||
|
||||
mibFile.Declarations.Add(nodeDefsDecl);
|
||||
|
||||
|
||||
// create and add node declaration
|
||||
string nodeInitialization = String.Format("SNMP_SCALAR_CREATE_ARRAY_NODE({0}, {1}, {2}, {3}, {4})",
|
||||
this.Oid,
|
||||
nodeDefsDecl.Type.Name,
|
||||
(this.GetMethodRequired) ? this.GetMethodName : LwipDefs.Null,
|
||||
(this.TestMethodRequired) ? this.TestMethodName : LwipDefs.Null,
|
||||
(this.SetMethodRequired) ? this.SetMethodName : LwipDefs.Null
|
||||
);
|
||||
|
||||
mibFile.Declarations.Add(new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName, LwipDefs.Vt_StScalarArrayNode, null, ConstType.Value),
|
||||
nodeInitialization,
|
||||
isStatic: true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNode: SnmpNode
|
||||
{
|
||||
protected const string LocalValueName = "v"; // name of (casted) local value variable
|
||||
|
||||
private SnmpDataType dataType;
|
||||
private SnmpAccessMode accessMode;
|
||||
private readonly List<IRestriction> restrictions = new List<IRestriction>();
|
||||
|
||||
private bool useExternalMethods = false;
|
||||
private string externalGetMethod;
|
||||
private string externalTestMethod;
|
||||
private string externalSetMethod;
|
||||
|
||||
|
||||
public SnmpScalarNode(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
}
|
||||
|
||||
public override string FullNodeName
|
||||
{
|
||||
get { return this.Name.ToLowerInvariant() + "_scalar"; }
|
||||
}
|
||||
|
||||
public SnmpDataType DataType
|
||||
{
|
||||
get { return this.dataType; }
|
||||
set { this.dataType = value; }
|
||||
}
|
||||
|
||||
public List<IRestriction> Restrictions
|
||||
{
|
||||
get { return this.restrictions; }
|
||||
}
|
||||
|
||||
public SnmpAccessMode AccessMode
|
||||
{
|
||||
get { return this.accessMode; }
|
||||
set { this.accessMode = value; }
|
||||
}
|
||||
|
||||
public virtual string FixedValueLength
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If scalar is used as a table index its value becomes part of the OID. This value returns how many OID parts are required to represent this value.
|
||||
/// </summary>
|
||||
public virtual int OidRepresentationLen
|
||||
{
|
||||
get { return -1; }
|
||||
}
|
||||
|
||||
public bool UseExternalMethods
|
||||
{
|
||||
get { return this.useExternalMethods; }
|
||||
set { this.useExternalMethods = value; }
|
||||
}
|
||||
|
||||
public string ExternalGetMethod
|
||||
{
|
||||
get { return this.externalGetMethod; }
|
||||
set { this.externalGetMethod = value; }
|
||||
}
|
||||
public string ExternalTestMethod
|
||||
{
|
||||
get { return this.externalTestMethod; }
|
||||
set { this.externalTestMethod = value; }
|
||||
}
|
||||
public string ExternalSetMethod
|
||||
{
|
||||
get { return this.externalSetMethod; }
|
||||
set { this.externalSetMethod = value; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(MibCFile mibFile)
|
||||
{
|
||||
string getMethodName;
|
||||
string testMethodName;
|
||||
string setMethodName;
|
||||
|
||||
if (this.useExternalMethods)
|
||||
{
|
||||
getMethodName = this.externalGetMethod;
|
||||
testMethodName = this.externalTestMethod;
|
||||
setMethodName = this.externalSetMethod;
|
||||
}
|
||||
else
|
||||
{
|
||||
getMethodName = LwipDefs.Null;
|
||||
testMethodName = LwipDefs.Null;
|
||||
setMethodName = LwipDefs.Null;
|
||||
|
||||
if ((this.accessMode == SnmpAccessMode.ReadWrite) || (this.accessMode == SnmpAccessMode.ReadOnly))
|
||||
{
|
||||
FunctionDeclaration getMethodDecl = new FunctionDeclaration(this.Name + LwipDefs.FnctSuffix_GetValue, isStatic: true);
|
||||
getMethodDecl.Parameter.Add(new VariableType("instance", LwipDefs.Vt_StNodeInstance, "*"));
|
||||
getMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
getMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_U16);
|
||||
mibFile.Declarations.Add(getMethodDecl);
|
||||
|
||||
Function getMethod = Function.FromDeclaration(getMethodDecl);
|
||||
getMethodName = getMethod.Name;
|
||||
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)getMethod.ReturnType.Clone());
|
||||
returnValue.Type.Name = "value_len";
|
||||
getMethod.Declarations.Add(returnValue);
|
||||
getMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getMethod.Parameter[0].Name);
|
||||
|
||||
bool valueVarUsed = false;
|
||||
GenerateGetMethodCode(getMethod, getMethod.Parameter[1].Name, ref valueVarUsed, returnValue.Type.Name);
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
getMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
getMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
|
||||
mibFile.Implementation.Add(getMethod);
|
||||
}
|
||||
|
||||
if ((this.accessMode == SnmpAccessMode.ReadWrite) || (this.accessMode == SnmpAccessMode.WriteOnly))
|
||||
{
|
||||
bool valueVarUsed;
|
||||
bool lenVarUsed;
|
||||
VariableDeclaration returnValue;
|
||||
|
||||
if (this.restrictions.Count > 0)
|
||||
{
|
||||
FunctionDeclaration testMethodDecl = new FunctionDeclaration(this.Name + LwipDefs.FnctSuffix_SetTest, isStatic: true);
|
||||
testMethodDecl.Parameter.Add(new VariableType("instance", LwipDefs.Vt_StNodeInstance, "*"));
|
||||
testMethodDecl.Parameter.Add(new VariableType("len", LwipDefs.Vt_U16));
|
||||
testMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
testMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
mibFile.Declarations.Add(testMethodDecl);
|
||||
|
||||
Function testMethod = Function.FromDeclaration(testMethodDecl);
|
||||
testMethodName = testMethod.Name;
|
||||
|
||||
returnValue = new VariableDeclaration((VariableType)testMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_WrongValue);
|
||||
returnValue.Type.Name = "err";
|
||||
testMethod.Declarations.Add(returnValue);
|
||||
testMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", testMethod.Parameter[0].Name);
|
||||
|
||||
valueVarUsed = false;
|
||||
lenVarUsed = false;
|
||||
|
||||
GenerateTestMethodCode(testMethod, testMethod.Parameter[2].Name, ref valueVarUsed, testMethod.Parameter[1].Name, ref lenVarUsed, returnValue.Type.Name);
|
||||
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
testMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", testMethod.Parameter[2].Name);
|
||||
}
|
||||
if (!lenVarUsed)
|
||||
{
|
||||
testMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", testMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
testMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
|
||||
mibFile.Implementation.Add(testMethod);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
testMethodName = LwipDefs.FnctName_SetTest_Ok;
|
||||
}
|
||||
|
||||
FunctionDeclaration setMethodDecl = null;
|
||||
setMethodDecl = new FunctionDeclaration(this.Name + LwipDefs.FnctSuffix_SetValue, isStatic: true);
|
||||
setMethodDecl.Parameter.Add(new VariableType("instance", LwipDefs.Vt_StNodeInstance, "*"));
|
||||
setMethodDecl.Parameter.Add(new VariableType("len", LwipDefs.Vt_U16));
|
||||
setMethodDecl.Parameter.Add(new VariableType("value", VariableType.VoidString, "*"));
|
||||
setMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
mibFile.Declarations.Add(setMethodDecl);
|
||||
|
||||
Function setMethod = Function.FromDeclaration(setMethodDecl);
|
||||
setMethodName = setMethod.Name;
|
||||
|
||||
returnValue = new VariableDeclaration((VariableType)setMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_Ok);
|
||||
returnValue.Type.Name = "err";
|
||||
setMethod.Declarations.Add(returnValue);
|
||||
setMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", setMethod.Parameter[0].Name);
|
||||
|
||||
valueVarUsed = false;
|
||||
lenVarUsed = false;
|
||||
|
||||
GenerateSetMethodCode(setMethod, setMethod.Parameter[2].Name, ref valueVarUsed, setMethod.Parameter[1].Name, ref lenVarUsed, returnValue.Type.Name);
|
||||
|
||||
if (!valueVarUsed)
|
||||
{
|
||||
setMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", setMethod.Parameter[2].Name);
|
||||
}
|
||||
if (!lenVarUsed)
|
||||
{
|
||||
setMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", setMethod.Parameter[1].Name);
|
||||
}
|
||||
|
||||
setMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
|
||||
mibFile.Implementation.Add(setMethod);
|
||||
}
|
||||
}
|
||||
|
||||
// create and add node declaration
|
||||
string nodeInitialization;
|
||||
if (this.accessMode == SnmpAccessMode.ReadOnly)
|
||||
{
|
||||
nodeInitialization = String.Format("SNMP_SCALAR_CREATE_NODE_READONLY({0}, {1}, {2})",
|
||||
this.Oid,
|
||||
LwipDefs.GetAsn1DefForSnmpDataType(this.dataType),
|
||||
getMethodName);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeInitialization = String.Format("SNMP_SCALAR_CREATE_NODE({0}, {1}, {2}, {3}, {4}, {5})",
|
||||
this.Oid,
|
||||
LwipDefs.GetLwipDefForSnmpAccessMode(this.accessMode),
|
||||
LwipDefs.GetAsn1DefForSnmpDataType(this.dataType),
|
||||
getMethodName,
|
||||
testMethodName,
|
||||
setMethodName);
|
||||
}
|
||||
|
||||
mibFile.Declarations.Add(new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName, LwipDefs.Vt_StScalarNode, null, ConstType.Value),
|
||||
nodeInitialization, isStatic: true));
|
||||
}
|
||||
|
||||
public virtual void GenerateGetMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string retLenVarName)
|
||||
{
|
||||
bool localValueVarUsed;
|
||||
if (GenerateValueDeclaration(container, LocalValueName, valueVarName))
|
||||
{
|
||||
valueVarUsed = true;
|
||||
localValueVarUsed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
localValueVarUsed = true; // do not generate UNUSED_ARG code
|
||||
}
|
||||
|
||||
if (this.FixedValueLength == null)
|
||||
{
|
||||
// check that value with variable length fits into buffer
|
||||
container.AddElement(new Comment(String.Format("TODO: take care that value with variable length fits into buffer: ({0} <= SNMP_MAX_VALUE_SIZE)", retLenVarName), singleLine: true));
|
||||
}
|
||||
|
||||
GenerateGetMethodCodeCore(container, LocalValueName, ref localValueVarUsed, retLenVarName);
|
||||
if (!localValueVarUsed)
|
||||
{
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0});", LocalValueName));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void GenerateGetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string retLenVarName)
|
||||
{
|
||||
container.AddElement(new Comment(String.Format("TODO: put requested value to '*{0}' here", localValueVarName), singleLine: true));
|
||||
container.AddCodeFormat("{0} = {1};",
|
||||
retLenVarName,
|
||||
(!String.IsNullOrWhiteSpace(this.FixedValueLength)) ? this.FixedValueLength : "0");
|
||||
}
|
||||
|
||||
public virtual void GenerateTestMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
if (this.Restrictions.Count > 0)
|
||||
{
|
||||
bool localVarUsed;
|
||||
if (GenerateValueDeclaration(container, LocalValueName, valueVarName))
|
||||
{
|
||||
valueVarUsed = true;
|
||||
localVarUsed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
localVarUsed = true; // do not generate UNUSED_ARG code
|
||||
}
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(this.FixedValueLength))
|
||||
{
|
||||
// check for fixed value
|
||||
container.AddCodeFormat("LWIP_ASSERT(\"Invalid length for datatype\", ({0} == {1}));", lenVarName, this.FixedValueLength);
|
||||
lenVarUsed = true;
|
||||
}
|
||||
|
||||
GenerateTestMethodCodeCore(container, LocalValueName, ref localVarUsed, lenVarName, ref lenVarUsed, retErrVarName);
|
||||
|
||||
if (!localVarUsed)
|
||||
{
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0});", LocalValueName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
container.AddCodeFormat("{0} == {1};", retErrVarName, LwipDefs.Def_ErrorCode_Ok);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void GenerateTestMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
container.AddElement(new Comment(String.Format("TODO: test new value here:\nif (*{0} == ) {1} = {2};", localValueVarName, retErrVarName, LwipDefs.Def_ErrorCode_Ok)));
|
||||
}
|
||||
|
||||
public virtual void GenerateSetMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
bool localVarUsed;
|
||||
if (GenerateValueDeclaration(container, LocalValueName, valueVarName))
|
||||
{
|
||||
valueVarUsed = true;
|
||||
localVarUsed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
localVarUsed = true; // do not generate UNUSED_ARG code
|
||||
}
|
||||
|
||||
GenerateSetMethodCodeCore(container, LocalValueName, ref localVarUsed, lenVarName, ref lenVarUsed, retErrVarName);
|
||||
|
||||
if (!localVarUsed)
|
||||
{
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0});", LocalValueName));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void GenerateSetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
container.AddElement(new Comment(String.Format("TODO: store new value contained in '*{0}' here", localValueVarName), singleLine: true));
|
||||
}
|
||||
|
||||
|
||||
protected virtual bool GenerateValueDeclaration(CodeContainerBase container, string variableName, string sourceName)
|
||||
{
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName, LwipDefs.Vt_U8, "*"),
|
||||
"(" + new VariableType(null, LwipDefs.Vt_U8, "*") + ")" + sourceName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static SnmpScalarNode CreateFromDatatype(SnmpDataType dataType, SnmpTreeNode parentNode)
|
||||
{
|
||||
switch (dataType)
|
||||
{
|
||||
case SnmpDataType.Integer:
|
||||
return new SnmpScalarNodeInt(parentNode);
|
||||
|
||||
case SnmpDataType.Gauge:
|
||||
case SnmpDataType.Counter:
|
||||
case SnmpDataType.TimeTicks:
|
||||
return new SnmpScalarNodeUint(dataType, parentNode);
|
||||
}
|
||||
|
||||
return new SnmpScalarNode(parentNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeBits : SnmpScalarNode
|
||||
{
|
||||
private readonly uint bitCount;
|
||||
|
||||
public SnmpScalarNodeBits(SnmpTreeNode parentNode, uint bitCount)
|
||||
: base(parentNode)
|
||||
{
|
||||
this.DataType = SnmpDataType.Bits;
|
||||
this.bitCount = bitCount;
|
||||
}
|
||||
|
||||
public override void GenerateGetMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string retLenVarName)
|
||||
{
|
||||
container.AddCode(String.Format(
|
||||
"{0} = snmp_encode_bits(({1} *){2}, SNMP_MAX_VALUE_SIZE, 0 /* TODO: pass real value here */, {3});",
|
||||
retLenVarName,
|
||||
LwipDefs.Vt_U8,
|
||||
valueVarName,
|
||||
this.bitCount));
|
||||
|
||||
valueVarUsed = true;
|
||||
}
|
||||
|
||||
public override void GenerateTestMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
if (this.Restrictions.Count > 0)
|
||||
{
|
||||
const string bitVarName = "bits";
|
||||
|
||||
container.Declarations.Add(new VariableDeclaration(new VariableType(bitVarName, LwipDefs.Vt_U32)));
|
||||
|
||||
IfThenElse ite = new IfThenElse(String.Format(
|
||||
"snmp_decode_bits(({0} *){1}, {2}, &{3}) == ERR_OK",
|
||||
LwipDefs.Vt_U8,
|
||||
valueVarName,
|
||||
lenVarName,
|
||||
bitVarName));
|
||||
|
||||
valueVarUsed = true;
|
||||
lenVarUsed = true;
|
||||
|
||||
StringBuilder innerIfCond = new StringBuilder();
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
innerIfCond.Append(restriction.GetCheckCodeValid(bitVarName));
|
||||
innerIfCond.Append(" || ");
|
||||
}
|
||||
|
||||
innerIfCond.Length -= 4;
|
||||
|
||||
IfThenElse innerIte = new IfThenElse(innerIfCond.ToString());
|
||||
innerIte.AddCode(String.Format("{0} = {1};", retErrVarName, LwipDefs.Def_ErrorCode_Ok));
|
||||
ite.AddElement(innerIte);
|
||||
container.AddElement(ite);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.GenerateTestMethodCode(container, valueVarName, ref valueVarUsed, lenVarName, ref lenVarUsed, retErrVarName);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateSetMethodCode(CodeContainerBase container, string valueVarName, ref bool valueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
const string bitVarName = "bits";
|
||||
|
||||
container.Declarations.Add(new VariableDeclaration(new VariableType(bitVarName, LwipDefs.Vt_U32)));
|
||||
|
||||
IfThenElse ite = new IfThenElse(String.Format(
|
||||
"snmp_decode_bits(({0} *){1}, {2}, &{3}) == ERR_OK",
|
||||
LwipDefs.Vt_U8,
|
||||
valueVarName,
|
||||
lenVarName,
|
||||
bitVarName));
|
||||
|
||||
valueVarUsed = true;
|
||||
lenVarUsed = true;
|
||||
|
||||
ite.AddElement(new Comment(String.Format("TODO: store new value contained in '{0}' here", bitVarName), singleLine: true));
|
||||
|
||||
container.AddElement(ite);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeCounter64 : SnmpScalarNode
|
||||
{
|
||||
public SnmpScalarNodeCounter64(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
this.DataType = SnmpDataType.Counter64;
|
||||
}
|
||||
|
||||
protected override bool GenerateValueDeclaration(CodeContainerBase container, string variableName, string sourceName)
|
||||
{
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName + "_high", LwipDefs.Vt_U32, "*"),
|
||||
"(" + new VariableType(null, LwipDefs.Vt_U32, "*").ToString() + ")" + sourceName));
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName + "_low", LwipDefs.Vt_U32, "*"),
|
||||
variableName + "_high + 1"));
|
||||
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0}_high);", variableName));
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0}_low);", variableName));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string FixedValueLength
|
||||
{
|
||||
get { return String.Format("(2 * sizeof({0}))", LwipDefs.Vt_U32); }
|
||||
}
|
||||
|
||||
public override int OidRepresentationLen
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeInt : SnmpScalarNode
|
||||
{
|
||||
public SnmpScalarNodeInt(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
this.DataType = SnmpDataType.Integer;
|
||||
}
|
||||
|
||||
protected override void GenerateTestMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
System.Diagnostics.Trace.Assert(this.Restrictions.Count > 0);
|
||||
|
||||
StringBuilder ifCond = new StringBuilder();
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
ifCond.Append(restriction.GetCheckCodeValid("*" + localValueVarName));
|
||||
ifCond.Append(" || ");
|
||||
|
||||
localValueVarUsed = true;
|
||||
}
|
||||
|
||||
ifCond.Length -= 4;
|
||||
|
||||
IfThenElse ite = new IfThenElse(ifCond.ToString());
|
||||
ite.AddCode(String.Format("{0} = {1};", retErrVarName, LwipDefs.Def_ErrorCode_Ok));
|
||||
container.AddElement(ite);
|
||||
}
|
||||
|
||||
protected override bool GenerateValueDeclaration(CodeContainerBase container, string variableName, string sourceName)
|
||||
{
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName, LwipDefs.Vt_S32, "*"),
|
||||
"(" + new VariableType(null, LwipDefs.Vt_S32, "*") + ")" + sourceName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string FixedValueLength
|
||||
{
|
||||
get { return String.Format("sizeof({0})", LwipDefs.Vt_S32); }
|
||||
}
|
||||
|
||||
public override int OidRepresentationLen
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeObjectIdentifier: SnmpScalarNode
|
||||
{
|
||||
public SnmpScalarNodeObjectIdentifier(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
this.DataType = SnmpDataType.ObjectIdentifier;
|
||||
}
|
||||
|
||||
protected override bool GenerateValueDeclaration(CodeContainerBase container, string variableName, string sourceName)
|
||||
{
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName, LwipDefs.Vt_U32, "*"),
|
||||
"(" + new VariableType(null, LwipDefs.Vt_U32, "*") + ")" + sourceName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void GenerateGetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string retLenVarName)
|
||||
{
|
||||
container.AddElement(new Comment(String.Format("TODO: put requested value to '*{0}' here. '{0}' has to be interpreted as {1}[]", localValueVarName, LwipDefs.Vt_U32), singleLine: true));
|
||||
container.AddElement(EmptyLine.SingleLine);
|
||||
container.AddCode(String.Format("{0} = 0; // TODO: return real value length here (should be 'numOfElements * sizeof({1})')", retLenVarName, LwipDefs.Vt_U32));
|
||||
}
|
||||
|
||||
protected override void GenerateTestMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
VariableDeclaration objIdLenVar = new VariableDeclaration(
|
||||
new VariableType(localValueVarName + "_len", LwipDefs.Vt_U8),
|
||||
String.Format("{0} / sizeof({1})", lenVarName, LwipDefs.Vt_U32));
|
||||
lenVarUsed = true;
|
||||
|
||||
container.Declarations.Add(objIdLenVar);
|
||||
|
||||
base.GenerateTestMethodCodeCore(container, localValueVarName, ref localValueVarUsed, lenVarName, ref lenVarUsed, retErrVarName);
|
||||
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0});", objIdLenVar.Type.Name));
|
||||
}
|
||||
|
||||
protected override void GenerateSetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
VariableDeclaration objIdLenVar = new VariableDeclaration(
|
||||
new VariableType(localValueVarName + "_len", LwipDefs.Vt_U8),
|
||||
String.Format("{0} / sizeof({1})", lenVarName, LwipDefs.Vt_U32));
|
||||
lenVarUsed = true;
|
||||
|
||||
container.Declarations.Add(objIdLenVar);
|
||||
|
||||
base.GenerateSetMethodCodeCore(container, localValueVarName, ref localValueVarUsed, lenVarName, ref lenVarUsed, retErrVarName);
|
||||
|
||||
container.AddCode(String.Format("LWIP_UNUSED_ARG({0});", objIdLenVar.Type.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeOctetString : SnmpScalarNode
|
||||
{
|
||||
public SnmpScalarNodeOctetString(SnmpDataType dataType, SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(
|
||||
(dataType == SnmpDataType.OctetString) ||
|
||||
(dataType == SnmpDataType.Opaque) ||
|
||||
(dataType == SnmpDataType.IpAddress));
|
||||
|
||||
this.DataType = dataType;
|
||||
}
|
||||
|
||||
protected override void GenerateGetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string retLenVarName)
|
||||
{
|
||||
if (this.Restrictions.Count > 0)
|
||||
{
|
||||
StringBuilder ifCond = new StringBuilder();
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
ifCond.Append(restriction.GetCheckCodeValid(retLenVarName));
|
||||
ifCond.Append(" || ");
|
||||
}
|
||||
|
||||
ifCond.Length -= 4;
|
||||
container.AddElement(new Comment("TODO: take care of len restrictions defined in MIB: " + ifCond, singleLine: true));
|
||||
}
|
||||
base.GenerateGetMethodCodeCore(container, localValueVarName, ref localValueVarUsed, retLenVarName);
|
||||
}
|
||||
|
||||
protected override void GenerateTestMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
System.Diagnostics.Trace.Assert(this.Restrictions.Count > 0);
|
||||
|
||||
// checks refer to length of octet string
|
||||
StringBuilder ifCond = new StringBuilder();
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
ifCond.Append(restriction.GetCheckCodeValid(lenVarName));
|
||||
ifCond.Append(" || ");
|
||||
|
||||
lenVarUsed = true;
|
||||
}
|
||||
|
||||
ifCond.Length -= 4;
|
||||
|
||||
IfThenElse ite = new IfThenElse(ifCond.ToString());
|
||||
ite.AddCode(String.Format("{0} = {1};", retErrVarName, LwipDefs.Def_ErrorCode_Ok));
|
||||
container.AddElement(ite);
|
||||
}
|
||||
|
||||
public override int OidRepresentationLen
|
||||
{
|
||||
get
|
||||
{
|
||||
// check restrictions if we are set to one fixed length
|
||||
if ((this.Restrictions != null) && (this.Restrictions.Count > 0))
|
||||
{
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
if (restriction is IsInRangeRestriction)
|
||||
{
|
||||
if ((restriction as IsInRangeRestriction).RangeStart == (restriction as IsInRangeRestriction).RangeEnd)
|
||||
{
|
||||
return (int)(restriction as IsInRangeRestriction).RangeStart;
|
||||
}
|
||||
}
|
||||
else if (restriction is IsEqualRestriction)
|
||||
{
|
||||
return (int)(restriction as IsEqualRestriction).Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1; // variable length
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeTruthValue : SnmpScalarNodeInt
|
||||
{
|
||||
public SnmpScalarNodeTruthValue(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void GenerateGetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string retLenVarName)
|
||||
{
|
||||
container.AddCodeFormat("snmp_encode_truthvalue({0}, /* TODO: put requested bool value here */ 0);", localValueVarName);
|
||||
localValueVarUsed = true;
|
||||
|
||||
container.AddCode(String.Format("{0} = {1};",
|
||||
retLenVarName,
|
||||
(!String.IsNullOrWhiteSpace(this.FixedValueLength)) ? this.FixedValueLength : "0"));
|
||||
}
|
||||
|
||||
protected override void GenerateSetMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
VariableType truthVar = new VariableType("bool_value", LwipDefs.Vt_U8);
|
||||
container.Declarations.Add(new VariableDeclaration(truthVar));
|
||||
|
||||
container.AddCodeFormat("snmp_decode_truthvalue({0}, &{1});", localValueVarName, truthVar.Name);
|
||||
localValueVarUsed = true;
|
||||
|
||||
container.AddElement(new Comment(String.Format("TODO: store new value contained in '{0}' here", truthVar.Name), singleLine: true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpScalarNodeUint : SnmpScalarNode
|
||||
{
|
||||
public SnmpScalarNodeUint(SnmpDataType dataType, SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(
|
||||
(dataType == SnmpDataType.Counter) ||
|
||||
(dataType == SnmpDataType.Gauge) ||
|
||||
(dataType == SnmpDataType.TimeTicks));
|
||||
|
||||
this.DataType = dataType;
|
||||
}
|
||||
|
||||
protected override void GenerateTestMethodCodeCore(CodeContainerBase container, string localValueVarName, ref bool localValueVarUsed, string lenVarName, ref bool lenVarUsed, string retErrVarName)
|
||||
{
|
||||
System.Diagnostics.Trace.Assert(this.Restrictions.Count > 0);
|
||||
|
||||
StringBuilder ifCond = new StringBuilder();
|
||||
foreach (IRestriction restriction in this.Restrictions)
|
||||
{
|
||||
ifCond.Append(restriction.GetCheckCodeValid("*" + localValueVarName));
|
||||
ifCond.Append(" || ");
|
||||
|
||||
localValueVarUsed = true;
|
||||
}
|
||||
|
||||
ifCond.Length -= 4;
|
||||
|
||||
IfThenElse ite = new IfThenElse(ifCond.ToString());
|
||||
ite.AddCode(String.Format("{0} = {1};", retErrVarName, LwipDefs.Def_ErrorCode_Ok));
|
||||
container.AddElement(ite);
|
||||
}
|
||||
|
||||
protected override bool GenerateValueDeclaration(CodeContainerBase container, string variableName, string sourceName)
|
||||
{
|
||||
container.AddDeclaration(new VariableDeclaration(
|
||||
new VariableType(variableName, LwipDefs.Vt_U32, "*"),
|
||||
"(" + new VariableType(null, LwipDefs.Vt_U32, "*") + ")" + sourceName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string FixedValueLength
|
||||
{
|
||||
get { return String.Format("sizeof({0})", LwipDefs.Vt_U32); }
|
||||
}
|
||||
|
||||
public override int OidRepresentationLen
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpTableNode: SnmpScalarAggregationNode
|
||||
{
|
||||
private readonly List<SnmpScalarNode> cellNodes = new List<SnmpScalarNode>();
|
||||
private readonly List<SnmpScalarNode> indexNodes = new List<SnmpScalarNode>();
|
||||
private string augmentedTableRow = null;
|
||||
|
||||
|
||||
public SnmpTableNode(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
}
|
||||
|
||||
public List<SnmpScalarNode> CellNodes
|
||||
{
|
||||
get { return cellNodes; }
|
||||
}
|
||||
|
||||
public List<SnmpScalarNode> IndexNodes
|
||||
{
|
||||
get { return indexNodes; }
|
||||
}
|
||||
|
||||
public string AugmentedTableRow
|
||||
{
|
||||
get { return this.augmentedTableRow; }
|
||||
set { this.augmentedTableRow = value; }
|
||||
}
|
||||
|
||||
public override string FullNodeName
|
||||
{
|
||||
get
|
||||
{
|
||||
string result = this.Name.ToLowerInvariant();
|
||||
if (!result.Contains("table"))
|
||||
{
|
||||
result += "_table";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
protected override IEnumerable<SnmpScalarNode> AggregatedScalarNodes
|
||||
{
|
||||
get { return this.cellNodes; }
|
||||
}
|
||||
|
||||
public override void GenerateCode(MibCFile mibFile)
|
||||
{
|
||||
FunctionDeclaration getInstanceMethodDecl = new FunctionDeclaration(this.FullNodeName + LwipDefs.FnctSuffix_GetInstance, isStatic: true);
|
||||
getInstanceMethodDecl.Parameter.Add(new VariableType("column", LwipDefs.Vt_U32, "*", ConstType.Value));
|
||||
getInstanceMethodDecl.Parameter.Add(new VariableType("row_oid", LwipDefs.Vt_U32, "*", ConstType.Value));
|
||||
getInstanceMethodDecl.Parameter.Add(new VariableType("row_oid_len", LwipDefs.Vt_U8, ""));
|
||||
getInstanceMethodDecl.Parameter.Add(new VariableType("cell_instance", LwipDefs.Vt_StNodeInstance, "*"));
|
||||
getInstanceMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
mibFile.Declarations.Add(getInstanceMethodDecl);
|
||||
|
||||
Function getInstanceMethod = Function.FromDeclaration(getInstanceMethodDecl);
|
||||
GenerateGetInstanceMethodCode(getInstanceMethod);
|
||||
mibFile.Implementation.Add(getInstanceMethod);
|
||||
|
||||
|
||||
FunctionDeclaration getNextInstanceMethodDecl = new FunctionDeclaration(this.FullNodeName + LwipDefs.FnctSuffix_GetNextInstance, isStatic: true);
|
||||
getNextInstanceMethodDecl.Parameter.Add(new VariableType("column", LwipDefs.Vt_U32, "*", ConstType.Value));
|
||||
getNextInstanceMethodDecl.Parameter.Add(new VariableType("row_oid", LwipDefs.Vt_StObjectId, "*"));
|
||||
getNextInstanceMethodDecl.Parameter.Add(new VariableType("cell_instance", LwipDefs.Vt_StNodeInstance, "*"));
|
||||
getNextInstanceMethodDecl.ReturnType = new VariableType(null, LwipDefs.Vt_Snmp_err);
|
||||
mibFile.Declarations.Add(getNextInstanceMethodDecl);
|
||||
|
||||
Function getNextInstanceMethod = Function.FromDeclaration(getNextInstanceMethodDecl);
|
||||
GenerateGetNextInstanceMethodCode(getNextInstanceMethod);
|
||||
mibFile.Implementation.Add(getNextInstanceMethod);
|
||||
|
||||
|
||||
VariableType instanceType = new VariableType("cell_instance", LwipDefs.Vt_StNodeInstance, "*");
|
||||
GenerateAggregatedCode(
|
||||
mibFile,
|
||||
instanceType,
|
||||
String.Format("SNMP_TABLE_GET_COLUMN_FROM_OID({0}->instance_oid.id)", instanceType.Name));
|
||||
|
||||
|
||||
#region create and add column/table definitions
|
||||
|
||||
StringBuilder colDefs = new StringBuilder();
|
||||
foreach (SnmpScalarNode colNode in this.cellNodes)
|
||||
{
|
||||
colDefs.AppendFormat(" {{{0}, {1}, {2}}}, /* {3} */ \n",
|
||||
colNode.Oid,
|
||||
LwipDefs.GetAsn1DefForSnmpDataType(colNode.DataType),
|
||||
LwipDefs.GetLwipDefForSnmpAccessMode(colNode.AccessMode),
|
||||
colNode.Name);
|
||||
}
|
||||
if (colDefs.Length > 0)
|
||||
{
|
||||
colDefs.Length--;
|
||||
}
|
||||
|
||||
VariableDeclaration colDefsDecl = new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName + "_columns", LwipDefs.Vt_StTableColumnDef, null, ConstType.Value, String.Empty),
|
||||
"{\n" + colDefs + "\n}",
|
||||
isStatic: true);
|
||||
|
||||
mibFile.Declarations.Add(colDefsDecl);
|
||||
|
||||
string nodeInitialization = String.Format("SNMP_TABLE_CREATE({0}, {1}, {2}, {3}, {4}, {5}, {6})",
|
||||
this.Oid,
|
||||
colDefsDecl.Type.Name,
|
||||
getInstanceMethodDecl.Name, getNextInstanceMethodDecl.Name,
|
||||
(this.GetMethodRequired) ? this.GetMethodName : LwipDefs.Null,
|
||||
(this.TestMethodRequired) ? this.TestMethodName : LwipDefs.Null,
|
||||
(this.SetMethodRequired) ? this.SetMethodName : LwipDefs.Null
|
||||
);
|
||||
|
||||
mibFile.Declarations.Add(new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName, LwipDefs.Vt_StTableNode, null, ConstType.Value),
|
||||
nodeInitialization,
|
||||
isStatic: true));
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
protected virtual void GenerateGetInstanceMethodCode(Function getInstanceMethod)
|
||||
{
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)getInstanceMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_NoSuchInstance);
|
||||
returnValue.Type.Name = "err";
|
||||
getInstanceMethod.Declarations.Add(returnValue);
|
||||
|
||||
int instanceOidLength = 0;
|
||||
StringBuilder indexColumns = new StringBuilder();
|
||||
foreach (SnmpScalarNode indexNode in this.indexNodes)
|
||||
{
|
||||
if (instanceOidLength >= 0)
|
||||
{
|
||||
if (indexNode.OidRepresentationLen >= 0)
|
||||
{
|
||||
instanceOidLength += indexNode.OidRepresentationLen;
|
||||
}
|
||||
else
|
||||
{
|
||||
// at least one index column has a variable length -> we cannot perform a static check
|
||||
instanceOidLength = -1;
|
||||
}
|
||||
}
|
||||
|
||||
indexColumns.AppendFormat(
|
||||
" {0} ({1}, OID length = {2})\n",
|
||||
indexNode.Name,
|
||||
indexNode.DataType,
|
||||
(indexNode.OidRepresentationLen >= 0) ? indexNode.OidRepresentationLen.ToString() : "variable");
|
||||
}
|
||||
if (indexColumns.Length > 0)
|
||||
{
|
||||
indexColumns.Length--;
|
||||
|
||||
getInstanceMethod.Declarations.Insert(0, new Comment(String.Format(
|
||||
"The instance OID of this table consists of following (index) column(s):\n{0}",
|
||||
indexColumns)));
|
||||
}
|
||||
|
||||
string augmentsHint = "";
|
||||
if (!String.IsNullOrWhiteSpace(this.augmentedTableRow))
|
||||
{
|
||||
augmentsHint = String.Format(
|
||||
"This table augments table '{0}'! Index columns therefore belong to table '{0}'!\n" +
|
||||
"You may simply call the '*{1}' method of this table.\n\n",
|
||||
(this.augmentedTableRow.ToLowerInvariant().EndsWith("entry")) ? this.augmentedTableRow.Substring(0, this.augmentedTableRow.Length-5) : this.augmentedTableRow,
|
||||
LwipDefs.FnctSuffix_GetInstance);
|
||||
}
|
||||
|
||||
CodeContainerBase ccb = getInstanceMethod;
|
||||
if (instanceOidLength > 0)
|
||||
{
|
||||
IfThenElse ite = new IfThenElse(String.Format("{0} == {1}", getInstanceMethod.Parameter[2].Name, instanceOidLength));
|
||||
getInstanceMethod.AddElement(ite);
|
||||
ccb = ite;
|
||||
}
|
||||
|
||||
ccb.AddCodeFormat("LWIP_UNUSED_ARG({0});", getInstanceMethod.Parameter[0].Name);
|
||||
ccb.AddCodeFormat("LWIP_UNUSED_ARG({0});", getInstanceMethod.Parameter[1].Name);
|
||||
if (instanceOidLength <= 0)
|
||||
{
|
||||
ccb.AddCodeFormat("LWIP_UNUSED_ARG({0});", getInstanceMethod.Parameter[2].Name);
|
||||
}
|
||||
ccb.AddCodeFormat("LWIP_UNUSED_ARG({0});", getInstanceMethod.Parameter[3].Name);
|
||||
|
||||
ccb.AddElement(new Comment(String.Format(
|
||||
"TODO: check if '{0}'/'{1}' params contain a valid instance oid for a row\n" +
|
||||
"If so, set '{2} = {3};'\n\n" +
|
||||
"snmp_oid_* methods may be used for easier processing of oid\n\n" +
|
||||
"{4}" +
|
||||
"In order to avoid decoding OID a second time in subsequent get_value/set_test/set_value methods,\n" +
|
||||
"you may store an arbitrary value (like a pointer to target value object) in '{5}->reference'/'{5}->reference_len'.\n" +
|
||||
"But be aware that not always a subsequent method is called -> Do NOT allocate memory here and try to release it in subsequent methods!\n\n" +
|
||||
"You also may replace function pointers in '{5}' param for get/test/set methods which contain the default values from table definition,\n" +
|
||||
"in order to provide special methods, for the currently processed cell. Changed pointers are only valid for current request.",
|
||||
getInstanceMethod.Parameter[1].Name,
|
||||
getInstanceMethod.Parameter[2].Name,
|
||||
returnValue.Type.Name,
|
||||
LwipDefs.Def_ErrorCode_Ok,
|
||||
augmentsHint,
|
||||
getInstanceMethod.Parameter[3].Name
|
||||
)));
|
||||
|
||||
getInstanceMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
}
|
||||
|
||||
protected virtual void GenerateGetNextInstanceMethodCode(Function getNextInstanceMethod)
|
||||
{
|
||||
getNextInstanceMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getNextInstanceMethod.Parameter[0].Name);
|
||||
getNextInstanceMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getNextInstanceMethod.Parameter[1].Name);
|
||||
getNextInstanceMethod.AddCodeFormat("LWIP_UNUSED_ARG({0});", getNextInstanceMethod.Parameter[2].Name);
|
||||
|
||||
VariableDeclaration returnValue = new VariableDeclaration((VariableType)getNextInstanceMethod.ReturnType.Clone(), LwipDefs.Def_ErrorCode_NoSuchInstance);
|
||||
returnValue.Type.Name = "err";
|
||||
getNextInstanceMethod.Declarations.Add(returnValue);
|
||||
|
||||
StringBuilder indexColumns = new StringBuilder();
|
||||
foreach (SnmpScalarNode indexNode in this.indexNodes)
|
||||
{
|
||||
indexColumns.AppendFormat(
|
||||
" {0} ({1}, OID length = {2})\n",
|
||||
indexNode.Name,
|
||||
indexNode.DataType,
|
||||
(indexNode.OidRepresentationLen >= 0) ? indexNode.OidRepresentationLen.ToString() : "variable");
|
||||
}
|
||||
if (indexColumns.Length > 0)
|
||||
{
|
||||
indexColumns.Length--;
|
||||
|
||||
getNextInstanceMethod.Declarations.Insert(0, new Comment(String.Format(
|
||||
"The instance OID of this table consists of following (index) column(s):\n{0}",
|
||||
indexColumns)));
|
||||
}
|
||||
|
||||
string augmentsHint = "";
|
||||
if (!String.IsNullOrWhiteSpace(this.augmentedTableRow))
|
||||
{
|
||||
augmentsHint = String.Format(
|
||||
"This table augments table '{0}'! Index columns therefore belong to table '{0}'!\n" +
|
||||
"You may simply call the '*{1}' method of this table.\n\n",
|
||||
(this.augmentedTableRow.ToLowerInvariant().EndsWith("entry")) ? this.augmentedTableRow.Substring(0, this.augmentedTableRow.Length-5) : this.augmentedTableRow,
|
||||
LwipDefs.FnctSuffix_GetNextInstance);
|
||||
}
|
||||
|
||||
getNextInstanceMethod.AddElement(new Comment(String.Format(
|
||||
"TODO: analyze '{0}->id'/'{0}->len' and return the subsequent row instance\n" +
|
||||
"Be aware that '{0}->id'/'{0}->len' must not point to a valid instance or have correct instance length.\n" +
|
||||
"If '{0}->len' is 0, return the first instance. If '{0}->len' is longer than expected, cut superfluous OID parts.\n" +
|
||||
"If a valid next instance is found, store it in '{0}->id'/'{0}->len' and set '{1} = {2};'\n\n" +
|
||||
"snmp_oid_* methods may be used for easier processing of oid\n\n" +
|
||||
"{3}" +
|
||||
"In order to avoid decoding OID a second time in subsequent get_value/set_test/set_value methods,\n" +
|
||||
"you may store an arbitrary value (like a pointer to target value object) in '{4}->reference'/'{4}->reference_len'.\n" +
|
||||
"But be aware that not always a subsequent method is called -> Do NOT allocate memory here and try to release it in subsequent methods!\n\n" +
|
||||
"You also may replace function pointers in '{4}' param for get/test/set methods which contain the default values from table definition,\n" +
|
||||
"in order to provide special methods, for the currently processed cell. Changed pointers are only valid for current request.",
|
||||
getNextInstanceMethod.Parameter[1].Name,
|
||||
returnValue.Type.Name,
|
||||
LwipDefs.Def_ErrorCode_Ok,
|
||||
augmentsHint,
|
||||
getNextInstanceMethod.Parameter[2].Name
|
||||
)));
|
||||
|
||||
getNextInstanceMethod.AddElement(new Comment(String.Format(
|
||||
"For easier processing and getting the next instance, you may use the 'snmp_next_oid_*' enumerator.\n" +
|
||||
"Simply pass all known instance OID's to it and it returns the next valid one:\n\n" +
|
||||
"{0} state;\n" +
|
||||
"{1} result_buf;\n" +
|
||||
"snmp_next_oid_init(&state, {2}->id, {2}->len, result_buf, LWIP_SNMP_OBJ_ID_LEN);\n" +
|
||||
"while ({{not all instances passed}}) {{\n" +
|
||||
" {1} test_oid;\n" +
|
||||
" {{fill test_oid to create instance oid for next instance}}\n" +
|
||||
" snmp_next_oid_check(&state, test_oid->id, test_oid->len, {{target_data_ptr}});\n" +
|
||||
"}}\n" +
|
||||
"if(state.status == SNMP_NEXT_OID_STATUS_SUCCESS) {{\n" +
|
||||
" snmp_oid_assign(row_oid, result_buf->oid, result_buf->len);\n" +
|
||||
" {3}->reference.ptr = state.reference; //==target_data_ptr, for usage in subsequent get/test/set\n" +
|
||||
" {4} = {5};\n" +
|
||||
"}}"
|
||||
,
|
||||
LwipDefs.Vt_StNextOidState,
|
||||
LwipDefs.Vt_StObjectId,
|
||||
getNextInstanceMethod.Parameter[1].Name,
|
||||
getNextInstanceMethod.Parameter[2].Name,
|
||||
returnValue.Type.Name,
|
||||
LwipDefs.Def_ErrorCode_Ok
|
||||
)));
|
||||
|
||||
getNextInstanceMethod.AddCodeFormat("return {0};", returnValue.Type.Name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Martin Hentschel <info@cl-soft.de>
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CCodeGeneration;
|
||||
|
||||
namespace LwipSnmpCodeGeneration
|
||||
{
|
||||
public class SnmpTreeNode: SnmpScalarAggregationNode
|
||||
{
|
||||
private readonly List<SnmpNode> childNodes = new List<SnmpNode>();
|
||||
private readonly List<SnmpScalarNode> childScalarNodes = new List<SnmpScalarNode>();
|
||||
private string fullOid = "";
|
||||
|
||||
public SnmpTreeNode(SnmpTreeNode parentNode)
|
||||
: base(parentNode)
|
||||
{
|
||||
}
|
||||
|
||||
public override string FullNodeName
|
||||
{
|
||||
get { return this.Name.ToLowerInvariant() + "_treenode"; }
|
||||
}
|
||||
|
||||
public string FullOid
|
||||
{
|
||||
get { return this.fullOid; }
|
||||
set { this.fullOid = value; }
|
||||
}
|
||||
|
||||
public List<SnmpNode> ChildNodes
|
||||
{
|
||||
get { return this.childNodes; }
|
||||
}
|
||||
|
||||
protected override IEnumerable<SnmpScalarNode> AggregatedScalarNodes
|
||||
{
|
||||
get { return this.childScalarNodes; }
|
||||
}
|
||||
|
||||
private void GenerateAggregatedCode(MibCFile mibFile, bool generateDeclarations, bool generateImplementations)
|
||||
{
|
||||
VariableType instanceType = new VariableType("instance", LwipDefs.Vt_StNodeInstance, "*");
|
||||
base.GenerateAggregatedCode(
|
||||
mibFile,
|
||||
instanceType,
|
||||
String.Format("{0}->node->oid", instanceType.Name),
|
||||
generateDeclarations,
|
||||
generateImplementations);
|
||||
}
|
||||
|
||||
private void GenerateAggregateMethodDeclarations(MibCFile mibFile)
|
||||
{
|
||||
if (LwipOpts.GenerateSingleAccessMethodsForTreeNodeScalars && (this.childScalarNodes.Count > 1))
|
||||
{
|
||||
GenerateAggregatedCode(mibFile, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GenerateCode(MibCFile mibFile)
|
||||
{
|
||||
string nodeInitialization;
|
||||
|
||||
if (LwipOpts.GenerateSingleAccessMethodsForTreeNodeScalars && (this.childScalarNodes.Count > 1))
|
||||
{
|
||||
GenerateAggregatedCode(mibFile, false, true);
|
||||
}
|
||||
|
||||
// create and add node declaration
|
||||
if (this.childNodes.Count > 0)
|
||||
{
|
||||
StringBuilder subnodeArrayInitialization = new StringBuilder();
|
||||
|
||||
for (int i=0; i<this.childNodes.Count; i++)
|
||||
{
|
||||
subnodeArrayInitialization.Append(" &");
|
||||
subnodeArrayInitialization.Append(this.childNodes[i].FullNodeName);
|
||||
subnodeArrayInitialization.Append(".node");
|
||||
if (!(this.childNodes[i] is SnmpTreeNode))
|
||||
{
|
||||
subnodeArrayInitialization.Append(".node");
|
||||
}
|
||||
|
||||
if (i < (this.childNodes.Count - 1))
|
||||
{
|
||||
subnodeArrayInitialization.Append(",\n");
|
||||
}
|
||||
}
|
||||
|
||||
VariableDeclaration subnodeArray = new VariableDeclaration(
|
||||
new VariableType(this.Name.ToLowerInvariant() + "_subnodes", LwipDefs.Vt_StNode, "*", ConstType.Both, String.Empty),
|
||||
"{\n" + subnodeArrayInitialization + "\n}",
|
||||
isStatic: true);
|
||||
|
||||
mibFile.Declarations.Add(subnodeArray);
|
||||
|
||||
nodeInitialization = String.Format("SNMP_CREATE_TREE_NODE({0}, {1})", this.Oid, subnodeArray.Type.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeInitialization = String.Format("SNMP_CREATE_EMPTY_TREE_NODE({0})", this.Oid);
|
||||
}
|
||||
|
||||
mibFile.Declarations.Add(new VariableDeclaration(
|
||||
new VariableType(this.FullNodeName, LwipDefs.Vt_StTreeNode, null, ConstType.Value),
|
||||
nodeInitialization,
|
||||
isStatic: true));
|
||||
}
|
||||
|
||||
public override void Analyze()
|
||||
{
|
||||
this.childScalarNodes.Clear();
|
||||
|
||||
// delegate analyze (don't use enumerator because the child node may change our child collection by e.g. removing or replacing itself)
|
||||
for (int i=this.ChildNodes.Count-1; i>=0; i--)
|
||||
{
|
||||
this.ChildNodes[i].Analyze();
|
||||
}
|
||||
|
||||
// collect scalar nodes
|
||||
foreach (SnmpNode childNode in this.childNodes)
|
||||
{
|
||||
SnmpScalarNode scalarNode = childNode as SnmpScalarNode;
|
||||
if (scalarNode != null)
|
||||
{
|
||||
this.childScalarNodes.Add(scalarNode);
|
||||
}
|
||||
}
|
||||
|
||||
base.Analyze();
|
||||
|
||||
// check if we can merge this node to a scalar array node (all childs need to be scalars)
|
||||
if (this.childNodes.Count > 0)
|
||||
{
|
||||
if (LwipOpts.GenerateScalarArrays && (this.childScalarNodes.Count == this.childNodes.Count) && (this.ParentNode != null))
|
||||
{
|
||||
SnmpScalarArrayNode scalarArrayNode = new SnmpScalarArrayNode(this.childScalarNodes, this.ParentNode);
|
||||
scalarArrayNode.Oid = this.Oid;
|
||||
scalarArrayNode.Name = this.Name;
|
||||
scalarArrayNode.Analyze();
|
||||
|
||||
for (int i=0; i<this.ParentNode.ChildNodes.Count; i++)
|
||||
{
|
||||
if (this.ParentNode.ChildNodes[i] == this)
|
||||
{
|
||||
this.ParentNode.ChildNodes.RemoveAt(i);
|
||||
this.ParentNode.ChildNodes.Insert(i, scalarArrayNode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (LwipOpts.GenerateSingleAccessMethodsForTreeNodeScalars && (this.childScalarNodes.Count > 1))
|
||||
{
|
||||
foreach (SnmpScalarNode scalarNode in this.childScalarNodes)
|
||||
{
|
||||
scalarNode.UseExternalMethods = true;
|
||||
scalarNode.ExternalGetMethod = this.GetMethodName;
|
||||
scalarNode.ExternalTestMethod = this.TestMethodName;
|
||||
scalarNode.ExternalSetMethod = this.SetMethodName;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // if (this.childNodes.Count == 0)
|
||||
{
|
||||
if (!LwipOpts.GenerateEmptyFolders && (this.ParentNode != null))
|
||||
{
|
||||
// do not generate this empty folder because it only waste (static) memory
|
||||
for (int i=0; i<this.ParentNode.ChildNodes.Count; i++)
|
||||
{
|
||||
if (this.ParentNode.ChildNodes[i] == this)
|
||||
{
|
||||
this.ParentNode.ChildNodes.RemoveAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Generate(MibCFile generatedFile, MibHeaderFile generatedHeaderFile)
|
||||
{
|
||||
// generate code of child nodes
|
||||
foreach (SnmpNode childNode in this.childNodes)
|
||||
{
|
||||
if (childNode is SnmpTreeNode)
|
||||
{
|
||||
childNode.Generate(generatedFile, generatedHeaderFile);
|
||||
}
|
||||
}
|
||||
|
||||
Comment dividerComment = new Comment(
|
||||
String.Format("--- {0} {1} -----------------------------------------------------", this.Name, this.fullOid),
|
||||
singleLine: true);
|
||||
|
||||
generatedFile.Declarations.Add(dividerComment);
|
||||
generatedFile.Implementation.Add(dividerComment);
|
||||
|
||||
this.GenerateAggregateMethodDeclarations(generatedFile);
|
||||
|
||||
foreach (SnmpNode childNode in this.childNodes)
|
||||
{
|
||||
if (!(childNode is SnmpTreeNode))
|
||||
{
|
||||
childNode.Generate(generatedFile, generatedHeaderFile);
|
||||
}
|
||||
}
|
||||
|
||||
base.Generate(generatedFile, generatedHeaderFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
|
||||
IANA-ADDRESS-FAMILY-NUMBERS-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY,
|
||||
mib-2 FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION FROM SNMPv2-TC;
|
||||
|
||||
ianaAddressFamilyNumbers MODULE-IDENTITY
|
||||
LAST-UPDATED "200203140000Z" -- March 14, 2002
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
"Postal: Internet Assigned Numbers Authority
|
||||
Internet Corporation for Assigned Names
|
||||
and Numbers
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292-6601
|
||||
USA
|
||||
|
||||
Tel: +1 310-823-9358
|
||||
E-Mail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"The MIB module defines the AddressFamilyNumbers
|
||||
textual convention."
|
||||
|
||||
-- revision history
|
||||
|
||||
REVISION "200203140000Z" -- March 14, 2002
|
||||
DESCRIPTION "AddressFamilyNumbers assignment 22 to
|
||||
fibreChannelWWPN. AddressFamilyNumbers
|
||||
assignment 23 to fibreChannelWWNN.
|
||||
AddressFamilyNumers assignment 24 to gwid."
|
||||
|
||||
REVISION "200009080000Z" -- September 8, 2000
|
||||
DESCRIPTION "AddressFamilyNumbers assignment 19 to xtpOverIpv4.
|
||||
AddressFamilyNumbers assignment 20 to xtpOverIpv6.
|
||||
AddressFamilyNumbers assignment 21 to xtpNativeModeXTP."
|
||||
|
||||
REVISION "200003010000Z" -- March 1, 2000
|
||||
DESCRIPTION "AddressFamilyNumbers assignment 17 to distinguishedName.
|
||||
AddressFamilyNumbers assignment 18 to asNumber."
|
||||
|
||||
REVISION "200002040000Z" -- February 4, 2000
|
||||
DESCRIPTION "AddressFamilyNumbers assignment 16 to dns."
|
||||
|
||||
REVISION "9908260000Z" -- August 26, 1999
|
||||
DESCRIPTION "Initial version, published as RFC 2677."
|
||||
|
||||
::= { mib-2 72 }
|
||||
|
||||
|
||||
AddressFamilyNumbers ::= TEXTUAL-CONVENTION
|
||||
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The definition of this textual convention with the
|
||||
addition of newly assigned values is published
|
||||
periodically by the IANA, in either the Assigned
|
||||
Numbers RFC, or some derivative of it specific to
|
||||
Internet Network Management number assignments.
|
||||
(The latest arrangements can be obtained by
|
||||
contacting the IANA.)
|
||||
|
||||
The enumerations are described as:
|
||||
|
||||
other(0), -- none of the following
|
||||
ipV4(1), -- IP Version 4
|
||||
ipV6(2), -- IP Version 6
|
||||
nsap(3), -- NSAP
|
||||
hdlc(4), -- (8-bit multidrop)
|
||||
bbn1822(5),
|
||||
all802(6), -- (includes all 802 media
|
||||
-- plus Ethernet 'canonical format')
|
||||
e163(7),
|
||||
e164(8), -- (SMDS, Frame Relay, ATM)
|
||||
f69(9), -- (Telex)
|
||||
x121(10), -- (X.25, Frame Relay)
|
||||
ipx(11), -- IPX (Internet Protocol Exchange)
|
||||
appleTalk(12), -- Apple Talk
|
||||
decnetIV(13), -- DEC Net Phase IV
|
||||
banyanVines(14), -- Banyan Vines
|
||||
e164withNsap(15),
|
||||
-- (E.164 with NSAP format subaddress)
|
||||
dns(16), -- (Domain Name System)
|
||||
distinguishedName(17), -- (Distinguished Name, per X.500)
|
||||
asNumber(18), -- (16-bit quantity, per the AS number space)
|
||||
xtpOverIpv4(19), -- XTP over IP version 4
|
||||
xtpOverIpv6(20), -- XTP over IP version 6
|
||||
xtpNativeModeXTP(21), -- XTP native mode XTP
|
||||
fibreChannelWWPN(22), -- Fibre Channel World-Wide Port Name
|
||||
fibreChannelWWNN(23), -- Fibre Channel World-Wide Node Name
|
||||
gwid(24), -- Gateway Identifier
|
||||
afi(25), -- AFI for L2VPN information
|
||||
reserved(65535)
|
||||
|
||||
|
||||
|
||||
Requests for new values should be made to IANA via
|
||||
email (iana&iana.org)."
|
||||
|
||||
SYNTAX INTEGER {
|
||||
other(0),
|
||||
ipV4(1),
|
||||
ipV6(2),
|
||||
nsap(3),
|
||||
hdlc(4),
|
||||
bbn1822(5),
|
||||
all802(6),
|
||||
e163(7),
|
||||
e164(8),
|
||||
f69(9),
|
||||
x121(10),
|
||||
ipx(11),
|
||||
appleTalk(12),
|
||||
decnetIV(13),
|
||||
banyanVines(14),
|
||||
e164withNsap(15),
|
||||
dns(16),
|
||||
distinguishedName(17), -- (Distinguished Name, per X.500)
|
||||
asNumber(18), -- (16-bit quantity, per the AS number space)
|
||||
xtpOverIpv4(19),
|
||||
xtpOverIpv6(20),
|
||||
xtpNativeModeXTP(21),
|
||||
fibreChannelWWPN(22),
|
||||
fibreChannelWWNN(23),
|
||||
gwid(24),
|
||||
afi(25),
|
||||
reserved(65535)
|
||||
}
|
||||
END
|
||||
345
src/apps/snmp/LwipMibCompiler/Mibs/IANA-CHARSET-MIB
Normal file
345
src/apps/snmp/LwipMibCompiler/Mibs/IANA-CHARSET-MIB
Normal file
@@ -0,0 +1,345 @@
|
||||
IANA-CHARSET-MIB DEFINITIONS ::= BEGIN
|
||||
-- http://www.iana.org/assignments/ianacharset-mib
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY,
|
||||
mib-2
|
||||
FROM SNMPv2-SMI -- [RFC2578]
|
||||
TEXTUAL-CONVENTION
|
||||
FROM SNMPv2-TC; -- [RFC2579]
|
||||
|
||||
ianaCharsetMIB MODULE-IDENTITY
|
||||
LAST-UPDATED "200705140000Z"
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO " Internet Assigned Numbers Authority
|
||||
|
||||
Postal: ICANN
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292
|
||||
|
||||
Tel: +1 310 823 9358
|
||||
E-Mail: iana&iana.org"
|
||||
|
||||
DESCRIPTION "This MIB module defines the IANACharset
|
||||
TEXTUAL-CONVENTION. The IANACharset TC is used to
|
||||
specify the encoding of string objects defined in
|
||||
a MIB.
|
||||
|
||||
Each version of this MIB will be released based on
|
||||
the IANA Charset Registry file (see RFC 2978) at
|
||||
http://www.iana.org/assignments/character-sets.
|
||||
|
||||
Note: The IANACharset TC, originally defined in
|
||||
RFC 1759, was inaccurately named CodedCharSet.
|
||||
|
||||
Note: Best practice is to define new MIB string
|
||||
objects with invariant UTF-8 (RFC 3629) syntax
|
||||
using the SnmpAdminString TC (defined in RFC 3411)
|
||||
in accordance with IETF Policy on Character Sets and
|
||||
Languages (RFC 2277).
|
||||
|
||||
Copyright (C) The Internet Society (2004). The
|
||||
initial version of this MIB module was published
|
||||
in RFC 3808; for full legal notices see the RFC
|
||||
itself. Supplementary information may be
|
||||
available on
|
||||
http://www.ietf.org/copyrights/ianamib.html."
|
||||
|
||||
-- revision history
|
||||
|
||||
REVISION "200705140000Z"
|
||||
DESCRIPTION "Registration of new charset 2107."
|
||||
|
||||
REVISION "200612070000Z"
|
||||
DESCRIPTION "Registration of new charsets numbered 118, 119,
|
||||
and 2106."
|
||||
|
||||
REVISION "200406080000Z"
|
||||
DESCRIPTION "Original version transferred from Printer MIB,
|
||||
generated from the IANA maintained assignments
|
||||
http://www.iana.org/assignments/character-sets."
|
||||
|
||||
::= { mib-2 106 }
|
||||
|
||||
IANACharset ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Specifies an IANA registered 'charset' - coded character set
|
||||
(CCS) plus optional character encoding scheme (CES) - terms
|
||||
defined in 'IANA Charset Registration Procedures' (RFC 2978).
|
||||
|
||||
Objects of this syntax are used to specify the encoding for
|
||||
string objects defined in one or more MIBs. For example, the
|
||||
prtLocalizationCharacterSet, prtInterpreterDefaultCharSetIn, and
|
||||
prtInterpreterDefaultCharSetOut objects defined in Printer MIB.
|
||||
|
||||
The current list of 'charset' names and enumerated values
|
||||
is contained in the IANA Character Set Registry at:
|
||||
|
||||
http://www.iana.org/assignments/character-sets
|
||||
|
||||
Enum names are derived from the IANA Charset Registry 'Alias'
|
||||
fields that begin with 'cs' (for character set).
|
||||
Enum values are derived from the parallel 'MIBenum' fields."
|
||||
SYNTAX INTEGER {
|
||||
other(1), -- used if the designated
|
||||
-- character set is not currently
|
||||
-- registered by IANA
|
||||
unknown(2), -- used as a default value
|
||||
csASCII(3),
|
||||
csISOLatin1(4),
|
||||
csISOLatin2(5),
|
||||
csISOLatin3(6),
|
||||
csISOLatin4(7),
|
||||
csISOLatinCyrillic(8),
|
||||
csISOLatinArabic(9),
|
||||
csISOLatinGreek(10),
|
||||
csISOLatinHebrew(11),
|
||||
csISOLatin5(12),
|
||||
csISOLatin6(13),
|
||||
csISOTextComm(14),
|
||||
csHalfWidthKatakana(15),
|
||||
csJISEncoding(16),
|
||||
csShiftJIS(17),
|
||||
csEUCPkdFmtJapanese(18),
|
||||
csEUCFixWidJapanese(19),
|
||||
csISO4UnitedKingdom(20),
|
||||
csISO11SwedishForNames(21),
|
||||
csISO15Italian(22),
|
||||
csISO17Spanish(23),
|
||||
csISO21German(24),
|
||||
csISO60DanishNorwegian(25),
|
||||
csISO69French(26),
|
||||
csISO10646UTF1(27),
|
||||
csISO646basic1983(28),
|
||||
csINVARIANT(29),
|
||||
csISO2IntlRefVersion(30),
|
||||
csNATSSEFI(31),
|
||||
csNATSSEFIADD(32),
|
||||
csNATSDANO(33),
|
||||
csNATSDANOADD(34),
|
||||
csISO10Swedish(35),
|
||||
csKSC56011987(36),
|
||||
csISO2022KR(37),
|
||||
csEUCKR(38),
|
||||
csISO2022JP(39),
|
||||
csISO2022JP2(40),
|
||||
csISO13JISC6220jp(41),
|
||||
csISO14JISC6220ro(42),
|
||||
csISO16Portuguese(43),
|
||||
csISO18Greek7Old(44),
|
||||
csISO19LatinGreek(45),
|
||||
csISO25French(46),
|
||||
csISO27LatinGreek1(47),
|
||||
csISO5427Cyrillic(48),
|
||||
csISO42JISC62261978(49),
|
||||
csISO47BSViewdata(50),
|
||||
csISO49INIS(51),
|
||||
csISO50INIS8(52),
|
||||
csISO51INISCyrillic(53),
|
||||
csISO54271981(54),
|
||||
csISO5428Greek(55),
|
||||
csISO57GB1988(56),
|
||||
csISO58GB231280(57),
|
||||
csISO61Norwegian2(58),
|
||||
csISO70VideotexSupp1(59),
|
||||
csISO84Portuguese2(60),
|
||||
csISO85Spanish2(61),
|
||||
csISO86Hungarian(62),
|
||||
csISO87JISX0208(63),
|
||||
csISO88Greek7(64),
|
||||
csISO89ASMO449(65),
|
||||
csISO90(66),
|
||||
csISO91JISC62291984a(67),
|
||||
csISO92JISC62991984b(68),
|
||||
csISO93JIS62291984badd(69),
|
||||
csISO94JIS62291984hand(70),
|
||||
csISO95JIS62291984handadd(71),
|
||||
csISO96JISC62291984kana(72),
|
||||
csISO2033(73),
|
||||
csISO99NAPLPS(74),
|
||||
csISO102T617bit(75),
|
||||
csISO103T618bit(76),
|
||||
csISO111ECMACyrillic(77),
|
||||
csa71(78),
|
||||
csa72(79),
|
||||
csISO123CSAZ24341985gr(80),
|
||||
csISO88596E(81),
|
||||
csISO88596I(82),
|
||||
csISO128T101G2(83),
|
||||
csISO88598E(84),
|
||||
csISO88598I(85),
|
||||
csISO139CSN369103(86),
|
||||
csISO141JUSIB1002(87),
|
||||
csISO143IECP271(88),
|
||||
csISO146Serbian(89),
|
||||
csISO147Macedonian(90),
|
||||
csISO150(91),
|
||||
csISO151Cuba(92),
|
||||
csISO6937Add(93),
|
||||
csISO153GOST1976874(94),
|
||||
csISO8859Supp(95),
|
||||
csISO10367Box(96),
|
||||
csISO158Lap(97),
|
||||
csISO159JISX02121990(98),
|
||||
csISO646Danish(99),
|
||||
csUSDK(100),
|
||||
csDKUS(101),
|
||||
csKSC5636(102),
|
||||
csUnicode11UTF7(103),
|
||||
csISO2022CN(104),
|
||||
csISO2022CNEXT(105),
|
||||
csUTF8(106),
|
||||
csISO885913(109),
|
||||
csISO885914(110),
|
||||
csISO885915(111),
|
||||
csISO885916(112),
|
||||
csGBK(113),
|
||||
csGB18030(114),
|
||||
csOSDEBCDICDF0415(115),
|
||||
csOSDEBCDICDF03IRV(116),
|
||||
csOSDEBCDICDF041(117),
|
||||
csISO115481(118),
|
||||
csKZ1048(119),
|
||||
csUnicode(1000),
|
||||
csUCS4(1001),
|
||||
csUnicodeASCII(1002),
|
||||
csUnicodeLatin1(1003),
|
||||
csUnicodeIBM1261(1005),
|
||||
csUnicodeIBM1268(1006),
|
||||
csUnicodeIBM1276(1007),
|
||||
csUnicodeIBM1264(1008),
|
||||
csUnicodeIBM1265(1009),
|
||||
csUnicode11(1010),
|
||||
csSCSU(1011),
|
||||
csUTF7(1012),
|
||||
csUTF16BE(1013),
|
||||
csUTF16LE(1014),
|
||||
csUTF16(1015),
|
||||
csCESU8(1016),
|
||||
csUTF32(1017),
|
||||
csUTF32BE(1018),
|
||||
csUTF32LE(1019),
|
||||
csBOCU1(1020),
|
||||
csWindows30Latin1(2000),
|
||||
csWindows31Latin1(2001),
|
||||
csWindows31Latin2(2002),
|
||||
csWindows31Latin5(2003),
|
||||
csHPRoman8(2004),
|
||||
csAdobeStandardEncoding(2005),
|
||||
csVenturaUS(2006),
|
||||
csVenturaInternational(2007),
|
||||
csDECMCS(2008),
|
||||
csPC850Multilingual(2009),
|
||||
csPCp852(2010),
|
||||
csPC8CodePage437(2011),
|
||||
csPC8DanishNorwegian(2012),
|
||||
csPC862LatinHebrew(2013),
|
||||
csPC8Turkish(2014),
|
||||
csIBMSymbols(2015),
|
||||
csIBMThai(2016),
|
||||
csHPLegal(2017),
|
||||
csHPPiFont(2018),
|
||||
csHPMath8(2019),
|
||||
csHPPSMath(2020),
|
||||
csHPDesktop(2021),
|
||||
csVenturaMath(2022),
|
||||
csMicrosoftPublishing(2023),
|
||||
csWindows31J(2024),
|
||||
csGB2312(2025),
|
||||
csBig5(2026),
|
||||
csMacintosh(2027),
|
||||
csIBM037(2028),
|
||||
csIBM038(2029),
|
||||
csIBM273(2030),
|
||||
csIBM274(2031),
|
||||
csIBM275(2032),
|
||||
csIBM277(2033),
|
||||
csIBM278(2034),
|
||||
csIBM280(2035),
|
||||
csIBM281(2036),
|
||||
csIBM284(2037),
|
||||
csIBM285(2038),
|
||||
csIBM290(2039),
|
||||
csIBM297(2040),
|
||||
csIBM420(2041),
|
||||
csIBM423(2042),
|
||||
csIBM424(2043),
|
||||
csIBM500(2044),
|
||||
csIBM851(2045),
|
||||
csIBM855(2046),
|
||||
csIBM857(2047),
|
||||
csIBM860(2048),
|
||||
csIBM861(2049),
|
||||
csIBM863(2050),
|
||||
csIBM864(2051),
|
||||
csIBM865(2052),
|
||||
csIBM868(2053),
|
||||
csIBM869(2054),
|
||||
csIBM870(2055),
|
||||
csIBM871(2056),
|
||||
csIBM880(2057),
|
||||
csIBM891(2058),
|
||||
csIBM903(2059),
|
||||
csIBBM904(2060),
|
||||
csIBM905(2061),
|
||||
csIBM918(2062),
|
||||
csIBM1026(2063),
|
||||
csIBMEBCDICATDE(2064),
|
||||
csEBCDICATDEA(2065),
|
||||
csEBCDICCAFR(2066),
|
||||
csEBCDICDKNO(2067),
|
||||
csEBCDICDKNOA(2068),
|
||||
csEBCDICFISE(2069),
|
||||
csEBCDICFISEA(2070),
|
||||
csEBCDICFR(2071),
|
||||
csEBCDICIT(2072),
|
||||
csEBCDICPT(2073),
|
||||
csEBCDICES(2074),
|
||||
csEBCDICESA(2075),
|
||||
csEBCDICESS(2076),
|
||||
csEBCDICUK(2077),
|
||||
csEBCDICUS(2078),
|
||||
csUnknown8BiT(2079),
|
||||
csMnemonic(2080),
|
||||
csMnem(2081),
|
||||
csVISCII(2082),
|
||||
csVIQR(2083),
|
||||
csKOI8R(2084),
|
||||
csHZGB2312(2085),
|
||||
csIBM866(2086),
|
||||
csPC775Baltic(2087),
|
||||
csKOI8U(2088),
|
||||
csIBM00858(2089),
|
||||
csIBM00924(2090),
|
||||
csIBM01140(2091),
|
||||
csIBM01141(2092),
|
||||
csIBM01142(2093),
|
||||
csIBM01143(2094),
|
||||
csIBM01144(2095),
|
||||
csIBM01145(2096),
|
||||
csIBM01146(2097),
|
||||
csIBM01147(2098),
|
||||
csIBM01148(2099),
|
||||
csIBM01149(2100),
|
||||
csBig5HKSCS(2101),
|
||||
csIBM1047(2102),
|
||||
csPTCP154(2103),
|
||||
csAmiga1251(2104),
|
||||
csKOI7switched(2105),
|
||||
csBRF(2106),
|
||||
csTSCII(2107),
|
||||
cswindows1250(2250),
|
||||
cswindows1251(2251),
|
||||
cswindows1252(2252),
|
||||
cswindows1253(2253),
|
||||
cswindows1254(2254),
|
||||
cswindows1255(2255),
|
||||
cswindows1256(2256),
|
||||
cswindows1257(2257),
|
||||
cswindows1258(2258),
|
||||
csTIS620(2259),
|
||||
reserved(3000)
|
||||
}
|
||||
END
|
||||
|
||||
333
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-ITU-ALARM-TC-MIB
Normal file
333
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-ITU-ALARM-TC-MIB
Normal file
@@ -0,0 +1,333 @@
|
||||
IANA-ITU-ALARM-TC-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, mib-2 FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION FROM SNMPv2-TC;
|
||||
|
||||
ianaItuAlarmNumbers MODULE-IDENTITY
|
||||
LAST-UPDATED "200409090000Z" -- September 09, 2004
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
"Postal: Internet Assigned Numbers Authority
|
||||
Internet Corporation for Assigned Names
|
||||
and Numbers
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292-6601
|
||||
USA
|
||||
|
||||
Tel: +1 310-823-9358
|
||||
E-Mail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"The MIB module defines the ITU Alarm
|
||||
textual convention for objects expected to require
|
||||
regular extension.
|
||||
|
||||
Copyright (C) The Internet Society (2004). The
|
||||
initial version of this MIB module was published
|
||||
in RFC 3877. For full legal notices see the RFC
|
||||
itself. Supplementary information may be available on:
|
||||
http://www.ietf.org/copyrights/ianamib.html"
|
||||
REVISION "200409090000Z"
|
||||
DESCRIPTION
|
||||
"Initial version, published as RFC 3877."
|
||||
::= { mib-2 119 }
|
||||
|
||||
|
||||
IANAItuProbableCause ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"ITU-T probable cause values. Duplicate values defined in
|
||||
X.733 are appended with X733 to ensure syntactic uniqueness.
|
||||
Probable cause value 0 is reserved for special purposes.
|
||||
|
||||
The Internet Assigned Number Authority (IANA) is responsible
|
||||
for the assignment of the enumerations in this TC.
|
||||
IANAItuProbableCause value of 0 is reserved for special
|
||||
purposes and MUST NOT be assigned.
|
||||
|
||||
Values of IANAItuProbableCause in the range 1 to 1023 are
|
||||
reserved for causes that correspond to ITU-T probable cause.
|
||||
|
||||
All other requests for new causes will be handled on a
|
||||
first-come, first served basis and will be assigned
|
||||
enumeration values starting with 1025.
|
||||
|
||||
Request should come in the form of well-formed
|
||||
SMI [RFC2578] for enumeration names that are unique and
|
||||
sufficiently descriptive.
|
||||
|
||||
While some effort will be taken to ensure that new probable
|
||||
causes do not conceptually duplicate existing probable
|
||||
causes it is acknowledged that the existence of conceptual
|
||||
duplicates in the starting probable cause list is an known
|
||||
industry reality.
|
||||
|
||||
To aid IANA in the administration of probable cause names
|
||||
and values, the OPS Area Director will appoint one or more
|
||||
experts to help review requests.
|
||||
|
||||
See http://www.iana.org"
|
||||
REFERENCE
|
||||
"ITU Recommendation M.3100, 'Generic Network Information
|
||||
Model', 1995
|
||||
ITU Recommendation X.733, 'Information Technology - Open
|
||||
Systems Interconnection - System Management: Alarm
|
||||
Reporting Function', 1992
|
||||
ITU Recommendation X.736, 'Information Technology - Open
|
||||
Systems Interconnection - System Management: Security
|
||||
Alarm Reporting Function', 1992"
|
||||
|
||||
SYNTAX INTEGER
|
||||
{
|
||||
-- The following probable causes were defined in M.3100
|
||||
aIS (1),
|
||||
callSetUpFailure (2),
|
||||
degradedSignal (3),
|
||||
farEndReceiverFailure (4),
|
||||
framingError (5),
|
||||
lossOfFrame (6),
|
||||
lossOfPointer (7),
|
||||
lossOfSignal (8),
|
||||
payloadTypeMismatch (9),
|
||||
transmissionError (10),
|
||||
remoteAlarmInterface (11),
|
||||
excessiveBER (12),
|
||||
pathTraceMismatch (13),
|
||||
unavailable (14),
|
||||
signalLabelMismatch (15),
|
||||
lossOfMultiFrame (16),
|
||||
receiveFailure (17),
|
||||
transmitFailure (18),
|
||||
modulationFailure (19),
|
||||
demodulationFailure (20),
|
||||
broadcastChannelFailure (21),
|
||||
connectionEstablishmentError (22),
|
||||
invalidMessageReceived (23),
|
||||
localNodeTransmissionError (24),
|
||||
remoteNodeTransmissionError (25),
|
||||
routingFailure (26),
|
||||
--Values 27-50 are reserved for communications alarm related
|
||||
--probable causes
|
||||
-- The following are used with equipment alarm.
|
||||
backplaneFailure (51),
|
||||
dataSetProblem (52),
|
||||
equipmentIdentifierDuplication (53),
|
||||
externalIFDeviceProblem (54),
|
||||
lineCardProblem (55),
|
||||
multiplexerProblem (56),
|
||||
nEIdentifierDuplication (57),
|
||||
powerProblem (58),
|
||||
processorProblem (59),
|
||||
protectionPathFailure (60),
|
||||
receiverFailure (61),
|
||||
replaceableUnitMissing (62),
|
||||
replaceableUnitTypeMismatch (63),
|
||||
synchronizationSourceMismatch (64),
|
||||
terminalProblem (65),
|
||||
timingProblem (66),
|
||||
transmitterFailure (67),
|
||||
trunkCardProblem (68),
|
||||
replaceableUnitProblem (69),
|
||||
realTimeClockFailure (70),
|
||||
--An equipment alarm to be issued if the system detects that the
|
||||
--real time clock has failed
|
||||
antennaFailure (71),
|
||||
batteryChargingFailure (72),
|
||||
diskFailure (73),
|
||||
frequencyHoppingFailure (74),
|
||||
iODeviceError (75),
|
||||
lossOfSynchronisation (76),
|
||||
lossOfRedundancy (77),
|
||||
powerSupplyFailure (78),
|
||||
signalQualityEvaluationFailure (79),
|
||||
tranceiverFailure (80),
|
||||
protectionMechanismFailure (81),
|
||||
protectingResourceFailure (82),
|
||||
-- Values 83-100 are reserved for equipment alarm related probable
|
||||
-- causes
|
||||
-- The following are used with environmental alarm.
|
||||
airCompressorFailure (101),
|
||||
airConditioningFailure (102),
|
||||
airDryerFailure (103),
|
||||
batteryDischarging (104),
|
||||
batteryFailure (105),
|
||||
commercialPowerFailure (106),
|
||||
coolingFanFailure (107),
|
||||
engineFailure (108),
|
||||
fireDetectorFailure (109),
|
||||
fuseFailure (110),
|
||||
generatorFailure (111),
|
||||
lowBatteryThreshold (112),
|
||||
pumpFailure (113),
|
||||
rectifierFailure (114),
|
||||
rectifierHighVoltage (115),
|
||||
rectifierLowFVoltage (116),
|
||||
ventilationsSystemFailure (117),
|
||||
enclosureDoorOpen (118),
|
||||
explosiveGas (119),
|
||||
fire (120),
|
||||
flood (121),
|
||||
highHumidity (122),
|
||||
highTemperature (123),
|
||||
highWind (124),
|
||||
iceBuildUp (125),
|
||||
intrusionDetection (126),
|
||||
lowFuel (127),
|
||||
lowHumidity (128),
|
||||
lowCablePressure (129),
|
||||
lowTemperatue (130),
|
||||
lowWater (131),
|
||||
smoke (132),
|
||||
toxicGas (133),
|
||||
coolingSystemFailure (134),
|
||||
externalEquipmentFailure (135),
|
||||
externalPointFailure (136),
|
||||
-- Values 137-150 are reserved for environmental alarm related
|
||||
-- probable causes
|
||||
-- The following are used with Processing error alarm.
|
||||
storageCapacityProblem (151),
|
||||
memoryMismatch (152),
|
||||
corruptData (153),
|
||||
outOfCPUCycles (154),
|
||||
sfwrEnvironmentProblem (155),
|
||||
sfwrDownloadFailure (156),
|
||||
lossOfRealTimel (157),
|
||||
--A processing error alarm to be issued after the system has
|
||||
--reinitialised. This will indicate
|
||||
--to the management systems that the view they have of the managed
|
||||
--system may no longer
|
||||
--be valid. Usage example: The managed
|
||||
--system issues this alarm after a reinitialization with severity
|
||||
--warning to inform the
|
||||
--management system about the event. No clearing notification will
|
||||
--be sent.
|
||||
applicationSubsystemFailure (158),
|
||||
configurationOrCustomisationError (159),
|
||||
databaseInconsistency (160),
|
||||
fileError (161),
|
||||
outOfMemory (162),
|
||||
softwareError (163),
|
||||
timeoutExpired (164),
|
||||
underlayingResourceUnavailable (165),
|
||||
versionMismatch (166),
|
||||
--Values 168-200 are reserved for processing error alarm related
|
||||
-- probable causes.
|
||||
bandwidthReduced (201),
|
||||
congestion (202),
|
||||
excessiveErrorRate (203),
|
||||
excessiveResponseTime (204),
|
||||
excessiveRetransmissionRate (205),
|
||||
reducedLoggingCapability (206),
|
||||
systemResourcesOverload (207 ),
|
||||
-- The following were defined X.733
|
||||
adapterError (500),
|
||||
applicationSubsystemFailture (501),
|
||||
bandwidthReducedX733 (502),
|
||||
callEstablishmentError (503),
|
||||
communicationsProtocolError (504),
|
||||
communicationsSubsystemFailure (505),
|
||||
configurationOrCustomizationError (506),
|
||||
congestionX733 (507),
|
||||
coruptData (508),
|
||||
cpuCyclesLimitExceeded (509),
|
||||
dataSetOrModemError (510),
|
||||
degradedSignalX733 (511),
|
||||
dteDceInterfaceError (512),
|
||||
enclosureDoorOpenX733 (513),
|
||||
equipmentMalfunction (514),
|
||||
excessiveVibration (515),
|
||||
fileErrorX733 (516),
|
||||
fireDetected (517),
|
||||
framingErrorX733 (518),
|
||||
heatingVentCoolingSystemProblem (519),
|
||||
humidityUnacceptable (520),
|
||||
inputOutputDeviceError (521),
|
||||
inputDeviceError (522),
|
||||
lanError (523),
|
||||
leakDetected (524),
|
||||
localNodeTransmissionErrorX733 (525),
|
||||
lossOfFrameX733 (526),
|
||||
lossOfSignalX733 (527),
|
||||
materialSupplyExhausted (528),
|
||||
multiplexerProblemX733 (529),
|
||||
outOfMemoryX733 (530),
|
||||
ouputDeviceError (531),
|
||||
performanceDegraded (532),
|
||||
powerProblems (533),
|
||||
pressureUnacceptable (534),
|
||||
processorProblems (535),
|
||||
pumpFailureX733 (536),
|
||||
queueSizeExceeded (537),
|
||||
receiveFailureX733 (538),
|
||||
receiverFailureX733 (539),
|
||||
remoteNodeTransmissionErrorX733 (540),
|
||||
resourceAtOrNearingCapacity (541),
|
||||
responseTimeExecessive (542),
|
||||
retransmissionRateExcessive (543),
|
||||
softwareErrorX733 (544),
|
||||
softwareProgramAbnormallyTerminated (545),
|
||||
softwareProgramError (546),
|
||||
storageCapacityProblemX733 (547),
|
||||
temperatureUnacceptable (548),
|
||||
thresholdCrossed (549),
|
||||
timingProblemX733 (550),
|
||||
toxicLeakDetected (551),
|
||||
transmitFailureX733 (552),
|
||||
transmiterFailure (553),
|
||||
underlyingResourceUnavailable (554),
|
||||
versionMismatchX733 (555),
|
||||
-- The following are defined in X.736
|
||||
authenticationFailure (600),
|
||||
breachOfConfidentiality (601),
|
||||
cableTamper (602),
|
||||
delayedInformation (603),
|
||||
denialOfService (604),
|
||||
duplicateInformation (605),
|
||||
informationMissing (606),
|
||||
informationModificationDetected (607),
|
||||
informationOutOfSequence (608),
|
||||
keyExpired (609),
|
||||
nonRepudiationFailure (610),
|
||||
outOfHoursActivity (611),
|
||||
outOfService (612),
|
||||
proceduralError (613),
|
||||
unauthorizedAccessAttempt (614),
|
||||
unexpectedInformation (615),
|
||||
|
||||
other (1024)
|
||||
}
|
||||
|
||||
IANAItuEventType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The ITU event Type values.
|
||||
|
||||
The Internet Assigned Number Authority (IANA) is
|
||||
responsible for the assignment of the enumerations
|
||||
in this TC.
|
||||
|
||||
Request should come in the form of well-formed
|
||||
SMI [RFC2578] for enumeration names that are unique
|
||||
and sufficiently descriptive.
|
||||
|
||||
See http://www.iana.org "
|
||||
REFERENCE
|
||||
"ITU Recommendation X.736, 'Information Technology - Open
|
||||
Systems Interconnection - System Management: Security
|
||||
Alarm Reporting Function', 1992"
|
||||
SYNTAX INTEGER
|
||||
{
|
||||
other (1),
|
||||
communicationsAlarm (2),
|
||||
qualityOfServiceAlarm (3),
|
||||
processingErrorAlarm (4),
|
||||
equipmentAlarm (5),
|
||||
environmentalAlarm (6),
|
||||
integrityViolation (7),
|
||||
operationalViolation (8),
|
||||
physicalViolation (9),
|
||||
securityServiceOrMechanismViolation (10),
|
||||
timeDomainViolation (11)
|
||||
}
|
||||
|
||||
END
|
||||
127
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-LANGUAGE-MIB
Normal file
127
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-LANGUAGE-MIB
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
IANA-LANGUAGE-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, OBJECT-IDENTITY, mib-2
|
||||
FROM SNMPv2-SMI;
|
||||
|
||||
ianaLanguages MODULE-IDENTITY
|
||||
LAST-UPDATED "200005100000Z" -- May 10, 2000
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
"Internet Assigned Numbers Authority (IANA)
|
||||
|
||||
Postal: ICANN
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292
|
||||
|
||||
Tel: +1 310 823 9358 x20
|
||||
E-Mail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"The MIB module registers object identifier values for
|
||||
well-known programming and scripting languages. Every
|
||||
language registration MUST describe the format used
|
||||
when transferring scripts written in this language.
|
||||
|
||||
Any additions or changes to the contents of this MIB
|
||||
module require Designated Expert Review as defined in
|
||||
the Guidelines for Writing IANA Considerations Section
|
||||
document. The Designated Expert will be selected by
|
||||
the IESG Area Director of the OPS Area.
|
||||
|
||||
Note, this module does not have to register all possible
|
||||
languages since languages are identified by object
|
||||
identifier values. It is therefore possible to registered
|
||||
languages in private OID trees. The references given below are not
|
||||
normative with regard to the language version. Other
|
||||
references might be better suited to describe some newer
|
||||
versions of this language. The references are only
|
||||
provided as `a pointer into the right direction'."
|
||||
|
||||
-- Revision log, in reverse chronological order
|
||||
|
||||
REVISION "200005100000Z" -- May 10, 2000
|
||||
DESCRIPTION "Import mib-2 instead of experimental, so that
|
||||
this module compiles"
|
||||
|
||||
REVISION "199909090900Z" -- September 9, 1999
|
||||
DESCRIPTION "Initial version as published at time of
|
||||
publication of RFC 2591."
|
||||
|
||||
::= { mib-2 73 }
|
||||
|
||||
|
||||
ianaLangJavaByteCode OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Java byte code to be processed by a Java virtual machine.
|
||||
A script written in Java byte code is transferred by using
|
||||
the Java archive file format (JAR)."
|
||||
REFERENCE
|
||||
"The Java Virtual Machine Specification.
|
||||
ISBN 0-201-63452-X"
|
||||
::= { ianaLanguages 1 }
|
||||
|
||||
ianaLangTcl OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Tool Command Language (Tcl). A script written in the
|
||||
Tcl language is transferred in Tcl source code format."
|
||||
REFERENCE
|
||||
"Tcl and the Tk Toolkit.
|
||||
ISBN 0-201-63337-X"
|
||||
::= { ianaLanguages 2 }
|
||||
|
||||
ianaLangPerl OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Perl language. A script written in the Perl language
|
||||
is transferred in Perl source code format."
|
||||
REFERENCE
|
||||
"Programming Perl.
|
||||
ISBN 1-56592-149-6"
|
||||
::= { ianaLanguages 3 }
|
||||
|
||||
ianaLangScheme OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Scheme language. A script written in the Scheme
|
||||
language is transferred in Scheme source code format."
|
||||
REFERENCE
|
||||
"The Revised^4 Report on the Algorithmic Language Scheme.
|
||||
MIT Press"
|
||||
::= { ianaLanguages 4 }
|
||||
|
||||
ianaLangSRSL OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The SNMP Script Language defined by SNMP Research. A
|
||||
script written in the SNMP Script Language is transferred
|
||||
in the SNMP Script Language source code format."
|
||||
::= { ianaLanguages 5 }
|
||||
|
||||
ianaLangPSL OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Patrol Script Language defined by BMC Software. A script
|
||||
written in the Patrol Script Language is transferred in the
|
||||
Patrol Script Language source code format."
|
||||
REFERENCE
|
||||
"PATROL Script Language Reference Manual, Version 3.0,
|
||||
November 30, 1995. BMC Software, Inc. 2101 City West Blvd.,
|
||||
Houston, Texas 77042."
|
||||
::= { ianaLanguages 6 }
|
||||
|
||||
ianaLangSMSL OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The Systems Management Scripting Language. A script written
|
||||
in the SMSL language is transferred in the SMSL source code
|
||||
format."
|
||||
REFERENCE
|
||||
"ISO/ITU Command Sequencer.
|
||||
ISO 10164-21 or ITU X.753"
|
||||
::= { ianaLanguages 7 }
|
||||
|
||||
END
|
||||
|
||||
67
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-MALLOC-MIB
Normal file
67
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-MALLOC-MIB
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
IANA-MALLOC-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, mib-2 FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION FROM SNMPv2-TC;
|
||||
|
||||
ianaMallocMIB MODULE-IDENTITY
|
||||
LAST-UPDATED "200301271200Z" -- January 27, 2003
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
" Internet Assigned Numbers Authority
|
||||
Internet Corporation for Assigned Names and Numbers
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292-6601
|
||||
|
||||
Phone: +1 310 823 9358
|
||||
EMail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"This MIB module defines the IANAscopeSource and
|
||||
IANAmallocRangeSource textual conventions for use in MIBs
|
||||
which need to identify ways of learning multicast scope and
|
||||
range information.
|
||||
|
||||
Any additions or changes to the contents of this MIB module
|
||||
require either publication of an RFC, or Designated Expert
|
||||
Review as defined in the Guidelines for Writing IANA
|
||||
Considerations Section document. The Designated Expert will
|
||||
be selected by the IESG Area Director(s) of the Transport
|
||||
Area."
|
||||
|
||||
-- revision log
|
||||
|
||||
REVISION "200301271200Z" -- January 27, 2003
|
||||
DESCRIPTION
|
||||
"Initial version."
|
||||
::= { mib-2 102 }
|
||||
|
||||
IANAscopeSource ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The source of multicast scope information."
|
||||
SYNTAX INTEGER {
|
||||
other(1), -- none of the following
|
||||
manual(2), -- statically configured
|
||||
local(3), -- automatically added by the system,
|
||||
-- such as a Source-Specific Multicast
|
||||
-- scope
|
||||
mzap(4), -- MZAP
|
||||
madcap(5) -- MADCAP
|
||||
}
|
||||
|
||||
IANAmallocRangeSource ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The source of multicast address allocation range
|
||||
information."
|
||||
SYNTAX INTEGER {
|
||||
other(1), -- none of the following
|
||||
manual(2), -- statically configured
|
||||
local(3) -- automatically added by the system,
|
||||
-- such as a Source-Specific Multicast
|
||||
-- range
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
770
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-MAU-MIB
Normal file
770
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-MAU-MIB
Normal file
@@ -0,0 +1,770 @@
|
||||
IANA-MAU-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, OBJECT-IDENTITY, mib-2
|
||||
FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION
|
||||
FROM SNMPv2-TC
|
||||
;
|
||||
|
||||
ianaMauMIB MODULE-IDENTITY
|
||||
LAST-UPDATED "200704210000Z" -- April 21, 2007
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO " Internet Assigned Numbers Authority
|
||||
|
||||
Postal: ICANN
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292
|
||||
|
||||
Tel: +1-310-823-9358
|
||||
EMail: iana&iana.org"
|
||||
|
||||
DESCRIPTION
|
||||
"This MIB module defines dot3MauType OBJECT-IDENTITIES and
|
||||
IANAifMauListBits, IANAifMauMediaAvailable,
|
||||
IANAifMauAutoNegCapBits, and IANAifJackType
|
||||
|
||||
TEXTUAL-CONVENTIONs, specifying enumerated values of the
|
||||
ifMauTypeListBits, ifMauMediaAvailable / rpMauMediaAvailable,
|
||||
ifMauAutoNegCapabilityBits / ifMauAutoNegCapAdvertisedBits /
|
||||
ifMauAutoNegCapReceivedBits and ifJackType / rpJackType objects
|
||||
respectively, defined in the MAU-MIB.
|
||||
|
||||
It is intended that each new MAU type, Media Availability
|
||||
state, Auto Negotiation capability and/or Jack type defined by
|
||||
the IEEE 802.3 working group and approved for publication in a
|
||||
revision of IEEE Std 802.3 will be added to this MIB module,
|
||||
provided that it is suitable for being managed by the base
|
||||
objects in the MAU-MIB. An Expert Review, as defined in
|
||||
RFC 2434 [RFC2434], is REQUIRED for such additions.
|
||||
|
||||
The following reference is used throughout this MIB module:
|
||||
|
||||
[IEEE802.3] refers to:
|
||||
IEEE Std 802.3, 2005 Edition: 'IEEE Standard for
|
||||
Information technology - Telecommunications and information
|
||||
exchange between systems - Local and metropolitan area
|
||||
networks - Specific requirements -
|
||||
Part 3: Carrier sense multiple access with collision
|
||||
detection (CSMA/CD) access method and physical layer
|
||||
specifications'.
|
||||
|
||||
This reference should be updated as appropriate when new
|
||||
MAU types, Media Availability states, Auto Negotiation
|
||||
capabilities, and/or Jack types are added to this MIB module.
|
||||
|
||||
Copyright (C) The IETF Trust (2007).
|
||||
The initial version of this MIB module was published in
|
||||
RFC 4836; for full legal notices see the RFC itself.
|
||||
Supplementary information may be available at:
|
||||
http://www.ietf.org/copyrights/ianamib.html"
|
||||
|
||||
REVISION "200704210000Z" -- April 21, 2007
|
||||
DESCRIPTION "Initial version of this MIB as published in
|
||||
RFC 4836."
|
||||
::= { mib-2 154 }
|
||||
|
||||
-- Textual Conventions
|
||||
|
||||
IANAifMauTypeListBits ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"This data type is used as the syntax of the ifMauTypeListBits
|
||||
object in the (updated) definition of MAU-MIB's ifMauTable.
|
||||
|
||||
The most recent version of this textual convention is available
|
||||
in the online version of this MIB module on the IANA web site.
|
||||
|
||||
Requests for new values should be made to IANA via email
|
||||
(iana&iana.org).
|
||||
|
||||
Note that changes in this textual convention SHALL be
|
||||
synchronized with relevant changes in the dot3MauType
|
||||
OBJECT-IDENTITIES."
|
||||
REFERENCE
|
||||
"[IEEE802.3], Section 30.5.1.1.2"
|
||||
SYNTAX BITS {
|
||||
bOther(0), -- other or unknown
|
||||
bAUI(1), -- AUI
|
||||
b10base5(2), -- 10BASE-5
|
||||
bFoirl(3), -- FOIRL
|
||||
|
||||
b10base2(4), -- 10BASE-2
|
||||
b10baseT(5), -- 10BASE-T duplex mode unknown
|
||||
b10baseFP(6), -- 10BASE-FP
|
||||
b10baseFB(7), -- 10BASE-FB
|
||||
b10baseFL(8), -- 10BASE-FL duplex mode unknown
|
||||
b10broad36(9), -- 10BROAD36
|
||||
b10baseTHD(10), -- 10BASE-T half duplex mode
|
||||
b10baseTFD(11), -- 10BASE-T full duplex mode
|
||||
b10baseFLHD(12), -- 10BASE-FL half duplex mode
|
||||
b10baseFLFD(13), -- 10BASE-FL full duplex mode
|
||||
b100baseT4(14), -- 100BASE-T4
|
||||
b100baseTXHD(15), -- 100BASE-TX half duplex mode
|
||||
b100baseTXFD(16), -- 100BASE-TX full duplex mode
|
||||
b100baseFXHD(17), -- 100BASE-FX half duplex mode
|
||||
b100baseFXFD(18), -- 100BASE-FX full duplex mode
|
||||
b100baseT2HD(19), -- 100BASE-T2 half duplex mode
|
||||
b100baseT2FD(20), -- 100BASE-T2 full duplex mode
|
||||
|
||||
b1000baseXHD(21), -- 1000BASE-X half duplex mode
|
||||
b1000baseXFD(22), -- 1000BASE-X full duplex mode
|
||||
b1000baseLXHD(23), -- 1000BASE-LX half duplex mode
|
||||
b1000baseLXFD(24), -- 1000BASE-LX full duplex mode
|
||||
b1000baseSXHD(25), -- 1000BASE-SX half duplex mode
|
||||
b1000baseSXFD(26), -- 1000BASE-SX full duplex mode
|
||||
b1000baseCXHD(27), -- 1000BASE-CX half duplex mode
|
||||
b1000baseCXFD(28), -- 1000BASE-CX full duplex mode
|
||||
b1000baseTHD(29), -- 1000BASE-T half duplex mode
|
||||
b1000baseTFD(30), -- 1000BASE-T full duplex mode
|
||||
|
||||
b10GbaseX(31), -- 10GBASE-X
|
||||
b10GbaseLX4(32), -- 10GBASE-LX4
|
||||
|
||||
b10GbaseR(33), -- 10GBASE-R
|
||||
b10GbaseER(34), -- 10GBASE-ER
|
||||
b10GbaseLR(35), -- 10GBASE-LR
|
||||
b10GbaseSR(36), -- 10GBASE-SR
|
||||
b10GbaseW(37), -- 10GBASE-W
|
||||
b10GbaseEW(38), -- 10GBASE-EW
|
||||
b10GbaseLW(39), -- 10GBASE-LW
|
||||
b10GbaseSW(40), -- 10GBASE-SW
|
||||
-- new since RFC 3636
|
||||
b10GbaseCX4(41), -- 10GBASE-CX4
|
||||
b2BaseTL(42), -- 2BASE-TL
|
||||
b10PassTS(43), -- 10PASS-TS
|
||||
b100BaseBX10D(44), -- 100BASE-BX10D
|
||||
b100BaseBX10U(45), -- 100BASE-BX10U
|
||||
b100BaseLX10(46), -- 100BASE-LX10
|
||||
b1000BaseBX10D(47), -- 1000BASE-BX10D
|
||||
b1000BaseBX10U(48), -- 1000BASE-BX10U
|
||||
b1000BaseLX10(49), -- 1000BASE-LX10
|
||||
b1000BasePX10D(50), -- 1000BASE-PX10D
|
||||
b1000BasePX10U(51), -- 1000BASE-PX10U
|
||||
b1000BasePX20D(52), -- 1000BASE-PX20D
|
||||
b1000BasePX20U(53) -- 1000BASE-PX20U
|
||||
}
|
||||
|
||||
IANAifMauMediaAvailable ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"This data type is used as the syntax of the
|
||||
ifMauMediaAvailable and rpMauMediaAvailable objects in the
|
||||
(updated) definition of MAU-MIB's ifMauTable and rpMauTable
|
||||
respectively.
|
||||
|
||||
Possible values are:
|
||||
other(1) - undefined (not listed below)
|
||||
unknown(2) - MAU's true state is unknown; e.g.,
|
||||
during initialization
|
||||
available(3) - link, light, or loopback is normal
|
||||
notAvailable(4) - link loss, low light, or no loopback
|
||||
remoteFault(5) - a fault has been detected at the
|
||||
remote end of the link. This value
|
||||
applies to 10BASE-FB, 100BASE-T4 Far
|
||||
End Fault Indication and non-specified
|
||||
remote faults from a system running
|
||||
auto-negotiation
|
||||
invalidSignal(6) - invalid signal has been received from
|
||||
the other end of the link, 10BASE-FB
|
||||
only
|
||||
remoteJabber(7) - remote fault, due to jabber
|
||||
|
||||
remoteLinkLoss(8) - remote fault, due to link loss
|
||||
remoteTest(9) - remote fault, due to test
|
||||
offline(10) - offline, Clause 37 Auto-Negotiation
|
||||
only
|
||||
autoNegError(11) - Auto-Negotiation Error, Clause 37
|
||||
Auto-Negotiation only
|
||||
pmdLinkFault(12) - PMA/PMD receive link fault. In case
|
||||
of PAF (2BASE-TL / 10PASS-TS PHYs),
|
||||
all PMEs in the aggregation group have
|
||||
detected a link fault
|
||||
wisFrameLoss(13) - WIS loss of frame, 10GBASE-W only
|
||||
wisSignalLoss(14) - WIS loss of signal, 10GBASE-W only
|
||||
pcsLinkFault(15) - PCS receive link fault
|
||||
excessiveBER(16) - PCS Bit Error Ratio monitor
|
||||
reporting excessive error ratio
|
||||
dxsLinkFault(17) - DTE XGXS receive link fault, XAUI only
|
||||
pxsLinkFault(18) - PHY XGXS receive link fault, XAUI only
|
||||
availableReduced(19) - link normal, reduced bandwidth,
|
||||
2BASE-TL / 10PASS-TS only
|
||||
ready(20) - at least one PME in the aggregation
|
||||
group is detecting handshake tones,
|
||||
2BASE-TL / 10PASS-TS only
|
||||
|
||||
If the MAU is a 10M b/s link or fiber type (FOIRL, 10BASE-T,
|
||||
10BASE-F), then this is equivalent to the link test fail
|
||||
state/low light function. For an AUI, 10BASE2, 10BASE5, or
|
||||
10BROAD36 MAU, this indicates whether loopback is detected on
|
||||
the DI circuit. The value of this attribute persists between
|
||||
packets for MAU types AUI, 10BASE5, 10BASE2, 10BROAD36, and
|
||||
10BASEFP.
|
||||
|
||||
At power-up or following a reset, the Media Available state
|
||||
will be unknown(2) for AUI, 10BASE5, 10BASE2, 10BROAD36, and
|
||||
10BASE-FP MAUs. For these MAUs loopback will be tested on each
|
||||
transmission during which no collision is detected.
|
||||
If DI is receiving input when DO returns to IDL after a
|
||||
transmission and there has been no collision during the
|
||||
transmission, then loopback will be detected. The Media
|
||||
Available state will only change during noncollided
|
||||
transmissions for AUI, 10BASE2, 10BASE5, 10BROAD36, and
|
||||
10BASE-FP MAUs.
|
||||
|
||||
For 100BASE-T2, 100BASE-T4, 100BASE-TX, 100BASE-FX,
|
||||
100BASE-LX10, and 100BASE-BX10 PHYs the enumerations match the
|
||||
states within the link integrity state diagram.
|
||||
Any MAU that implements management of [IEEE802.3] Clause
|
||||
28 Auto-Negotiation, will map remote fault indication to
|
||||
remoteFault(5).
|
||||
|
||||
Any MAU that implements management of Clause 37
|
||||
Auto-Negotiation, will map the received RF1 and RF2 bits as
|
||||
follows: Offline maps to offline(10), Link_Failure maps to
|
||||
remoteFault(5), and Auto-Negotiation Error maps to
|
||||
autoNegError(11).
|
||||
|
||||
The value remoteFault(5) applies to 10BASE-FB remote
|
||||
fault indication, the 100BASE-X far-end fault indication, and
|
||||
nonspecified remote faults from a system running Clause 28
|
||||
Auto-Negotiation.
|
||||
|
||||
The value remoteJabber(7), remoteLink loss(8), or remoteTest(9)
|
||||
SHOULD be used instead of remoteFault(5) where the reason for
|
||||
remote fault is identified in the remote signaling protocol.
|
||||
Where a Clause 22 MII or Clause 35 GMII is present, a logic
|
||||
one in the remote fault bit maps to the value remoteFault(5),
|
||||
a logic zero in the link status bit maps to the enumeration
|
||||
notAvailable(4). The value notAvailable(4) takes precedence
|
||||
over remoteFault(5).
|
||||
|
||||
For 2BASE-TL and 10PASS-TS PHYs, the value unknown(2) maps to
|
||||
the condition where the PHY (PCS with connected PMEs) is
|
||||
initializing, the value ready(20) maps to the condition where
|
||||
the interface is down and at least one PME in the aggregation
|
||||
group is ready for handshake, the value available(3) maps to
|
||||
the condition where all the PMEs in the aggregation group are
|
||||
up, the value notAvailable(4) maps to the condition where all
|
||||
the PMEs in the aggregation group are down and no handshake
|
||||
tones are detected, the value availableReduced(19) maps to the
|
||||
condition where the interface is up, a link fault is detected
|
||||
at the receive direction by one or more PMEs in the
|
||||
aggregation group, but at least one PME is up and the
|
||||
enumeration pmdLinkFault(12) maps to the condition where a link
|
||||
fault is detected at the receive direction by all of the PMEs
|
||||
in the aggregation group.
|
||||
|
||||
For 10 Gb/s the enumerations map to value of the link_fault
|
||||
variable within the Link Fault Signaling state diagram
|
||||
as follows: the value OK maps to the value available(3),
|
||||
the value Local Fault maps to the value notAvailable(4),
|
||||
and the value Remote Fault maps to the value remoteFault(5).
|
||||
The value pmdLinkFault(12), wisFrameLoss(13),
|
||||
wisSignalLoss(14), pcsLinkFault(15), excessiveBER(16), or
|
||||
dxsLinkFault(17) SHOULD be used instead of the value
|
||||
notAvailable(4), where the reason for the Local Fault state can
|
||||
be identified through the use of the Clause 45 MDIO Interface.
|
||||
Where multiple reasons for the Local Fault state can be
|
||||
identified, only the highest precedence error SHOULD be
|
||||
|
||||
reported. This precedence in descending order is as follows:
|
||||
|
||||
pxsLinkFault
|
||||
pmdLinkFault
|
||||
wisFrameLoss
|
||||
wisSignalLoss
|
||||
pcsLinkFault
|
||||
excessiveBER
|
||||
dxsLinkFault.
|
||||
|
||||
Where a Clause 45 MDIO interface is present a logic zero in
|
||||
the PMA/PMD Receive link status bit ([IEEE802.3]
|
||||
Section 45.2.1.2.2) maps to the value pmdLinkFault(12),
|
||||
logic one in the LOF status bit (Section 45.2.2.10.4) maps
|
||||
to the value wisFrameLoss(13), a logic one in the LOS
|
||||
status bit (Section 45.2.2.10.5) maps to the value
|
||||
wisSignalLoss, a logic zero in the PCS Receive
|
||||
link status bit (Section 45.2.3.2.2) maps to the value
|
||||
pcsLinkFault(15), a logic one in the 10GBASE-R PCS Latched
|
||||
high BER status bit (Section 45.2.3.12.2) maps to the value
|
||||
excessiveBER, a logic zero in the DTE XS receive link status
|
||||
bit (Section 45.2.5.2.2) maps to the value dxsLinkFault(17)
|
||||
and a logic zero in the PHY XS transmit link status bit
|
||||
(Section 45.2.4.2.2) maps to the value pxsLinkFault(18).
|
||||
|
||||
The most recent version of this textual convention is available
|
||||
in the online version of this MIB module on the IANA web site.
|
||||
|
||||
Requests for new values should be made to IANA via email
|
||||
(iana&iana.org)."
|
||||
REFERENCE
|
||||
"[IEEE802.3], Section 30.5.1.1.4"
|
||||
SYNTAX INTEGER {
|
||||
other(1),
|
||||
unknown(2),
|
||||
available(3),
|
||||
notAvailable(4),
|
||||
remoteFault(5),
|
||||
invalidSignal(6),
|
||||
remoteJabber(7),
|
||||
remoteLinkLoss(8),
|
||||
remoteTest(9),
|
||||
offline(10),
|
||||
autoNegError(11),
|
||||
pmdLinkFault(12),
|
||||
wisFrameLoss(13),
|
||||
wisSignalLoss(14),
|
||||
pcsLinkFault(15),
|
||||
|
||||
excessiveBER(16),
|
||||
dxsLinkFault(17),
|
||||
pxsLinkFault(18),
|
||||
availableReduced(19),
|
||||
ready(20)
|
||||
}
|
||||
|
||||
IANAifMauAutoNegCapBits ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"This data type is used as the syntax of the
|
||||
ifMauAutoNegCapabilityBits, ifMauAutoNegCapAdvertisedBits, and
|
||||
ifMauAutoNegCapReceivedBits objects in the (updated) definition
|
||||
of MAU-MIB's ifMauAutoNegTable.
|
||||
|
||||
The most recent version of this textual convention is available
|
||||
in the online version of this MIB module on the IANA web site.
|
||||
|
||||
Requests for new values should be made to IANA via email
|
||||
(iana&iana.org)."
|
||||
REFERENCE
|
||||
"[IEEE802.3], Section 30.6.1.1.5"
|
||||
SYNTAX BITS {
|
||||
bOther(0), -- other or unknown
|
||||
b10baseT(1), -- 10BASE-T half duplex mode
|
||||
b10baseTFD(2), -- 10BASE-T full duplex mode
|
||||
b100baseT4(3), -- 100BASE-T4
|
||||
b100baseTX(4), -- 100BASE-TX half duplex mode
|
||||
b100baseTXFD(5), -- 100BASE-TX full duplex mode
|
||||
b100baseT2(6), -- 100BASE-T2 half duplex mode
|
||||
b100baseT2FD(7), -- 100BASE-T2 full duplex mode
|
||||
bFdxPause(8), -- PAUSE for full-duplex links
|
||||
bFdxAPause(9), -- Asymmetric PAUSE for full-duplex
|
||||
-- links
|
||||
bFdxSPause(10), -- Symmetric PAUSE for full-duplex
|
||||
-- links
|
||||
bFdxBPause(11), -- Asymmetric and Symmetric PAUSE for
|
||||
-- full-duplex links
|
||||
b1000baseX(12), -- 1000BASE-X, -LX, -SX, -CX half
|
||||
-- duplex mode
|
||||
b1000baseXFD(13), -- 1000BASE-X, -LX, -SX, -CX full
|
||||
-- duplex mode
|
||||
b1000baseT(14), -- 1000BASE-T half duplex mode
|
||||
b1000baseTFD(15) -- 1000BASE-T full duplex mode
|
||||
}
|
||||
|
||||
IANAifJackType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
|
||||
DESCRIPTION
|
||||
"Common enumeration values for repeater and interface MAU
|
||||
jack types. This data type is used as the syntax of the
|
||||
ifJackType and rpJackType objects in the (updated) definition
|
||||
of MAU-MIB's ifJackTable and rpJackTable respectively.
|
||||
|
||||
Possible values are:
|
||||
other(1) - undefined or unknown
|
||||
rj45(2) - RJ45
|
||||
rj45S(3) - RJ45 shielded
|
||||
db9(4) - DB9
|
||||
bnc(5) - BNC
|
||||
fAUI(6) - AUI female
|
||||
mAUI(7) - AUI male
|
||||
fiberSC(8) - SC fiber
|
||||
fiberMIC(9) - MIC fiber
|
||||
fiberST(10) - ST fiber
|
||||
telco(11) - Telco
|
||||
mtrj(12) - MT-RJ fiber
|
||||
hssdc(13) - fiber channel style-2
|
||||
fiberLC(14) - LC fiber
|
||||
cx4(15) - IB4X for 10GBASE-CX4
|
||||
|
||||
The most recent version of this textual convention is available
|
||||
in the online version of this MIB module on the IANA web site.
|
||||
|
||||
Requests for new values should be made to IANA via email
|
||||
(iana&iana.org)."
|
||||
SYNTAX INTEGER {
|
||||
other(1),
|
||||
rj45(2),
|
||||
rj45S(3),
|
||||
db9(4),
|
||||
bnc(5),
|
||||
fAUI(6),
|
||||
mAUI(7),
|
||||
fiberSC(8),
|
||||
fiberMIC(9),
|
||||
fiberST(10),
|
||||
telco(11),
|
||||
mtrj(12),
|
||||
hssdc(13),
|
||||
fiberLC(14),
|
||||
-- new since RFC 3636
|
||||
cx4(15)
|
||||
}
|
||||
|
||||
-- OBJECT IDENTITIES for MAU types
|
||||
|
||||
-- (see rpMauType and ifMauType of MAU-MIB for usage)
|
||||
-- The following definitions has been moved from RFC 3636 and
|
||||
-- no longer appear in its revision.
|
||||
|
||||
dot3MauType OBJECT IDENTIFIER ::= { mib-2 snmpDot3MauMgt(26) 4 }
|
||||
|
||||
dot3MauTypeAUI OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "no internal MAU, view from AUI"
|
||||
REFERENCE "[IEEE802.3], Section 7"
|
||||
::= { dot3MauType 1 }
|
||||
|
||||
dot3MauType10Base5 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "thick coax MAU"
|
||||
REFERENCE "[IEEE802.3], Section 7"
|
||||
::= { dot3MauType 2 }
|
||||
|
||||
dot3MauTypeFoirl OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "FOIRL MAU"
|
||||
REFERENCE "[IEEE802.3], Section 9.9"
|
||||
::= { dot3MauType 3 }
|
||||
|
||||
dot3MauType10Base2 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "thin coax MAU"
|
||||
REFERENCE "[IEEE802.3], Section 10"
|
||||
::= { dot3MauType 4 }
|
||||
|
||||
dot3MauType10BaseT OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "UTP MAU.
|
||||
Note that it is strongly recommended that
|
||||
agents return either dot3MauType10BaseTHD or
|
||||
dot3MauType10BaseTFD if the duplex mode is
|
||||
known. However, management applications should
|
||||
be prepared to receive this MAU type value from
|
||||
older agent implementations."
|
||||
REFERENCE "[IEEE802.3], Section 14"
|
||||
::= { dot3MauType 5 }
|
||||
|
||||
dot3MauType10BaseFP OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "passive fiber MAU"
|
||||
REFERENCE "[IEEE802.3], Section 16"
|
||||
::= { dot3MauType 6 }
|
||||
|
||||
dot3MauType10BaseFB OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "sync fiber MAU"
|
||||
REFERENCE "[IEEE802.3], Section 17"
|
||||
::= { dot3MauType 7 }
|
||||
|
||||
dot3MauType10BaseFL OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "async fiber MAU.
|
||||
Note that it is strongly recommended that
|
||||
agents return either dot3MauType10BaseFLHD or
|
||||
dot3MauType10BaseFLFD if the duplex mode is
|
||||
known. However, management applications should
|
||||
be prepared to receive this MAU type value from
|
||||
older agent implementations."
|
||||
REFERENCE "[IEEE802.3], Section 18"
|
||||
::= { dot3MauType 8 }
|
||||
|
||||
dot3MauType10Broad36 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "broadband DTE MAU.
|
||||
Note that 10BROAD36 MAUs can be attached to
|
||||
interfaces but not to repeaters."
|
||||
REFERENCE "[IEEE802.3], Section 11"
|
||||
::= { dot3MauType 9 }
|
||||
|
||||
------ new since RFC 1515:
|
||||
dot3MauType10BaseTHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "UTP MAU, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 14"
|
||||
::= { dot3MauType 10 }
|
||||
|
||||
dot3MauType10BaseTFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "UTP MAU, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 14"
|
||||
::= { dot3MauType 11 }
|
||||
|
||||
dot3MauType10BaseFLHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "async fiber MAU, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 18"
|
||||
::= { dot3MauType 12 }
|
||||
|
||||
dot3MauType10BaseFLFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "async fiber MAU, full duplex mode"
|
||||
|
||||
REFERENCE "[IEEE802.3], Section 18"
|
||||
::= { dot3MauType 13 }
|
||||
|
||||
dot3MauType100BaseT4 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "4 pair category 3 UTP"
|
||||
REFERENCE "[IEEE802.3], Section 23"
|
||||
::= { dot3MauType 14 }
|
||||
|
||||
dot3MauType100BaseTXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "2 pair category 5 UTP, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 25"
|
||||
::= { dot3MauType 15 }
|
||||
|
||||
dot3MauType100BaseTXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "2 pair category 5 UTP, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 25"
|
||||
::= { dot3MauType 16 }
|
||||
|
||||
dot3MauType100BaseFXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "X fiber over PMT, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 26"
|
||||
::= { dot3MauType 17 }
|
||||
|
||||
dot3MauType100BaseFXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "X fiber over PMT, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 26"
|
||||
::= { dot3MauType 18 }
|
||||
|
||||
dot3MauType100BaseT2HD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "2 pair category 3 UTP, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 32"
|
||||
::= { dot3MauType 19 }
|
||||
|
||||
dot3MauType100BaseT2FD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "2 pair category 3 UTP, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 32"
|
||||
::= { dot3MauType 20 }
|
||||
|
||||
------ new since RFC 2239:
|
||||
dot3MauType1000BaseXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
|
||||
DESCRIPTION "PCS/PMA, unknown PMD, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 36"
|
||||
::= { dot3MauType 21 }
|
||||
|
||||
dot3MauType1000BaseXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "PCS/PMA, unknown PMD, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 36"
|
||||
::= { dot3MauType 22 }
|
||||
|
||||
dot3MauType1000BaseLXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Fiber over long-wavelength laser, half duplex
|
||||
mode"
|
||||
REFERENCE "[IEEE802.3], Section 38"
|
||||
::= { dot3MauType 23 }
|
||||
|
||||
dot3MauType1000BaseLXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Fiber over long-wavelength laser, full duplex
|
||||
mode"
|
||||
REFERENCE "[IEEE802.3], Section 38"
|
||||
::= { dot3MauType 24 }
|
||||
|
||||
dot3MauType1000BaseSXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Fiber over short-wavelength laser, half
|
||||
duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 38"
|
||||
::= { dot3MauType 25 }
|
||||
|
||||
dot3MauType1000BaseSXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Fiber over short-wavelength laser, full
|
||||
duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 38"
|
||||
::= { dot3MauType 26 }
|
||||
|
||||
dot3MauType1000BaseCXHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Copper over 150-Ohm balanced cable, half
|
||||
duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 39"
|
||||
::= { dot3MauType 27 }
|
||||
|
||||
dot3MauType1000BaseCXFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Copper over 150-Ohm balanced cable, full
|
||||
|
||||
duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 39"
|
||||
::= { dot3MauType 28 }
|
||||
|
||||
dot3MauType1000BaseTHD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Four-pair Category 5 UTP, half duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 40"
|
||||
::= { dot3MauType 29 }
|
||||
|
||||
dot3MauType1000BaseTFD OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Four-pair Category 5 UTP, full duplex mode"
|
||||
REFERENCE "[IEEE802.3], Section 40"
|
||||
::= { dot3MauType 30 }
|
||||
|
||||
------ new since RFC 2668:
|
||||
dot3MauType10GigBaseX OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "X PCS/PMA, unknown PMD."
|
||||
REFERENCE "[IEEE802.3], Section 48"
|
||||
::= { dot3MauType 31 }
|
||||
|
||||
dot3MauType10GigBaseLX4 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "X fiber over WWDM optics"
|
||||
REFERENCE "[IEEE802.3], Section 53"
|
||||
::= { dot3MauType 32 }
|
||||
|
||||
dot3MauType10GigBaseR OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "R PCS/PMA, unknown PMD."
|
||||
REFERENCE "[IEEE802.3], Section 49"
|
||||
::= { dot3MauType 33 }
|
||||
|
||||
dot3MauType10GigBaseER OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "R fiber over 1550 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 34 }
|
||||
|
||||
dot3MauType10GigBaseLR OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "R fiber over 1310 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 35 }
|
||||
|
||||
dot3MauType10GigBaseSR OBJECT-IDENTITY
|
||||
|
||||
STATUS current
|
||||
DESCRIPTION "R fiber over 850 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 36 }
|
||||
|
||||
dot3MauType10GigBaseW OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "W PCS/PMA, unknown PMD."
|
||||
REFERENCE "[IEEE802.3], Section 49 and 50"
|
||||
::= { dot3MauType 37 }
|
||||
|
||||
dot3MauType10GigBaseEW OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "W fiber over 1550 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 38 }
|
||||
|
||||
dot3MauType10GigBaseLW OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "W fiber over 1310 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 39 }
|
||||
|
||||
dot3MauType10GigBaseSW OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "W fiber over 850 nm optics"
|
||||
REFERENCE "[IEEE802.3], Section 52"
|
||||
::= { dot3MauType 40 }
|
||||
|
||||
------ new since RFC 3636:
|
||||
dot3MauType10GigBaseCX4 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "X copper over 8 pair 100-Ohm balanced cable"
|
||||
REFERENCE "[IEEE802.3], Section 54"
|
||||
::= { dot3MauType 41 }
|
||||
|
||||
dot3MauType2BaseTL OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Voice grade UTP copper, up to 2700m, optional PAF"
|
||||
REFERENCE "[IEEE802.3], Sections 61 and 63"
|
||||
::= { dot3MauType 42 }
|
||||
|
||||
dot3MauType10PassTS OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Voice grade UTP copper, up to 750m, optional PAF"
|
||||
REFERENCE "[IEEE802.3], Sections 61 and 62"
|
||||
::= { dot3MauType 43 }
|
||||
|
||||
dot3MauType100BaseBX10D OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber OLT, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 58"
|
||||
::= { dot3MauType 44 }
|
||||
|
||||
dot3MauType100BaseBX10U OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber ONU, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 58"
|
||||
::= { dot3MauType 45 }
|
||||
|
||||
dot3MauType100BaseLX10 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Two single-mode fibers, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 58"
|
||||
::= { dot3MauType 46 }
|
||||
|
||||
dot3MauType1000BaseBX10D OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber OLT, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 59"
|
||||
::= { dot3MauType 47 }
|
||||
|
||||
dot3MauType1000BaseBX10U OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber ONU, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 59"
|
||||
::= { dot3MauType 48 }
|
||||
|
||||
dot3MauType1000BaseLX10 OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "Two sigle-mode fiber, long wavelength, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 59"
|
||||
::= { dot3MauType 49 }
|
||||
|
||||
dot3MauType1000BasePX10D OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber EPON OLT, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 60"
|
||||
::= { dot3MauType 50 }
|
||||
|
||||
dot3MauType1000BasePX10U OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber EPON ONU, 10km"
|
||||
REFERENCE "[IEEE802.3], Section 60"
|
||||
::= { dot3MauType 51 }
|
||||
|
||||
dot3MauType1000BasePX20D OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber EPON OLT, 20km"
|
||||
REFERENCE "[IEEE802.3], Section 60"
|
||||
::= { dot3MauType 52 }
|
||||
|
||||
dot3MauType1000BasePX20U OBJECT-IDENTITY
|
||||
STATUS current
|
||||
DESCRIPTION "One single-mode fiber EPON ONU, 20km"
|
||||
REFERENCE "[IEEE802.3], Section 60"
|
||||
::= { dot3MauType 53 }
|
||||
|
||||
END
|
||||
1319
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-PRINTER-MIB
Normal file
1319
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-PRINTER-MIB
Normal file
File diff suppressed because it is too large
Load Diff
92
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-RTPROTO-MIB
Normal file
92
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANA-RTPROTO-MIB
Normal file
@@ -0,0 +1,92 @@
|
||||
|
||||
IANA-RTPROTO-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, mib-2 FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION FROM SNMPv2-TC;
|
||||
|
||||
ianaRtProtoMIB MODULE-IDENTITY
|
||||
LAST-UPDATED "200009260000Z" -- September 26, 2000
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
" Internet Assigned Numbers Authority
|
||||
Internet Corporation for Assigned Names and Numbers
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292-6601
|
||||
|
||||
Phone: +1 310 823 9358
|
||||
EMail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"This MIB module defines the IANAipRouteProtocol and
|
||||
IANAipMRouteProtocol textual conventions for use in MIBs
|
||||
which need to identify unicast or multicast routing
|
||||
mechanisms.
|
||||
|
||||
Any additions or changes to the contents of this MIB module
|
||||
require either publication of an RFC, or Designated Expert
|
||||
Review as defined in RFC 2434, Guidelines for Writing an
|
||||
IANA Considerations Section in RFCs. The Designated Expert
|
||||
will be selected by the IESG Area Director(s) of the Routing
|
||||
Area."
|
||||
|
||||
REVISION "200009260000Z" -- September 26, 2000
|
||||
DESCRIPTION "Original version, published in coordination
|
||||
with RFC 2932."
|
||||
|
||||
::= { mib-2 84 }
|
||||
|
||||
IANAipRouteProtocol ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
|
||||
DESCRIPTION
|
||||
"A mechanism for learning routes. Inclusion of values for
|
||||
routing protocols is not intended to imply that those
|
||||
protocols need be supported."
|
||||
SYNTAX INTEGER {
|
||||
other (1), -- not specified
|
||||
local (2), -- local interface
|
||||
netmgmt (3), -- static route
|
||||
icmp (4), -- result of ICMP Redirect
|
||||
|
||||
-- the following are all dynamic
|
||||
-- routing protocols
|
||||
|
||||
egp (5), -- Exterior Gateway Protocol
|
||||
ggp (6), -- Gateway-Gateway Protocol
|
||||
hello (7), -- FuzzBall HelloSpeak
|
||||
rip (8), -- Berkeley RIP or RIP-II
|
||||
isIs (9), -- Dual IS-IS
|
||||
esIs (10), -- ISO 9542
|
||||
ciscoIgrp (11), -- Cisco IGRP
|
||||
bbnSpfIgp (12), -- BBN SPF IGP
|
||||
ospf (13), -- Open Shortest Path First
|
||||
bgp (14), -- Border Gateway Protocol
|
||||
idpr (15), -- InterDomain Policy Routing
|
||||
ciscoEigrp (16), -- Cisco EIGRP
|
||||
dvmrp (17) -- DVMRP
|
||||
}
|
||||
|
||||
IANAipMRouteProtocol ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The multicast routing protocol. Inclusion of values for
|
||||
multicast routing protocols is not intended to imply that
|
||||
those protocols need be supported."
|
||||
SYNTAX INTEGER {
|
||||
other(1), -- none of the following
|
||||
local(2), -- e.g., manually configured
|
||||
netmgmt(3), -- set via net.mgmt protocol
|
||||
dvmrp(4),
|
||||
mospf(5),
|
||||
pimSparseDense(6), -- PIMv1, both DM and SM
|
||||
cbt(7),
|
||||
pimSparseMode(8), -- PIM-SM
|
||||
pimDenseMode(9), -- PIM-DM
|
||||
igmpOnly(10),
|
||||
bgmp(11),
|
||||
msdp(12)
|
||||
}
|
||||
|
||||
END
|
||||
|
||||
|
||||
306
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANATn3270eTC-MIB
Normal file
306
src/apps/snmp/LwipMibCompiler/Mibs/IANA/IANATn3270eTC-MIB
Normal file
@@ -0,0 +1,306 @@
|
||||
|
||||
IANATn3270eTC-MIB DEFINITIONS ::= BEGIN
|
||||
|
||||
IMPORTS
|
||||
MODULE-IDENTITY, mib-2
|
||||
FROM SNMPv2-SMI
|
||||
TEXTUAL-CONVENTION
|
||||
FROM SNMPv2-TC;
|
||||
|
||||
ianaTn3270eTcMib MODULE-IDENTITY
|
||||
LAST-UPDATED "200005100000Z" -- May 10, 2000
|
||||
ORGANIZATION "IANA"
|
||||
CONTACT-INFO
|
||||
"Internet Assigned Numbers Authority
|
||||
|
||||
Postal: ICANN
|
||||
4676 Admiralty Way, Suite 330
|
||||
Marina del Rey, CA 90292
|
||||
|
||||
Tel: +1 310 823 9358 x20
|
||||
E-Mail: iana&iana.org"
|
||||
DESCRIPTION
|
||||
"This module defines a set of textual conventions
|
||||
for use by the TN3270E-MIB and the TN3270E-RT-MIB.
|
||||
|
||||
Any additions or changes to the contents of this
|
||||
MIB module must first be discussed on the tn3270e
|
||||
working group list at: tn3270e&list.nih.gov
|
||||
and approved by one of the following TN3270E
|
||||
working group contacts:
|
||||
|
||||
Ed Bailey (co-chair) - elbailey&us.ibm.com
|
||||
Michael Boe (co-chair) - mboe&cisco.com
|
||||
Ken White - kennethw&vnet.ibm.com
|
||||
Robert Moore - remoore&us.ibm.com
|
||||
|
||||
The above list of contacts can be altered with
|
||||
the approval of the two co-chairs.
|
||||
|
||||
The Textual Conventions defined within this MIB have
|
||||
no security issues associated with them unless
|
||||
explicitly stated in their corresponding
|
||||
DESCRIPTION clause."
|
||||
|
||||
-- revision log, in reverse chronological order
|
||||
|
||||
REVISION "200005100000Z" -- May 10, 2000
|
||||
DESCRIPTION "Fix to import mib-2 instead of experimental."
|
||||
|
||||
REVISION "199909011000Z" -- September 1, 1999
|
||||
DESCRIPTION
|
||||
"Initial version transferred from the TN3270E
|
||||
working group to IANA."
|
||||
|
||||
::= { mib-2 61 }
|
||||
|
||||
|
||||
-- Textual Conventions
|
||||
|
||||
IANATn3270eAddrType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The textual convention for defining the type of a
|
||||
client address. The enumeration value unknown(0) is
|
||||
also used to indicate that no actual address is present."
|
||||
SYNTAX INTEGER {
|
||||
unknown(0),
|
||||
ipv4(1),
|
||||
ipv6(2)
|
||||
}
|
||||
|
||||
IANATn3270eAddress ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Denotes a client address. The type of client address is
|
||||
determined by use of the IANATn3270eAddrType textual
|
||||
convention.
|
||||
The length in octets of a IANATn3270eAddress object is:
|
||||
|
||||
IANATn3270eAddrType Address Length
|
||||
+++++++++++++++++++ ++++++++++++++
|
||||
unknown(0) not specified or unknown; the
|
||||
actual length of the
|
||||
IANATn3270eAddress octet string
|
||||
indicates if an address
|
||||
is present
|
||||
ipv4(1) 4 OCTETS
|
||||
ipv6(2) 16 OCTETS
|
||||
|
||||
This textual convention is similar to the TAddress
|
||||
TC defined by RFC1903 except that it allows a
|
||||
zero-length octet string and is not a full transport
|
||||
layer address."
|
||||
SYNTAX OCTET STRING (SIZE (0..255))
|
||||
|
||||
IANATn3270eClientType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The textual convention for defining the set of
|
||||
enumerations used by tn3270eTcpConnClientIdFormat
|
||||
in the TN3270E-MIB:
|
||||
|
||||
ENUMERATION OCTETs DESCRIPTION
|
||||
|
||||
none(1) 0 Not specified
|
||||
other(2) 1..512 Implementation specific
|
||||
ipv4(3) 6 4-octet IP Address plus
|
||||
2-octet TCP Port
|
||||
ipv6(4) 18 16-octet IPv6 Address
|
||||
plus 2-octet TCP Port
|
||||
domainName(5) 1..512 The DNS name of a
|
||||
client.
|
||||
truncDomainName(6) 1..512 The (truncated) DNS name
|
||||
of a client.
|
||||
string(7) 1..512 Unknown Utf8String
|
||||
certificate(8) 1..512 certificate
|
||||
userId(9) 1..8 Client's userid
|
||||
x509dn(10) 1..512 X.509 Distinguished Name
|
||||
|
||||
Representation of a certificate(8) may be lead to
|
||||
a security exposure and is NOT RECOMMENDED without
|
||||
adequate security."
|
||||
SYNTAX INTEGER {
|
||||
none(1),
|
||||
other(2),
|
||||
ipv4(3),
|
||||
ipv6(4),
|
||||
domainName(5),
|
||||
truncDomainName(6),
|
||||
string(7),
|
||||
certificate(8),
|
||||
userId(9),
|
||||
x509dn(10)
|
||||
}
|
||||
|
||||
IANATn3270Functions ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"This textual convention reflects the current set of
|
||||
TN3270 and TN3270E functions that can be negotiated
|
||||
between a server and its client:
|
||||
|
||||
RFC856
|
||||
transmitBinary The sender of this command REQUESTS
|
||||
permission to begin transmitting, or
|
||||
confirms that it will now begin
|
||||
transmitting characters which are to
|
||||
be interpreted as 8 bits of binary
|
||||
data by the receiver of the data.
|
||||
RFC860
|
||||
timingMark The sender of this command REQUESTS
|
||||
that the receiver of this command
|
||||
return a WILL TIMING-MARK in the data
|
||||
stream at the 'appropriate place'.
|
||||
RFC885
|
||||
endOfRecord The sender of this command requests
|
||||
permission to begin transmission of
|
||||
the Telnet END-OF-RECORD (EOR) code
|
||||
when transmitting data characters, or
|
||||
the sender of this command confirms it
|
||||
will now begin transmission of EORs
|
||||
with transmitted data characters.
|
||||
RFC1091
|
||||
terminalType Sender is willing to send terminal
|
||||
type information in a subsequent
|
||||
sub-negotiation.
|
||||
|
||||
RFC1041
|
||||
tn3270Regime Sender is willing to send list of
|
||||
supported 3270 Regimes in a
|
||||
subsequent sub-negotiation.
|
||||
RFC2355
|
||||
scsCtlCodes (Printer sessions only). Allows the
|
||||
use of the SNA Character Stream (SCS)
|
||||
and SCS control codes on the session.
|
||||
SCS is used with LU type 1 SNA sessions.
|
||||
dataStreamCtl (Printer sessions only). Allows the use
|
||||
of the standard 3270 data stream. This
|
||||
corresponds to LU type 3 SNA sessions.
|
||||
responses Provides support for positive and
|
||||
negative response handling. Allows the
|
||||
server to reflect to the client any and
|
||||
all definite, exception, and no response
|
||||
requests sent by the host application.
|
||||
bindImage Allows the server to send the SNA Bind
|
||||
image and Unbind notification to the
|
||||
client.
|
||||
sysreq Allows the client and server to emulate
|
||||
some (or all, depending on the server) of
|
||||
the functions of the SYSREQ key in an SNA
|
||||
environment."
|
||||
SYNTAX BITS {
|
||||
transmitBinary(0),-- rfc856
|
||||
timemark(1), -- rfc860
|
||||
endOfRecord(2), -- rfc885
|
||||
terminalType(3), -- rfc1091
|
||||
tn3270Regime(4), -- rfc1041
|
||||
scsCtlCodes(5), -- rfc2355
|
||||
dataStreamCtl(6), -- rfc2355
|
||||
responses(7), -- rfc2355
|
||||
bindImage(8), -- rfc2355
|
||||
sysreq(9) -- rfc2355
|
||||
}
|
||||
|
||||
IANATn3270ResourceType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"The type of resource defined by a resource pool. Refer
|
||||
to tn3270eResPoolTable."
|
||||
SYNTAX INTEGER {
|
||||
other(1),
|
||||
terminal(2),
|
||||
printer(3),
|
||||
terminalOrPrinter(4)
|
||||
}
|
||||
|
||||
IANATn3270DeviceType ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"This textual convention defines the list of device
|
||||
types that can be set, as defined by RFC 2355."
|
||||
SYNTAX INTEGER {
|
||||
-- terminals
|
||||
ibm3278d2(1), -- (24 row x 80 col display)
|
||||
ibm3278d2E(2), -- (24 row x 80 col display)
|
||||
ibm3278d3(3), -- (32 row x 80 col display)
|
||||
ibm3278d3E(4), -- (32 row x 80 col display)
|
||||
ibm3278d4(5), -- (43 row x 80 col display)
|
||||
ibm3278d4E(6), -- (43 row x 80 col display)
|
||||
ibm3278d5(7), -- (27 row x 132 col display)
|
||||
ibm3278d5E(8), -- (27 row x 132 col display)
|
||||
ibmDynamic(9), -- (no pre-defined display size)
|
||||
|
||||
-- printers
|
||||
ibm3287d1(10),
|
||||
|
||||
unknown(100)
|
||||
}
|
||||
|
||||
IANATn3270eLogData ::= TEXTUAL-CONVENTION
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"An octet string representing log data as pertaining to
|
||||
either a TN3270 or TN3270E Session as reported from a
|
||||
TN3270E Server. Log data is stored in an octet string
|
||||
in time order (from earliest to latest).
|
||||
|
||||
Each log element has the following form:
|
||||
|
||||
+------+----+---------+------------+
|
||||
!length!type!TimeStamp! data !
|
||||
+------+----+---------+------------+
|
||||
|
||||
where
|
||||
|
||||
length = one-octet length of the data portion of the
|
||||
trace element, not including the length,
|
||||
type, and TimeStamp fields
|
||||
type = one-octet code point characterizing the data.
|
||||
TimeStamp = A 4-octet field representing the number of
|
||||
TimeTicks since the TN3270E server was last
|
||||
activated. The server's last activation time
|
||||
is available in the tn3270eSrvrConfLastActTime
|
||||
object in the TN3270E MIB, which has the
|
||||
syntax DateAndTime.
|
||||
data = initial part of a PDU.
|
||||
|
||||
length type
|
||||
|
||||
0-255 x'00' - unknown
|
||||
0 x'01' - inactivity timer expired
|
||||
0 x'02' - dynamic timer expired
|
||||
0 x'03' - actlu req
|
||||
0 x'04' - bind req
|
||||
0 x'05' - clear req
|
||||
0 x'06' - dactlu req
|
||||
0 x'07' - warm actpu req
|
||||
0 x'08' - sdt req
|
||||
0 x'09' - unbind req
|
||||
0 x'0A' - notify resp
|
||||
0 x'0B' - reply PSID neg rsp
|
||||
0 x'0C' - reply PSID pos rsp
|
||||
0 x'0D' - unbind rsp
|
||||
0 x'0E' - hierarchical reset
|
||||
0 x'0F' - client connect req
|
||||
0 x'10' - client disconnect req
|
||||
0 x'11' - timingmark received
|
||||
0 x'12' - flowControl timer expired
|
||||
0 x'13' - neg rsp to host
|
||||
0 x'14' - neg rsp from host
|
||||
0 x'15' - data contention
|
||||
0 x'16' - no buffer to send SNA data
|
||||
0 x'17' - receive response while inbound
|
||||
0 x'18' - client protocol error
|
||||
0 x'19' - badClientSequenceReceived
|
||||
1-255 x'1A' - utf8String
|
||||
2 x'1B' - hexCode, implementation dependent
|
||||
|
||||
Log element entries have a minimum length of 6 octets.
|
||||
The zero-length string indicates that no log data is
|
||||
available."
|
||||
SYNTAX OCTET STRING (SIZE (0 | 6..2048))
|
||||
|
||||
END
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user