commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 109/148: Expanded the usrp props structure


From: git
Subject: [Commit-gnuradio] [gnuradio] 109/148: Expanded the usrp props structure into something that can describe any kind of usrp: ethernet, udp, usb... and the various transport arguments.
Date: Mon, 15 Aug 2016 00:47:31 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.

commit 9093b2d4e3b6cec1442ab32d0f32cb5b0a907fcd
Author: Josh Blum <address@hidden>
Date:   Mon Dec 21 11:18:03 2009 -0800

    Expanded the usrp props structure into something that can describe any kind 
of usrp:
    ethernet, udp, usb... and the various transport arguments.
    
    The props structure is passed into to all the usrp make method to identify 
a usrp.
    The find method takes a props structure as a hint and returns a vector of 
matches.
    These capabilities will become more filled-in as the host code expands for 
other usrps.
    
    Also, added an officiall struct for the mac addrs to handle the string 
parsing in one place.
    Did the same for an ip address which will be needed for the udp usrps.
---
 gr-usrp2/src/usrp2.i               |   2 -
 gr-usrp2/src/usrp2_base.cc         |  17 +---
 gr-usrp2/src/usrp2_base.h          |  10 ---
 usrp2/apps/find_usrps.cc           |  15 ++--
 usrp2/apps/gpio.cc                 |   4 +-
 usrp2/apps/rx_streaming_samples.cc |   7 +-
 usrp2/apps/test_mimo_tx.cc         |   6 +-
 usrp2/apps/tx_samples.cc           |   5 +-
 usrp2/apps/usrp2_burn_mac_addr.cc  |  52 ++---------
 usrp2/include/usrp2/Makefile.am    |   1 +
 usrp2/include/usrp2/props.h        | 108 ++++++++++++++++++++++
 usrp2/include/usrp2/usrp2.h        |  51 +++--------
 usrp2/lib/Makefile.am              |   1 +
 usrp2/lib/eth_ctrl_transport.cc    |  14 ++-
 usrp2/lib/eth_ctrl_transport.h     |  11 +--
 usrp2/lib/eth_data_transport.cc    |  12 ++-
 usrp2/lib/eth_data_transport.h     |   7 +-
 usrp2/lib/find.cc                  | 180 ++++++++++++++++++++-----------------
 usrp2/lib/props.cc                 | 128 ++++++++++++++++++++++++++
 usrp2/lib/usrp2.cc                 | 127 +++++++-------------------
 20 files changed, 437 insertions(+), 321 deletions(-)

diff --git a/gr-usrp2/src/usrp2.i b/gr-usrp2/src/usrp2.i
index 3197402..65d4d09 100644
--- a/gr-usrp2/src/usrp2.i
+++ b/gr-usrp2/src/usrp2.i
@@ -45,8 +45,6 @@ protected:
 public:
   ~usrp2_base();
 
-  std::string mac_addr() const;
-  std::string interface_name() const;
   %rename(_real_fpga_master_clock_freq) fpga_master_clock_freq;
   bool fpga_master_clock_freq(long *freq);
   bool config_mimo(int flags);
diff --git a/gr-usrp2/src/usrp2_base.cc b/gr-usrp2/src/usrp2_base.cc
index bb99597..847da59 100644
--- a/gr-usrp2/src/usrp2_base.cc
+++ b/gr-usrp2/src/usrp2_base.cc
@@ -39,7 +39,10 @@ usrp2_base::usrp2_base(const char *name,
                  output_signature),
     d_u2(usrp2::usrp2::sptr())
 {
-  d_u2 = usrp2::usrp2::make(ifc, mac);
+  usrp2::props hint(usrp2::USRP_TYPE_ETH);
+  hint.eth_args.ifc = ifc;
+  if (mac != "") hint.eth_args.mac_addr = usrp2::u2_mac_addr(mac);
+  d_u2 = usrp2::usrp2::make(hint);
   if (!d_u2)
     throw std::runtime_error("Unable to initialize USRP2!");
 }
@@ -49,18 +52,6 @@ usrp2_base::~usrp2_base ()
   // NOP
 }
 
