Well here's the situation:
There's a particular MSSQL host we need to connect to, we know it's instance name, we're generating a EntityConnection string using ADO.NET connection string.
So, we can get the Hostname of the MSSQL server.
right after connecting to it, we need to call sp_login stored procedure that takes in 3 arguments: username password and mac address.
So far, I've been able to to retrieve ip address of the server, get all the current NICs running on client.
current solution:
get the IP addresses of MSSQL server(ip4 and ip6),
get the routing table of the client computer,
cross check routing table with the IP addresses of the MSSQL server,
find the interface,
get the interface mac address.
problem 1:
I've been looking for an API or .NET class that would provide me with current IP Routing Table, no luck yet
problem 2:
Is this the correct way to go about it? I mean, is there a server side Transact SQL function/solution that gets the mac address from the connection made from the client.
OR is there a 1 single function that gets all the information associated with any connection, for example: provide a hostname or ip and it returns NIC, route, ips, ports and what not?
I'm sure if I spend more time googling, I'd get all the necessary steps done. But doing all of those steps and googling each one separately makes me wonder whether there's a shorter solution.
any pointers anyone?