trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaurav Bansal <zeebe...@gmail.com>
Subject Re: getting source/destination ip-address/port number in plugin
Date Fri, 18 Aug 2017 08:36:32 GMT
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 <maskit@apache.org> 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 <zeebee48@gmail.com> 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
>>
>
>

Mime
View raw message