Hi, I have a web application for camera for which i change the IP address of camera in web application. When i change the IP address and when i re run the application i want Kernel IP to be same as configured in application level. Is it possible.
On Oct 28, 6:13 pm, kracks <kirthikai...@gmail.com> wrote:
> Hi, > I have a web application for camera for which i change the IP address > of camera in web application.
What does "IP address of camera" mean? Is the camera a network- connected device with its own IP address or not?
> When i change the IP address and when i re run the application i want > Kernel IP to be same as configured in application level.
What do you mean by "kernel IP"? It's not clear what you're asking at all.
> Is it possible.
> What are the ways i can do?
You haven't explained things clearly. By "camera", do you mean the computer? Or a separate camera with its own IP address? If you are changing the IP address of some other device, why do you need to change anything in the kernel?
Is your question just a convoluted version of "how can I change my computer's IP address from my program"? If so, the depends on whether you mean to change it just for now or to change it forever on. If you just want to change it for now, just call 'ipconfig', 'route', and/or 'ip' with the appropriate parameters or look at the source code to these programs and replicate their functionality.
If you want to change the system's configured IP address, the process is platform-specific. Under Fedora, for example, you can change the configuration in /etc/sysconfig/network-scripts and then 'ifdown' and then 'ifup' to make the configuration change or use restart the network (either the 'NetworkManager' or the 'network' service, depending).
If this is for something appliance-like, you can make your own configuration that holds the IP address, gateway, netmask, DNS servers, and so on. Then just change the configuration files your own network startup logic uses. Then either restart your network logic or reboot your appliance.
David Schwartz <dav...@webmaster.com> writes: > On Oct 28, 6:13 pm, kracks <kirthikai...@gmail.com> wrote:
[...]
>> When i change the IP address and when i re run the application i want >> Kernel IP to be same as configured in application level.
[...]
> Is your question just a convoluted version of "how can I change my > computer's IP address from my program"? If so, the depends on whether > you mean to change it just for now or to change it forever on. If you > just want to change it for now, just call 'ipconfig', 'route', and/or > 'ip' with the appropriate parameters or look at the source code to > these programs and replicate their functionality.
The short answer is 'use the SIOCSIFADDR-ioctl on a suitable socket, passing a struct ifreq * as argument whose ifr_addr member contains the binary representation of a the socket address you want to configure' (interface selected by name, same struct).
> On Oct 28, 6:13 pm, kracks <kirthikai...@gmail.com> wrote:
> > Hi, > > I have a web application for camera for which i change the IP address > > of camera in web application.
> What does "IP address of camera" mean? Is the camera a network- > connected device with its own IP address or not?
> > When i change the IP address and when i re run the application i want > > Kernel IP to be same as configured in application level.
> What do you mean by "kernel IP"? It's not clear what you're asking at > all.
> > Is it possible.
> > What are the ways i can do?
> You haven't explained things clearly. By "camera", do you mean the > computer? Or a separate camera with its own IP address? If you are > changing the IP address of some other device, why do you need to > change anything in the kernel?
> Is your question just a convoluted version of "how can I change my > computer's IP address from my program"? If so, the depends on whether > you mean to change it just for now or to change it forever on. If you > just want to change it for now, just call 'ipconfig', 'route', and/or > 'ip' with the appropriate parameters or look at the source code to > these programs and replicate their functionality.
> If you want to change the system's configured IP address, the process > is platform-specific. Under Fedora, for example, you can change the > configuration in /etc/sysconfig/network-scripts and then 'ifdown' and > then 'ifup' to make the configuration change or use restart the > network (either the 'NetworkManager' or the 'network' service, > depending).
> If this is for something appliance-like, you can make your own > configuration that holds the IP address, gateway, netmask, DNS > servers, and so on. Then just change the configuration files your own > network startup logic uses. Then either restart your network logic or > reboot your appliance.
> We need a lot more details to help you.
> DS
Sorry.I understand that i didnt post properly.
We are developing our own network camera(IP).
I have a separate web application only for network(IP) camera configuration. I can change the configuration like IP address,Subnetmask,gateway etc of network camera from web application.
Whenever camera user change the network setting in webpage i am saving the change in configuration in a file.
(1)in the bootcode of IP camera i set one IP address.First time IP Camera boots with that IP address
(ii)When the user changes the IP address of camera in webapplication i have to update the same IP address to the camera system having Embedded Linux OS. (iii)So when the IP camera boots for the next time it has to boot with the recent IP address set by the user. (iv)How can i make the network module to pick the updated IP Address.
ifup and ifdown are all in the application framework.
On Oct 29, 5:20 am, kracks <kirthikai...@gmail.com> wrote:
> (ii)When the user changes the IP address of camera in webapplication i > have to update the same IP address to the camera system having > Embedded Linux OS. > (iii)So when the IP camera boots for the next time it has to boot with > the recent IP address set by the user. > (iv)How can i make the network module to pick the updated IP Address.
> ifup and ifdown are all in the application framework.
> Suggest me the way
Are you designing the camera or working with an existing camera? If you're working with an existing camera, you have to do it however the manufacturer says to do it. If you're designing a new camera, I would just have a command that changes the saved IP address and send that command.
When you say "the network module", do you mean in the camera or in the server?