Skip to content

Commit

Permalink
windows tcp services
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed Jul 24, 2018
1 parent b869603 commit cd55446
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/out-tcp-services.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ tcp_service_name(int port)

return tcp_services[port] = strdup(result_buf.s_name);
#else
{
struct servent *result;

result = getservbyport(htons((unsigned short)port), "tcp");
Expand All @@ -46,6 +47,7 @@ tcp_service_name(int port)
return "unknown";

return tcp_services[port] = strdup(result->s_name);
}
#endif
}

Expand All @@ -68,6 +70,7 @@ udp_service_name(int port)

return udp_services[port] = strdup(result_buf.s_name);
#else
{
struct servent *result;

result = getservbyport(htons((unsigned short)port), "udp");
Expand All @@ -76,5 +79,6 @@ udp_service_name(int port)
return "unknown";

return udp_services[port] = strdup(result->s_name);
}
#endif
}
2 changes: 2 additions & 0 deletions vs10/masscan.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ClCompile Include="..\src\out-ndjson.c" />
<ClCompile Include="..\src\out-null.c" />
<ClCompile Include="..\src\out-redis.c" />
<ClCompile Include="..\src\out-tcp-services.c" />
<ClCompile Include="..\src\out-text.c" />
<ClCompile Include="..\src\out-unicornscan.c" />
<ClCompile Include="..\src\out-xml.c" />
Expand Down Expand Up @@ -126,6 +127,7 @@
<ClInclude Include="..\src\masscan-version.h" />
<ClInclude Include="..\src\masscan.h" />
<ClInclude Include="..\src\out-record.h" />
<ClInclude Include="..\src\out-tcp-services.h" />
<ClInclude Include="..\src\output.h" />
<ClInclude Include="..\src\packet-queue.h" />
<ClInclude Include="..\src\pixie-backtrace.h" />
Expand Down
6 changes: 6 additions & 0 deletions vs10/masscan.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@
<ClCompile Include="..\src\ranges-avl.c">
<Filter>Source Files\crypto</Filter>
</ClCompile>
<ClCompile Include="..\src\out-tcp-services.c">
<Filter>Source Files\output</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\proto-arp.h">
Expand Down Expand Up @@ -515,6 +518,9 @@
<ClInclude Include="..\src\ranges-avl.h">
<Filter>Source Files\crypto</Filter>
</ClInclude>
<ClInclude Include="..\src\out-tcp-services.h">
<Filter>Source Files\output</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" />
Expand Down

0 comments on commit cd55446

Please sign in to comment.