-std::string
-usrp2_base::mac_addr() const
-{
-  return d_u2->mac_addr();
-}
-
-std::string
-usrp2_base::interface_name() const
-{
-  return d_u2->interface_name();
-}
-
 bool
 usrp2_base::fpga_master_clock_freq(long *freq) const
 {
diff --git a/gr-usrp2/src/usrp2_base.h b/gr-usrp2/src/usrp2_base.h
index 67a62ba..02024c5 100644
--- a/gr-usrp2/src/usrp2_base.h
+++ b/gr-usrp2/src/usrp2_base.h
@@ -49,16 +49,6 @@ public:
   ~usrp2_base();
 
   /*!
-   * \brief Get USRP2 hardware MAC address
-   */
-  std::string mac_addr() const;
-  
-  /*!
-   * \brief Get interface name used to communicat with USRP2
-   */
-  std::string interface_name() const;
-
-  /*!
    * \brief Get USRP2 master clock rate
    */
   bool fpga_master_clock_freq(long *freq) const;
diff --git a/usrp2/apps/find_usrps.cc b/usrp2/apps/find_usrps.cc
index ff6b4ab..3b3b56d 100644
--- a/usrp2/apps/find_usrps.cc
+++ b/usrp2/apps/find_usrps.cc
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,12 +36,12 @@ int
 main(int argc, char **argv)
 {
   int ch;
-  const char *interface = "eth0";
+  usrp2::props hint(usrp2::USRP_TYPE_ETH);
 
   while ((ch = getopt(argc, argv, "he:")) != EOF){
     switch (ch){
     case 'e':
-      interface = optarg;
+      hint.eth_args.ifc = std::string(optarg);
       break;
       
     case 'h':
@@ -55,11 +55,14 @@ main(int argc, char **argv)
     usage(argv[0]);
     exit(1);
   }
-  
-  usrp2::props_vector_t r = usrp2::find(interface);
+
+  usrp2::props_vector_t r = usrp2::find(hint);
 
   for (size_t i = 0; i < r.size(); i++){
-    std::cout << r[i] << std::endl;
+    std::cout << "------------------------------" << std::endl;
+    std::cout << "-- Found USRP " << i << std::endl;
+    std::cout << "------------------------------" << std::endl;
+    std::cout << r[i] << std::endl << std::endl;
   }
 
   if (r.size() == 0){
diff --git a/usrp2/apps/gpio.cc b/usrp2/apps/gpio.cc
index 2fee7e7..137eef5 100644
--- a/usrp2/apps/gpio.cc
+++ b/usrp2/apps/gpio.cc
@@ -27,7 +27,9 @@
 int
 main(int argc, char **argv)
 {
-  usrp2::usrp2::sptr u2 = usrp2::usrp2::make("eth0");
+  usrp2::props p(usrp2::USRP_TYPE_ETH);
+  p.eth_args.ifc = "eth0";
+  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(p);
 
   // Set io_tx[15] as FPGA output
   u2->set_gpio_ddr(usrp2::GPIO_TX_BANK, 0x8000, 0x8000);
diff --git a/usrp2/apps/rx_streaming_samples.cc 
b/usrp2/apps/rx_streaming_samples.cc
index 0bd1048..872b081 100644
--- a/usrp2/apps/rx_streaming_samples.cc
+++ b/usrp2/apps/rx_streaming_samples.cc
@@ -290,7 +290,10 @@ main(int argc, char **argv)
   if (rt != gruel::RT_OK)
     std::cerr << "Failed to enable realtime scheduling" << std::endl;
 
-  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(interface, mac_addr_str);
+  usrp2::props p(usrp2::USRP_TYPE_ETH);
+  p.eth_args.ifc = interface;
+  p.eth_args.mac_addr = usrp2::u2_mac_addr(mac_addr_str);
+  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(p);
   
   // FIXME in case it was left running...
   if (!u2->stop_rx_streaming()){
@@ -309,7 +312,7 @@ main(int argc, char **argv)
   }
 
   if (verbose){
-    printf("USRP2 MAC address: %s\n\n", u2->mac_addr().c_str());
+    //printf("USRP2 MAC address: %s\n\n", u2->mac_addr().c_str());
     printf("Daughterboard configuration:\n");
     printf("  baseband_freq=%f\n", tr.baseband_freq);
     printf("       ddc_freq=%f\n", tr.dxc_freq);
diff --git a/usrp2/apps/test_mimo_tx.cc b/usrp2/apps/test_mimo_tx.cc
index b2df405..a65a0f8 100644
--- a/usrp2/apps/test_mimo_tx.cc
+++ b/usrp2/apps/test_mimo_tx.cc
@@ -216,8 +216,10 @@ main(int argc, char **argv)
   if (rt != gruel::RT_OK)
     std::cerr << "Failed to enable realtime scheduling" << std::endl;
 
-
-  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(interface, mac_addr_str);
+  usrp2::props p(usrp2::USRP_TYPE_ETH);
+  p.eth_args.ifc = interface;
+  p.eth_args.mac_addr = usrp2::u2_mac_addr(mac_addr_str);
+  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(p);
   
 #if 0
   if (gain != GAIN_NOT_SET){
diff --git a/usrp2/apps/tx_samples.cc b/usrp2/apps/tx_samples.cc
index c2aac68..8dfbbb8 100644
--- a/usrp2/apps/tx_samples.cc
+++ b/usrp2/apps/tx_samples.cc
@@ -200,7 +200,10 @@ main(int argc, char **argv)
     std::cerr << "Failed to enable realtime scheduling" << std::endl;
 
 
-  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(interface, mac_addr_str);
+  usrp2::props p(usrp2::USRP_TYPE_ETH);
+  p.eth_args.ifc = interface;
+  p.eth_args.mac_addr = usrp2::u2_mac_addr(mac_addr_str);
+  usrp2::usrp2::sptr u2 = usrp2::usrp2::make(p);
   
   if (gain != GAIN_NOT_SET){
     if (!u2->set_tx_gain(gain)){
diff --git a/usrp2/apps/usrp2_burn_mac_addr.cc 
b/usrp2/apps/usrp2_burn_mac_addr.cc
index 6ee76c1..9a61c56 100644
--- a/usrp2/apps/usrp2_burn_mac_addr.cc
+++ b/usrp2/apps/usrp2_burn_mac_addr.cc
@@ -64,37 +64,6 @@ usage(const char *progname)
   fprintf(stderr, "  new_mac_address must be HH:HH or HH:HH:HH:HH:HH:HH\n");
 }
 
-static bool
-check_mac_addr_syntax(const std::string &s)
-{
-  unsigned char addr[6];
-
-  addr[0] = 0x00;              // Matt's IAB
-  addr[1] = 0x50;
-  addr[2] = 0xC2;
-  addr[3] = 0x85;
-  addr[4] = 0x30;
-  addr[5] = 0x00;
-    
-  int len = s.size();
-    
-  switch (len){
-      
-  case 5:
-    return sscanf(s.c_str(), "%hhx:%hhx", &addr[4], &addr[5]) == 2;
-      
-  case 17:
-    return sscanf(s.c_str(), "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-                 &addr[0], &addr[1], &addr[2],
-                 &addr[3], &addr[4], &addr[5]) == 6;
-  default:
-    return false;
-  }
-
-  return true;
-}
-
-
 int
 main(int argc, char **argv)
 {
@@ -126,29 +95,23 @@ main(int argc, char **argv)
   }
 
   new_mac_addr = argv[optind];
-
-  if (!check_mac_addr_syntax(old_mac_addr)){
-    fprintf(stderr, "invalid mac address: %s\n", old_mac_addr);
-    exit(1);
-  }
-  if (!check_mac_addr_syntax(new_mac_addr)){
-    fprintf(stderr, "invalid mac address: %s\n", new_mac_addr);
-    exit(1);
-  }
   
   install_sig_handler(SIGINT, sig_handler);
 
   usrp2::usrp2::sptr u2;
 
   try {
-    u2 = usrp2::usrp2::make(interface, old_mac_addr);
+    usrp2::props p(usrp2::USRP_TYPE_ETH);
+    p.eth_args.ifc = interface;
+    p.eth_args.mac_addr = usrp2::u2_mac_addr(old_mac_addr);
+    u2 = usrp2::usrp2::make(p);
   }
   catch (std::exception const &e){
     std::cerr << e.what() << std::endl;
     return 1;
   }
 
-  if (!u2->burn_mac_addr(new_mac_addr)){
+  if (!u2->burn_mac_addr(usrp2::u2_mac_addr(new_mac_addr))){
     std::cerr << "Failed to burn mac address: "
              << new_mac_addr << std::endl;
     return 1;
@@ -163,7 +126,10 @@ main(int argc, char **argv)
   nanosleep(&ts, 0);
 
   try {
-    u2 = usrp2::usrp2::make(interface, new_mac_addr);
+    usrp2::props p(usrp2::USRP_TYPE_ETH);
+    p.eth_args.ifc = interface;
+    p.eth_args.mac_addr = usrp2::u2_mac_addr(new_mac_addr);
+    u2 = usrp2::usrp2::make(p);
   }
   catch (std::exception const &e){
     std::cerr << "Failed to connect to USRP2 using new addr: "
diff --git a/usrp2/include/usrp2/Makefile.am b/usrp2/include/usrp2/Makefile.am
index 24184b9..c1a58a4 100644
--- a/usrp2/include/usrp2/Makefile.am
+++ b/usrp2/include/usrp2/Makefile.am
@@ -28,5 +28,6 @@ usrp2include_HEADERS = \
        rx_nop_handler.h \
        strtod_si.h \
        tune_result.h \
+       props.h \
        usrp2.h \
        usrp2_cdefs.h
diff --git a/usrp2/include/usrp2/props.h b/usrp2/include/usrp2/props.h
new file mode 100644
index 0000000..17708c5
--- /dev/null
+++ b/usrp2/include/usrp2/props.h
@@ -0,0 +1,108 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef INCLUDED_PROPS_H
+#define INCLUDED_PROPS_H
+
+#include <vector>
+#include <string>
+#include <iostream>
+#include <gruel/inet.h>
+#include <netinet/ether.h>
+
+namespace usrp2{
+
+  /*!
+   * Wrapper for an ethernet mac address.
+   * Provides conversion between string and binary formats.
+   */
+  struct u2_mac_addr{
+    struct ether_addr d_mac_addr;
+    u2_mac_addr(const std::string &str = "00:00:00:00:00:00");
+    std::string to_string(void) const;
+  };
+
+  /*!
+   * Wrapper for an ipv4 address.
+   * Provides conversion between string and binary formats.
+   */
+  struct u2_ip_addr{
+    struct in_addr d_ip_addr;
+    u2_ip_addr(const std::string &str = "0.0.0.0");
+    std::string to_string(void) const;
+  };
+
+  /*!
+   * Possible usrp hardware types.
+   *
+   */
+  typedef enum{
+    USRP_TYPE_AUTO,
+    USRP_TYPE_VIRTUAL,
+    USRP_TYPE_USB,
+    USRP_TYPE_ETH,
+    USRP_TYPE_UDP,
+    USRP_TYPE_GPMC
+  } usrp_type_t;
+
+  /*!
+   * Structure to hold properties to identify a usrp device.
+   *
+   */
+  struct props{
+    usrp_type_t type;
+    int side;
+    int subdev;
+    struct{
+        //TODO perhaps file paths
+    } virtual_args;
+    struct{
+        uint16_t vendor_id;
+        uint16_t product_id;
+    } usb_args;
+    struct{
+        std::string ifc;
+        u2_mac_addr mac_addr;
+    } eth_args;
+    struct{
+        u2_ip_addr ip_addr;
+    } udp_args;
+    struct{
+        //TODO unknown for now
+    } gpmc_args;
+
+    /*!
+     * \brief Convert a usrp props into a string representation
+     */
+    static const std::string to_string(const props &x);
+
+    /*!
+     * \brief Default constructor to initialize the props struct
+     */
+    props(usrp_type_t _type=USRP_TYPE_AUTO);
+  };
+
+  typedef std::vector<props> props_vector_t;
+
+};
+
+std::ostream& operator<<(std::ostream &os, const usrp2::props &x);
+std::ostream& operator<<(std::ostream &os, const usrp2::u2_mac_addr &x);
+std::ostream& operator<<(std::ostream &os, const usrp2::u2_ip_addr &x);
+
+#endif /* INCLUDED_PROPS_H */
diff --git a/usrp2/include/usrp2/usrp2.h b/usrp2/include/usrp2/usrp2.h
index 5246c79..a3ae074 100644
--- a/usrp2/include/usrp2/usrp2.h
+++ b/usrp2/include/usrp2/usrp2.h
@@ -26,6 +26,7 @@
 #include <vrt/rx_packet_handler.h>
 #include <usrp2/tune_result.h>
 #include <usrp2/mimo_config.h>
+#include <usrp2/props.h>
 
 /*
  * N.B., The interfaces described here are still in flux.
@@ -37,20 +38,6 @@
 namespace usrp2 {
 
   /*!
-   * Structure to hold properties of USRP2 hardware devices.
-   *
-   */
-  struct props
-  {
-    std::string addr;
-    uint16_t hw_rev;
-    uint8_t fpga_md5sum[16];
-    uint8_t sw_md5sum[16];
-  };
-
-  typedef std::vector<props> props_vector_t;
-
-  /*!
    * Structure to hold a time specification for a usrp hardware device
    */
   typedef struct time_spec{
@@ -72,7 +59,7 @@ namespace usrp2 {
    *
    * \returns a vector of properties, 1 entry for each matching USRP2 found.
    */
-  props_vector_t find(const std::string &ifc, const std::string &mac_addr=""); 
+  props_vector_t find(const props &hint); 
 
   class tune_result;
 
@@ -96,28 +83,15 @@ namespace usrp2 {
     /*! 
      * Static function to return an instance of usrp2 as a shared pointer
      *
-     * \param ifc   Network interface name, e.g., "eth0"
-     * \param addr  Network mac address, e.g., "01:23:45:67:89:ab", "89:ab" or 
"".
-     *              If \p addr is HH:HH, it's treated as if it were 
00:50:c2:85:HH:HH
-     *              "" will autoselect a USRP2 if there is only a single one 
on the local ethernet.
+     * \param hint a props structure with filled in args and flags
      * \param rx_bufsize is the length in bytes of the kernel networking 
buffer to allocate.
      */
-    static sptr make(const std::string &ifc, const std::string &addr="", 
size_t rx_bufsize=0);
+    static sptr make(const props &hint, size_t rx_bufsize=0);
 
     /*!
      * Class destructor
      */
-    ~usrp2();  
-
-    /*!
-     * Returns the MAC address associated with this USRP
-     */
-    std::string mac_addr();
-
-    /*!
-     * Returns the GbE interface name associated with this USRP
-     */
-    std::string interface_name();
+    ~usrp2();
 
     /*
      * ----------------------------------------------------------------
@@ -406,10 +380,9 @@ namespace usrp2 {
     /*!
      * Burn new mac address into EEPROM on USRP2
      *
-     * \param new_addr  Network mac address, e.g., "01:23:45:67:89:ab" or 
"89:ab".
-     *                  If \p addr is HH:HH, it's treated as if it were 
00:50:c2:85:HH:HH
+     * \param new_addr the new mac address
      */
-    bool burn_mac_addr(const std::string &new_addr);
+    bool burn_mac_addr(const u2_mac_addr &new_addr);
 
     /*!
      * Reset master time to 0 at next PPS edge
@@ -609,14 +582,13 @@ namespace usrp2 {
 
   private:
 
-    std::string d_mac;
-    std::string d_ifc;
+    props d_props;
 
     // Static function to retrieve or create usrp2 instance
-    static sptr find_existing_or_make_new(const std::string &ifc, props *p, 
size_t rx_bufsize);
+    static sptr find_existing_or_make_new(const props &p, size_t rx_bufsize);
 
     // Only class members can instantiate this class
-    usrp2(const std::string &ifc, props *p, size_t rx_bufsize);
+    usrp2(const props &p, size_t rx_bufsize);
   
     // All private state is held in opaque pointer
     std::auto_ptr<impl> d_impl;
@@ -624,7 +596,4 @@ namespace usrp2 {
 
 };
 
-std::ostream& operator<<(std::ostream &os, const usrp2::props &x);
-
-
 #endif /* INCLUDED_USRP2_H */
diff --git a/usrp2/lib/Makefile.am b/usrp2/lib/Makefile.am
index a88a7bf..ae92d8a 100644
--- a/usrp2/lib/Makefile.am
+++ b/usrp2/lib/Makefile.am
@@ -42,6 +42,7 @@ libusrp2_la_SOURCES = \
        find.cc \
        open_usrp2_socket.cc \
        pktfilter.cc \
+       props.cc \
        rx_nop_handler.cc \
        strtod_si.c \
        usrp2.cc \
diff --git a/usrp2/lib/eth_ctrl_transport.cc b/usrp2/lib/eth_ctrl_transport.cc
index acc979b..f9bdb0c 100644
--- a/usrp2/lib/eth_ctrl_transport.cc
+++ b/usrp2/lib/eth_ctrl_transport.cc
@@ -18,8 +18,12 @@
 
 #include "eth_ctrl_transport.h"
 #include <gruel/inet.h>
+#include <cstring>
+#include <stdexcept>
 
-usrp2::eth_ctrl_transport::eth_ctrl_transport(const std::string &ifc, 
u2_mac_addr_t mac, bool target)
+static const usrp2::u2_mac_addr broadcast_mac_addr("ff:ff:ff:ff:ff:ff");
+
+usrp2::eth_ctrl_transport::eth_ctrl_transport(const std::string &ifc, const 
u2_mac_addr &mac)
  : transport("ethernet control"), d_mac(mac){
 
     //create raw ethernet device
@@ -28,8 +32,10 @@ usrp2::eth_ctrl_transport::eth_ctrl_transport(const 
std::string &ifc, u2_mac_add
         throw std::runtime_error("Unable to open/register USRP2 control 
protocol");
 
     //create and attach packet filter
-    if (target) d_pf_ctrl = 
pktfilter::make_ethertype_inbound_target(U2_CTRL_ETHERTYPE, (const unsigned 
char*)&(d_mac.addr));
-    else        d_pf_ctrl = 
pktfilter::make_ethertype_inbound(U2_CTRL_ETHERTYPE, d_eth_ctrl->mac());
+    if (memcmp(&d_mac, &broadcast_mac_addr, sizeof(d_mac)) == 0)
+        d_pf_ctrl = pktfilter::make_ethertype_inbound(U2_CTRL_ETHERTYPE, 
d_eth_ctrl->mac());
+    else
+        d_pf_ctrl = 
pktfilter::make_ethertype_inbound_target(U2_CTRL_ETHERTYPE, (const unsigned 
char*)&d_mac);
     if (!d_pf_ctrl || !d_eth_ctrl->attach_pktfilter(d_pf_ctrl))
         throw std::runtime_error("Unable to attach packet filter for control 
packets.");
 
@@ -53,7 +59,7 @@ bool usrp2::eth_ctrl_transport::sendv(const iovec *iov, 
size_t iovlen){
     //setup a new ethernet header
     u2_eth_packet_t hdr;
     hdr.ehdr.ethertype = htons(U2_CTRL_ETHERTYPE);
-    memcpy(&hdr.ehdr.dst, d_mac.addr, 6);
+    memcpy(&hdr.ehdr.dst, &d_mac, 6);
     memcpy(&hdr.ehdr.src, d_eth_ctrl->mac(), 6);
     hdr.thdr.flags = 0; // FIXME transport header values?
     hdr.thdr.seqno = 0;
diff --git a/usrp2/lib/eth_ctrl_transport.h b/usrp2/lib/eth_ctrl_transport.h
index 596b5954..7b21cd2 100644
--- a/usrp2/lib/eth_ctrl_transport.h
+++ b/usrp2/lib/eth_ctrl_transport.h
@@ -19,10 +19,11 @@
 #ifndef INCLUDED_ETH_CTRL_TRANSPORT_H
 #define INCLUDED_ETH_CTRL_TRANSPORT_H
 
+#include <usrp2_eth_packet.h>
+#include <usrp2/props.h>
 #include "transport.h"
 #include "ethernet.h"
 #include "pktfilter.h"
-#include "usrp2_impl.h"
 
 namespace usrp2{
 
@@ -30,21 +31,17 @@ namespace usrp2{
     private:
         ethernet      *d_eth_ctrl;  // unbuffered control frames
         pktfilter     *d_pf_ctrl;
-        u2_mac_addr_t d_mac;
+        u2_mac_addr   d_mac;
         uint8_t       d_buff[ethernet::MAX_PKTLEN];
-        double_t      d_timeout;
         uint8_t       d_padding[ethernet::MIN_PKTLEN];
 
     public:
         /*!
          * \brief Create a new transport for the raw ethernet control
-         * When the target is true, the packet filter is setup for the usrp 
mac address.
-         * When the target is false, the packet filter is setup to ignore our 
mac address.
          * \param ifc the ethernet device name
          * \param mac the destination mac address
-         * \param target true for an inbound target
          */
-        eth_ctrl_transport(const std::string &ifc, u2_mac_addr_t mac, bool 
target = true);
+        eth_ctrl_transport(const std::string &ifc, const u2_mac_addr &mac);
         ~eth_ctrl_transport();
         bool sendv(const iovec *iov, size_t iovlen);
         void recv(data_handler *handler);
diff --git a/usrp2/lib/eth_data_transport.cc b/usrp2/lib/eth_data_transport.cc
index d92b132..c235b74 100644
--- a/usrp2/lib/eth_data_transport.cc
+++ b/usrp2/lib/eth_data_transport.cc
@@ -18,12 +18,10 @@
 
 #include "eth_data_transport.h"
 #include <gruel/inet.h>
-#include <gruel/realtime.h>
-#include <gruel/sys_pri.h>
-#include <iostream>
-#include <cstdio>
+#include <stdexcept>
+#include <cstring>
 
-usrp2::eth_data_transport::eth_data_transport(const std::string &ifc, 
u2_mac_addr_t mac, size_t rx_bufsize)
+usrp2::eth_data_transport::eth_data_transport(const std::string &ifc, const 
u2_mac_addr &mac, size_t rx_bufsize)
  : transport("ethernet control"), d_mac(mac), d_tx_seqno(0), d_rx_seqno(0),
  d_num_rx_frames(0), d_num_rx_missing(0), d_num_rx_overruns(0), 
d_num_rx_bytes(0){
 
@@ -33,7 +31,7 @@ usrp2::eth_data_transport::eth_data_transport(const 
std::string &ifc, u2_mac_add
         throw std::runtime_error("Unable to open/register USRP2 data 
protocol");
 
     //create and attach packet filter
-    d_pf_data = pktfilter::make_ethertype_inbound_target(U2_DATA_ETHERTYPE, 
(const unsigned char*)&(d_mac.addr));
+    d_pf_data = pktfilter::make_ethertype_inbound_target(U2_DATA_ETHERTYPE, 
(const unsigned char*)&d_mac);
     if (!d_pf_data || !d_eth_data->attach_pktfilter(d_pf_data))
         throw std::runtime_error("Unable to attach packet filter for data 
packets.");
 
@@ -57,7 +55,7 @@ bool usrp2::eth_data_transport::sendv(const iovec *iov, 
size_t iovlen){
     //setup a new ethernet header
     u2_eth_packet_t hdr;
     hdr.ehdr.ethertype = htons(U2_DATA_ETHERTYPE);
-    memcpy(&hdr.ehdr.dst, d_mac.addr, 6);
+    memcpy(&hdr.ehdr.dst, &d_mac, 6);
     memcpy(&hdr.ehdr.src, d_eth_data->mac(), 6);
     hdr.thdr.flags = 0; // FIXME transport header values?
     hdr.thdr.seqno = d_tx_seqno++;
diff --git a/usrp2/lib/eth_data_transport.h b/usrp2/lib/eth_data_transport.h
index 2f0ee87..3f3b23c 100644
--- a/usrp2/lib/eth_data_transport.h
+++ b/usrp2/lib/eth_data_transport.h
@@ -19,11 +19,12 @@
 #ifndef INCLUDED_ETH_DATA_TRANSPORT_H
 #define INCLUDED_ETH_DATA_TRANSPORT_H
 
+#include <usrp2_eth_packet.h>
 #include <usrp2/data_handler.h>
+#include <usrp2/props.h>
 #include "transport.h"
 #include "eth_buffer.h"
 #include "pktfilter.h"
-#include "usrp2_impl.h"
 
 namespace usrp2{
 
@@ -31,7 +32,7 @@ namespace usrp2{
     private:
         eth_buffer    *d_eth_data;     // packet ring buffered data frames
         pktfilter     *d_pf_data;
-        u2_mac_addr_t d_mac;
+        u2_mac_addr   d_mac;
         int           d_tx_seqno;
         int           d_rx_seqno;
         data_handler::result operator()(const void *base, size_t len);
@@ -43,7 +44,7 @@ namespace usrp2{
         data_handler   *d_curr_handler;
 
     public:
-        eth_data_transport(const std::string &ifc, u2_mac_addr_t mac, size_t 
rx_bufsize);
+        eth_data_transport(const std::string &ifc, const u2_mac_addr &mac, 
size_t rx_bufsize);
         ~eth_data_transport();
         bool sendv(const iovec *iov, size_t iovlen);
         void recv(data_handler *handler);
diff --git a/usrp2/lib/find.cc b/usrp2/lib/find.cc
index a5c96b3..a241758 100644
--- a/usrp2/lib/find.cc
+++ b/usrp2/lib/find.cc
@@ -20,108 +20,124 @@
 #include <config.h>
 #endif
 
-#include <usrp2_eth_packet.h>
 #include <usrp2/usrp2.h>
 #include <boost/shared_ptr.hpp>
-#include <string.h>
+#include <cstring>
 #include <iostream>
 #include <stdexcept>
 #include <cstdio>
 #include <gruel/thread.h>
-#include <gruel/inet.h>
-#include "eth_ctrl_transport.h"
-
-#define FIND_DEBUG false
-
-static const u2_mac_addr_t broadcast_mac_addr =
-      {{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }};
-
-namespace usrp2{
-    class find_helper : private data_handler{
-    private:
-        const std::string d_target_addr;
-        transport::sptr   d_ctrl_transport;
-        props_vector_t    d_result;
+#include <boost/foreach.hpp>
 
-    public:
-        typedef boost::shared_ptr<find_helper> sptr;
+/*!
+ * A properties accumulator allows finders to register found props.
+ * Registering and getting the props is a thread safe operation.
+ */
+class props_accum{
+private:
+    usrp2::props_vector_t    d_found;
+    gruel::mutex             d_mutex;
+public:
+    void operator()(const usrp2::props &p){
+        gruel::scoped_lock l(d_mutex);
+        d_found.push_back(p);
+    }
+    usrp2::props_vector_t get(void){
+        gruel::scoped_lock l(d_mutex);
+        return d_found;
+    }
+};
 
-        find_helper(const std::string &ifc, const std::string &addr): 
d_target_addr(addr){
-            d_ctrl_transport = transport::sptr(new eth_ctrl_transport(ifc, 
broadcast_mac_addr, false));
-        }
+/*!
+ * The base class for all finders.
+ * TODO: expanded this base class to house common stuff (when more finders are 
implemented).
+ */
+class finder{
+    public: virtual ~finder(){}
+};
 
-        ~find_helper(void){/*NOP*/}
+#include "eth_ctrl_transport.h"
+/*!
+ * The ethernet finder for locating usrps over raw ethernet.
+ * The hint parameter must specify the name of an interface.
+ */
+class eth_finder : private usrp2::data_handler, public finder{
+private:
+    props_accum              *d_props_accum;
+    usrp2::props             d_hint;
+    usrp2::transport::sptr   d_ctrl_transport;
+    boost::thread            *d_ctrl_thread;
+
+public:
+    eth_finder(props_accum *pa, const usrp2::props &hint): d_props_accum(pa), 
d_hint(hint){
+        d_ctrl_transport = usrp2::transport::sptr(new 
usrp2::eth_ctrl_transport(d_hint.eth_args.ifc, d_hint.eth_args.mac_addr));
+        //build the control packet
+        op_generic_t op_id;
+        op_id.opcode = OP_ID;
+        op_id.len = sizeof(op_generic_t);
+        //send the control packet
+        iovec iov;
+        iov.iov_base = &op_id;
+        iov.iov_len = sizeof(op_generic_t);
+        d_ctrl_transport->sendv(&iov, 1);
+        //spawn new thread
+        d_ctrl_thread = new 
boost::thread(boost::bind(&eth_finder::ctrl_thread_loop, this));
+    }
 
-        props_vector_t find(void){
-            //build the control packet
-            op_generic_t op_id;
-            op_id.opcode = OP_ID;
-            op_id.len = sizeof(op_generic_t);
-            //send the control packet
-            iovec iov;
-            iov.iov_base = &op_id;
-            iov.iov_len = sizeof(op_generic_t);
-            d_ctrl_transport->sendv(&iov, 1);
-            //allow responses to gather
-            boost::thread *ctrl_thread = new 
boost::thread(boost::bind(&find_helper::ctrl_thread_loop, this));
-            boost::this_thread::sleep(gruel::delta_time(0.05)); //50ms
-            ctrl_thread->interrupt();
-            ctrl_thread->join();
-            return d_result;
-        }
+    ~eth_finder(void){
+        d_ctrl_thread->interrupt();
+        d_ctrl_thread->join();
+    }
 
-        data_handler::result operator()(const void *base, size_t len){
-            //copy the packet into an reply structure
-            op_id_reply_t op_id_reply;
-            memset(&op_id_reply, 0, sizeof(op_id_reply_t));
-            memcpy(&op_id_reply, base, std::min(sizeof(op_id_reply_t), len));
+    data_handler::result operator()(const void *base, size_t len){
+        //copy the packet into an reply structure
+        op_id_reply_t op_id_reply;
+        memset(&op_id_reply, 0, sizeof(op_id_reply_t));
+        memcpy(&op_id_reply, base, std::min(sizeof(op_id_reply_t), len));
 
-            //inspect the reply packet and store into result
-            if (op_id_reply.opcode != OP_ID_REPLY) // ignore
-                return data_handler::DONE;
-            props p = reply_to_props(&op_id_reply);
-            if (FIND_DEBUG)
-                std::cerr << "usrp2::find: response from " << p.addr << 
std::endl;
-            if ((d_target_addr == "") || (d_target_addr == p.addr))
-                d_result.push_back(p);
+        //inspect the reply packet and store into result
+        if (op_id_reply.opcode != OP_ID_REPLY) // ignore
             return data_handler::DONE;
-        }
+        usrp2::props p(usrp2::USRP_TYPE_ETH);
+        p.eth_args.ifc = d_hint.eth_args.ifc;
+        memcpy(&p.eth_args.mac_addr, &op_id_reply.addr, 
sizeof(p.eth_args.mac_addr));
+        (*d_props_accum)(p);
+        return data_handler::DONE;
+    }
 
-        void ctrl_thread_loop(void){
-            while(true){
-                d_ctrl_transport->recv(this);
-                boost::this_thread::interruption_point();
-            }
+    void ctrl_thread_loop(void){
+        while(true){
+            d_ctrl_transport->recv(this);
+            boost::this_thread::interruption_point();
         }
+    }
+};
 
-    private:
-        static props
-        reply_to_props(const op_id_reply_t *r)
-        {
-            const uint8_t *mac = (const uint8_t *)&r->addr;
-            char addr_buf[128];
-            snprintf(addr_buf, sizeof(addr_buf), 
"%02x:%02x:%02x:%02x:%02x:%02x",
-                 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-              
-            props p;
-            p.addr = std::string(addr_buf);  
-            p.hw_rev = ntohs(r->hw_rev);
-            memcpy(p.fpga_md5sum, r->fpga_md5sum, sizeof(p.fpga_md5sum));
-            memcpy(p.sw_md5sum, r->sw_md5sum, sizeof(p.sw_md5sum));
-            return p;
-        }
-    };
+namespace usrp2{
 
     props_vector_t
-    find(const std::string &ifc, const std::string &addr)
+    find(const props &hint)
     {
-        if (FIND_DEBUG) {
-            std::cerr << "usrp2::find: Searching interface " << ifc << " for "
-                      << (addr == "" ? "all USRP2s" : addr)
-                      << std::endl;
+        props_accum pa;
+        std::vector <finder*> finders;
+        //create finders based on the hint
+        switch (hint.type){
+        case USRP_TYPE_AUTO:
+            finders.push_back(new eth_finder(&pa, hint));
+            break;
+        case USRP_TYPE_VIRTUAL: break;
+        case USRP_TYPE_USB: break;
+        case USRP_TYPE_ETH:
+            finders.push_back(new eth_finder(&pa, hint));
+            break;
+        case USRP_TYPE_UDP: break;
+        case USRP_TYPE_GPMC: break;
         }
-        find_helper::sptr fh(new find_helper(ifc, addr));
-        return fh->find();
+        //allow responses to gather
+        boost::this_thread::sleep(gruel::delta_time(0.05)); //50ms
+        //destroy all the finders
+        BOOST_FOREACH(finder *f, finders){delete f;}
+        return pa.get();
     }
 
 } // namespace usrp2
diff --git a/usrp2/lib/props.cc b/usrp2/lib/props.cc
new file mode 100644
index 0000000..8b8bdf0
--- /dev/null
+++ b/usrp2/lib/props.cc
@@ -0,0 +1,128 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <usrp2/props.h>
+#include <sstream>
+#include <cstring>
+#include <cstdio>
+#include <stdexcept>
+
+//----------------------- u2 mac addr wrapper ------------------------//
+usrp2::u2_mac_addr::u2_mac_addr(const std::string &str){
+    //ether_aton_r(str.c_str(), &d_mac_addr);
+    bool good = false;
+    char p[6] = {0x00, 0x50, 0xC2, 0x85, 0x30, 0x00}; // Matt's IAB
+
+    switch (str.size()){
+    case 5:
+      good = sscanf(str.c_str(), "%hhx:%hhx", &p[4], &p[5]) == 2;
+      break;
+    case 17:
+      good = sscanf(str.c_str(), "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+            &p[0], &p[1], &p[2], &p[3], &p[4], &p[5]) == 6;
+      break;
+    }
+
+    if (not good) throw std::runtime_error("Invalid mac address: " + str);
+    memcpy(&d_mac_addr, p, sizeof(d_mac_addr));
+}
+
+std::string usrp2::u2_mac_addr::to_string(void) const{
+    char addr_buf[128];
+    //ether_ntoa_r(&d_mac_addr, addr_buf);
+    const uint8_t *p = reinterpret_cast<const uint8_t *>(&d_mac_addr);
+    sprintf(addr_buf, "%02x:%02x:%02x:%02x:%02x:%02x",
+        p[0], p[1], p[2], p[3], p[4], p[5]);
+    return std::string(addr_buf);
+}
+
+std::ostream& operator<<(std::ostream &os, const usrp2::u2_mac_addr &x){
+    os << x.to_string();
+    return os;
+}
+
+//----------------------- u2 ipv4 wrapper ----------------------------//
+usrp2::u2_ip_addr::u2_ip_addr(const std::string &str){
+    int ret = inet_pton(AF_INET, str.c_str(), &d_ip_addr);
+    if (ret == 0) throw std::runtime_error("Invalid ip address: " + str);
+}
+
+std::string usrp2::u2_ip_addr::to_string(void) const{
+    char addr_buf[128];
+    inet_ntop(AF_INET, &d_ip_addr, addr_buf, INET_ADDRSTRLEN);
+    return std::string(addr_buf);
+}
+
+std::ostream& operator<<(std::ostream &os, const usrp2::u2_ip_addr &x){
+    os << x.to_string();
+    return os;
+}
+
+//----------------------- usrp props wrapper -------------------------//
+usrp2::props::props(usrp_type_t _type){
+    type = _type;
+    side = ~0;
+    subdev = ~0;
+    usb_args.vendor_id = 0xffff;
+    usb_args.product_id = 0xffff;
+    eth_args.ifc = "eth0";
+    eth_args.mac_addr = u2_mac_addr("ff:ff:ff:ff:ff:ff");
+    udp_args.ip_addr = u2_ip_addr("255.255.255.255");
+}
+
+const std::string usrp2::props::to_string(const props &x){
+    std::stringstream out;
+    out << "USRP Type: ";
+    switch(x.type){
+    case USRP_TYPE_AUTO:
+        out << "Automatic" << std::endl;
+        break;
+    case USRP_TYPE_VIRTUAL:
+        out << "Virtual" << std::endl;
+        break;
+    case USRP_TYPE_USB:
+        out << "USB Port" << std::endl;
+        out << "Vendor ID: 0x" << std::hex << x.usb_args.vendor_id << 
std::endl;
+        out << "Product ID: 0x" << std::hex << x.usb_args.product_id << 
std::endl;
+        break;
+    case USRP_TYPE_ETH:
+        out << "Raw Ethernet" << std::endl;
+        out << "Interface: " << x.eth_args.ifc << std::endl;
+        out << "MAC Addr: " << x.eth_args.mac_addr << std::endl;
+        break;
+    case USRP_TYPE_UDP:
+        out << "UDP Socket" << std::endl;
+        out << "IP Addr: " << x.udp_args.ip_addr << std::endl;
+        break;
+    case USRP_TYPE_GPMC:
+        out << "GPMC" << std::endl;
+        break;
+    default:
+        out << "Unknown" << std::endl;
+    }
+    out << "Side: " << x.side << std::endl;
+    out << "Subdevice: " << x.subdev << std::endl;
+    out << std::endl;
+    return out.str();
+}
+
+std::ostream& operator<<(std::ostream &os, const usrp2::props &x)
+{
+  os << usrp2::props::to_string(x);
+  return os;
+}
diff --git a/usrp2/lib/usrp2.cc b/usrp2/lib/usrp2.cc
index e3b1904..a3a8c31 100644
--- a/usrp2/lib/usrp2.cc
+++ b/usrp2/lib/usrp2.cc
@@ -31,49 +31,6 @@
 #include "eth_ctrl_transport.h"
 #include "eth_data_transport.h"
 
-static bool
-string_to_mac_addr(const std::string &s, u2_mac_addr_t *p)
-{
-    p->addr[0] = 0x00;         // Matt's IAB
-    p->addr[1] = 0x50;
-    p->addr[2] = 0xC2;
-    p->addr[3] = 0x85;
-    p->addr[4] = 0x30;
-    p->addr[5] = 0x00;
-
-    int len = s.size();
-
-    switch (len){
-      
-    case 5:
-      return sscanf(s.c_str(), "%hhx:%hhx", &p->addr[4], &p->addr[5]) == 2;
-      
-    case 17:
-      return sscanf(s.c_str(), "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-            &p->addr[0], &p->addr[1], &p->addr[2],
-            &p->addr[3], &p->addr[4], &p->addr[5]) == 6;
-    default:
-      return false;
-    }
-}
-
-static bool
-parse_mac_addr(const std::string &s, std::string &ns)
-{
-    u2_mac_addr_t p;
-
-    if (not string_to_mac_addr(s, &p))
-        return false;
-
-    char buf[128];
-    snprintf(buf, sizeof(buf),
-         "%02x:%02x:%02x:%02x:%02x:%02x",
-         p.addr[0],p.addr[1],p.addr[2],
-         p.addr[3],p.addr[4],p.addr[5]);
-    ns = std::string(buf);
-    return true;
-}
-
 namespace usrp2 {
 
   // --- Table of weak pointers to usrps we know about ---
@@ -95,9 +52,9 @@ namespace usrp2 {
   static usrp_table s_table;
 
   usrp2::sptr
-  usrp2::find_existing_or_make_new(const std::string &ifc, props *pr, size_t 
rx_bufsize)
+  usrp2::find_existing_or_make_new(const props &pr, size_t rx_bufsize)
   {
-    std::string key = ifc + ":" + pr->addr;
+    std::string key = props::to_string(pr);
 
     boost::mutex::scoped_lock  guard(s_table_mutex);
 
@@ -115,7 +72,7 @@ namespace usrp2 {
     // We don't have the USRP2 we're looking for
 
     // create a new one and stick it in the table.
-    usrp2::sptr r(new usrp2::usrp2(ifc, pr, rx_bufsize));
+    usrp2::sptr r(new usrp2::usrp2(pr, rx_bufsize));
     usrp_table_entry t(key, r);
     s_table.push_back(t);
 
@@ -125,41 +82,40 @@ namespace usrp2 {
   // --- end of table code ---
 
   usrp2::sptr
-  usrp2::make(const std::string &ifc, const std::string &addr, size_t 
rx_bufsize)
+  usrp2::make(const props &hint, size_t rx_bufsize)
   {
-    u2_mac_addr_t mac;
-    if (addr != "" && !string_to_mac_addr(addr, &mac))
-      throw std::runtime_error("Invalid MAC address");
 
-    std::string naddr = "";
-    parse_mac_addr(addr, naddr);
+    props_vector_t props = find(hint);
+    int n = props.size();
 
-    props_vector_t u2s = find(ifc, naddr);
-    int n = u2s.size();
-
-    if (n == 0) {
-      if (addr == "")
-       throw std::runtime_error("No USRPs found on interface " + ifc);
-      else
-       throw std::runtime_error("No USRP found with addr " + addr + " on 
interface " + ifc);
-    }
+    if (n == 0)
+      throw std::runtime_error("No USRPs found");
 
     if (n > 1)
-      throw std::runtime_error("Multiple USRPs found on interface; must select 
by MAC address.");
+      throw std::runtime_error("Multiple USRPs found; must select by args.");
 
-    return find_existing_or_make_new(ifc, &u2s[0], rx_bufsize);
+    return find_existing_or_make_new(props[0], rx_bufsize);
   }
 
   // Private constructor.  Sole function is to create an impl.
-  usrp2::usrp2(const std::string &ifc, props *p, size_t rx_bufsize)
-  {
-    u2_mac_addr_t mac;
-    d_mac = p->addr;
-    d_ifc = ifc;
-    string_to_mac_addr(d_mac, &mac);
-    //create transports for data and control
-    transport::sptr ctrl_transport(new eth_ctrl_transport(ifc, mac));
-    transport::sptr data_transport(new eth_data_transport(ifc, mac, 
rx_bufsize));
+  usrp2::usrp2(const props &p, size_t rx_bufsize): d_props(p)
+  {
+    transport::sptr ctrl_transport;
+    transport::sptr data_transport;
+
+    //create the transports based on the usrp type
+    switch (p.type){
+    case USRP_TYPE_AUTO: throw std::runtime_error("Not supported");
+    case USRP_TYPE_VIRTUAL: throw std::runtime_error("Not supported");
+    case USRP_TYPE_USB: throw std::runtime_error("Not supported");
+    case USRP_TYPE_ETH:
+        ctrl_transport = transport::sptr(new 
eth_ctrl_transport(p.eth_args.ifc, p.eth_args.mac_addr));
+        data_transport = transport::sptr(new 
eth_data_transport(p.eth_args.ifc, p.eth_args.mac_addr, rx_bufsize));
+        break;
+    case USRP_TYPE_UDP: throw std::runtime_error("Not supported");
+    case USRP_TYPE_GPMC: throw std::runtime_error("Not supported");
+    }
+
     //pass the transports into a new usrp2 impl
     d_impl = std::auto_ptr<impl>(new usrp2::impl(data_transport, 
ctrl_transport));
   }
@@ -169,18 +125,6 @@ namespace usrp2 {
   {
     // NOP
   }
-  
-  std::string
-  usrp2::mac_addr()
-  {
-    return d_mac;
-  }
-
-  std::string
-  usrp2::interface_name()
-  {
-    return d_ifc;
-  }
 
   // Receive
 
@@ -426,10 +370,10 @@ namespace usrp2 {
   // low level methods
 
   bool
-  usrp2::burn_mac_addr(const std::string &new_addr)
+  usrp2::burn_mac_addr(const u2_mac_addr &new_addr)
   {
     u2_mac_addr_t mac;
-    string_to_mac_addr(new_addr, &mac);
+    memcpy(&mac, &new_addr, sizeof(u2_mac_addr));
     return d_impl->burn_mac_addr(&mac);
   }
 
@@ -488,14 +432,3 @@ namespace usrp2 {
   }
 
 } // namespace usrp2
-
-std::ostream& operator<<(std::ostream &os, const usrp2::props &x)
-{
-  os << x.addr;
-
-  char buf[128];
-  snprintf(buf, sizeof(buf)," hw_rev = 0x%04x", x.hw_rev);
-
-  os << buf;
-  return os;
-}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]