Thanks Masakazu for the info. I tried the api's you told in the links above. Out of these : i) TSHttpSsnClientAddrGet : works fine as expected giving client port/ip. ii) TSHttpTxnServerAddrGet : always provides 0 for sin_port & sin_addr members of sockaddr_in struct (infact all the bytes in sockaddr structure returned by this api are 0). Are there any known issues with this api ? Is there any other way to get the server ip/port in the plugin ?
thanks, gaurav On Wed, Aug 16, 2017 at 5:58 PM, Masakazu Kitajo <[email protected]> wrote: > Hi Gaurav, > > Here you are. These are C++ API but you can use TSHttpTxn* functions > directly if you use C API. > https://github.com/apache/trafficserver/blob/7.1.0/lib/ > cppapi/Transaction.cc#L284-L306 > > You can find some of them on our documentation (not all of them, > unfortunately). > https://docs.trafficserver.apache.org/en/latest/ > developer-guide/api/functions/TSHttpTxnServerAddrGet.en.html > > Thanks, > Masakazu > > > On Wed, Aug 16, 2017 at 7:55 PM, Gaurav Bansal <[email protected]> wrote: > >> hi all, >> I am writing a plugin and need the value of client/server >> ip-address/port-number. Is there any existing api, using which i can get >> these OR any structure from which i can get these values ? Definitely these >> would have been stored in some structure while parsing the ip headers, just >> want to know how to access them from the plugin. >> thanks, >> gaurav >> > >
