|
1 /* |
|
2 * Copyright 2006 Intel Corporation |
|
3 * |
|
4 * Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 * you may not use this file except in compliance with the License. |
|
6 * You may obtain a copy of the License at |
|
7 * |
|
8 * http://www.apache.org/licenses/LICENSE-2.0 |
|
9 * |
|
10 * Unless required by applicable law or agreed to in writing, software |
|
11 * distributed under the License is distributed on an "AS IS" BASIS, |
|
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 * See the License for the specific language governing permissions and |
|
14 * limitations under the License. |
|
15 */ |
|
16 |
|
17 #ifndef _IP_CONVERGENCE_LAYER_UTILS_H_ |
|
18 #define _IP_CONVERGENCE_LAYER_UTILS_H_ |
|
19 |
|
20 #include <sys/types.h> |
|
21 #include <sys/socket.h> |
|
22 #include <netinet/in.h> |
|
23 #include <oasys/compat/inttypes.h> |
|
24 |
|
25 #include "ConvergenceLayer.h" |
|
26 |
|
27 namespace dtn { |
|
28 |
|
29 /** |
|
30 * Utility class for shared functionality between ip-based convergence |
|
31 * layers. |
|
32 */ |
|
33 class IPConvergenceLayerUtils { |
|
34 public: |
|
35 /** |
|
36 * Parse a next hop address specification of the form |
|
37 * <host>[:<port>?]. |
|
38 * |
|
39 * @return true if the conversion was successful, false |
|
40 */ |
|
41 static bool parse_nexthop(const char* logpath, const char* nexthop, |
|
42 in_addr_t* addr, u_int16_t* port); |
|
43 }; |
|
44 |
|
45 } // namespace dtn |
|
46 |
|
47 #endif /* _IP_CONVERGENCE_LAYER_UTILS_H_ */ |