blob: 05936b0f6f5874bbe501ffc90209a101201f2bc4 [file] [log] [blame]
Yanbiao Liac8b4ca2017-07-10 02:27:50 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
Davide Pesavento844b0932018-05-07 01:00:16 -04003 * Copyright (c) 2013-2018 Regents of the University of California,
Yanbiao Liac8b4ca2017-07-10 02:27:50 -07004 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
10 *
11 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
12 *
13 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
14 * terms of the GNU Lesser General Public License as published by the Free Software
15 * Foundation, either version 3 of the License, or (at your option) any later version.
16 *
17 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
20 *
21 * You should have received copies of the GNU General Public License and GNU Lesser
22 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
23 * <http://www.gnu.org/licenses/>.
24 *
25 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
26 */
27
28#include "address-converter.hpp"
29
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070030namespace ndn {
31namespace ip {
32
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070033boost::asio::ip::address
34addressFromString(const std::string& address, boost::system::error_code& ec)
35{
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070036 return boost::asio::ip::address::from_string(address, ec);
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070037}
38
39boost::asio::ip::address
40addressFromString(const std::string& address)
41{
Davide Pesavento59e266a2018-05-27 05:20:20 -040042 return boost::asio::ip::address::from_string(address);
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070043}
44
45boost::asio::ip::address_v6
46addressV6FromString(const std::string& address, boost::system::error_code& ec)
47{
Davide Pesavento59e266a2018-05-27 05:20:20 -040048 return boost::asio::ip::address_v6::from_string(address, ec);
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070049}
50
51boost::asio::ip::address_v6
52addressV6FromString(const std::string& address)
53{
Davide Pesavento59e266a2018-05-27 05:20:20 -040054 return boost::asio::ip::address_v6::from_string(address);
Yanbiao Liac8b4ca2017-07-10 02:27:50 -070055}
56
57} // namespace ip
58} // namespace ndn