From 177b86d997290a8bb9837568da7d69659e422b73 Mon Sep 17 00:00:00 2001 From: Ron Sijm Date: Sun, 12 Jun 2016 01:26:08 +0200 Subject: [PATCH] Fixed multible issues with models: - SearchHostResults missing "matches data attribute - Location areacode not being nullable - Banner having duplicate "ip" datamembers - Banner IP field being too small for the data --- src/Shodan.Net/Models/Banner.cs | 4 ++-- src/Shodan.Net/Models/Location.cs | 2 +- src/Shodan.Net/Models/SearchHostResults.cs | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Shodan.Net/Models/Banner.cs b/src/Shodan.Net/Models/Banner.cs index 2d65106..ee1e8eb 100644 --- a/src/Shodan.Net/Models/Banner.cs +++ b/src/Shodan.Net/Models/Banner.cs @@ -70,12 +70,12 @@ namespace Shodan.Net.Models /// The IP address of the host as an integer /// [DataMember(Name = "ip")] - public int? Ip { get; set; } + public long? Ip { get; set; } /// /// The IPv6 address of the host as a string. If this is present then the "ip" and "ip_str" fields wont be. /// - [DataMember(Name = "ip")] + [DataMember(Name = "ipv6")] public string Ipv6 { get; set; } /// diff --git a/src/Shodan.Net/Models/Location.cs b/src/Shodan.Net/Models/Location.cs index 506db69..afa6627 100644 --- a/src/Shodan.Net/Models/Location.cs +++ b/src/Shodan.Net/Models/Location.cs @@ -64,7 +64,7 @@ namespace Shodan.Net.Models /// The area code for the device's location. Only available for the US. /// [DataMember(Name = "area_code")] - public int AreaCode { get; set; } + public int? AreaCode { get; set; } /// /// The designated market area code for the area where the device is located. Only available for the US. diff --git a/src/Shodan.Net/Models/SearchHostResults.cs b/src/Shodan.Net/Models/SearchHostResults.cs index a035d92..cd32a99 100644 --- a/src/Shodan.Net/Models/SearchHostResults.cs +++ b/src/Shodan.Net/Models/SearchHostResults.cs @@ -12,6 +12,7 @@ namespace Shodan.Net.Models [DataContract] public class SearchHostResults { + [DataMember(Name = "matches")] public List Matches { get; set; } [DataMember(Name = "facets")]