View RPC RMI related code in Network file system - linux-kernel

I am studying Network File system and there mechanisms, they use RPC to run commands on remote machine (server). I have tried bare RPC assignments, like generating stubs using RPCgen, and running client server code.
I would like to know where in the kernel source can I find the RPC related code for Network File system. At which layer does it calls the RPC generated function, ie at VFS itself or the native filesystem.

Typically, kernel does not use rpcgen generated code. You can find NFS/RPC related code at:
nfs client: fs/nfs
nfs server: fs/nfsd
rpc code: net/sunrpc
For client ( this is what you probably looking for) entry point will be fs/nfs/super.c, if you looking at VFS layer or nfs3proc.c/nfs4proc.c, if you want to look at RPC layer.

Related

having issues with/How to connect to MQTT broker in lambda function for alexa skill

The immediate issue I am trying to overcome is that my aws-lambda function is not connecting to my broke using the js MQTT library. I am able to use this library in a local node environment to connect, just not in the aws-lambda function.
I have created a zip file from this repo:
https://github.com/JordanKlaers/AlexaMQTT
That I uploaded to my lambda function. I am using the exported function from index.js.
Everything works well except for the part where it does not connect to the broker/client (line 83 in index.js)
When I run oldIndex.js from the repo I linked (which is just the promise function that connects, from the aws-lambda function) in my local node environment it connects and things run correctly.
I dont know how to create a minimum reproducible sketch because its success is based on interacting with hardware. I did create the "oldIndex.js" as a minimum sketch to show that at least the function to connect works. I have included logs of the lambda function to show that it works as expected up to the attempt to connect.
The only thing I can speculate would be some issue with my permissions for the role used with the lambda function but I have researched and added different policies to my role but that hasnt helped.
Here are the logs from the function when called (which shows that it gets to the promise and attempts to connect but doesnt succeed)
I had done almost everything myself, but got some final clarification on my approach from this tutorial so I not sure what else Im not considering/missing.
The main problem here is that your broker is running on a Pi attached to your local home network.
This means it is behind a Home Broadband Router which is performing Network Address Translation (NAT). This takes packets from your home network (10.0.0.0/24) and remaps them to have come from your public facing IP address.
This means that the Lambda code (running on AWS) can not directly send packets to the broker, so has no way to connect.
There are several possible solutions to this, but here are a couple.
Run a broker on a cloud hosting provider. You will be able to then reach this from anywhere.
Enable port forwarding on your router to expose port 1883 to the internet and forward any packets to the broker running on your raspberry pi. (This option depends on you having a fixed IP address or dynamic DNS)
For both of these you will probably want to enable authentication/authorisation on the broker and also probably add TLS.
You also need to look closer at the MQTT.js library and how to enable the error tracking so you can see why things fail e.g.
client.on('error', function(err) {...});

How to simulate external TCP traffic in Windows?

I don't have any code yet, so please feel free to move this to a sister site, if you think it belongs there :)
I have a Program A ( I don't have it's source code, so I can't modify it's behavior ) running on my machine which keeps listening to a particular port on the system for TCP data. It's a Peer to Peer application.
System 1 running A ====================== System 2 sunning A
The program A is supposed to run on systems where I may not be allowed to modify Firewall settings to allow incoming connections on the port the program listens to. I have an EC2 linux server running Ubuntu 16.
So I thought I can use an existing tool or create a program that would connect to the server on port X, and fetch the data from the server, and locally throw that data to the port A is listening to.
System 1 running A ========= SERVER =========== System 2 sunning A
What kind of configuration should I have on the server ? And is there any program I can use for this, or an idea of how to make one ?
I did something similar to bypass firewalls and hotspots.
Check this out https://github.com/yarrick/iodine, with a proper configuration your would be able to send\receive packets as DNS queries which is I know is always allowed, I used my server to get usual internet access with any hotspot I found.
You would lose some time, higher latency but you will have access.
Hope I helped.

Getting ICE failed in webrtc P2P video calling when communicating in different network

I'm working to create a video calling web app using WebRTC.
The communication is working fine on same network. But when communicating in different network I'm getting ICE failed error.
Error: ICE failed, see about:webrtc for more details
In about:webrtc I' able to get local and remote SDP's, but ICE State is failed. http://imgur.com/a/nPPDr
Here is the code of my main.js file
Here is the my log file from about:webrtc
P.S: Before posting the question I've checked several posts in SO and in other sites but no one did the trick.
Looking at the log file you provided it looks like you provided a TURN server, but the communication with that TURN server simply times out. So either something like a local firewall is blocking the communication with your TURN server or your TURN server is not working.
In case your local firewall blocks UDP traffic it might help to configure and use TURN TCP additionally to get through the firewall.
your about:webrtc does not show any relay candidates gathered from a TURN server. At the risk of sounding like a broken record: you need a TURN server for the majority of connections between different networks.

Fail to use MS-RPC in Excel host

I use RpcBindingFromStringBinding to connect from MS-RPC client to local Daemon server and vice versa. I use LRPC or local Named Pipes. Randomly calls to NdrClientCall2 fails from first attempt, event if server is alive, error code is -2147467259. Freeing binding and creating new one and do request does not helps. It is reproduced when Excel process add-in start Daemon process, both can be server and client. Cannot reproduce on 2 console executable.
Any ideas?
I used RPC from C#. During start I got GC of RPC server handles. Not reproduced in tests until GC calls.

how to implement SNMP manager or snmptalk on vxworks 6.9

I need to implement an SNMP manager (client) to run on a vxworks embedded single board computer, in order to monitor and control some other Linux boards, each running an SNMP agents for reading and writing local data.
Windriver supplies an example called 'snmptalk' but with no help on how to use it or how to implement it on vxworks.
option 1. Port snmptalk to vxworks
Windriver supplies snmptalk ( located at: /vxworks...\demo\snmptalk...) but only for non-vxworks implementations.
option 2.
I called Windriver support and they gave me a sample of a working SNMP get and set, and it worked great. My vxworks code can now get and set from any SNMP agent on the network.
I have now implemented an embedded web site for my client, with pages in JavaScript, which can read and write data at any SNMP data object on the network, controlled by the user web page.

Resources