lib/rubydns/transport.rb in rubydns-0.9.1 vs lib/rubydns/transport.rb in rubydns-0.9.2
- old
+ new
@@ -17,13 +17,18 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require 'stringio'
+require 'ipaddr'
require_relative 'message'
module RubyDNS
+ def self.address_family(host)
+ return IPAddr.new(host).family
+ end
+
# A helper class for processing incoming network data.
class BinaryStringIO < StringIO
def initialize
super