Change the source address in socket

Hi all,
I need some help here. I need to write a program to forward the UDP message received to another machine.
The requirement form my boss is that the source ip field must remain the same as when I receive it. However, when I forward the message, the socket will automatically change the source to my machine's address.
How can I do this? any idea?
Actually, I am not even sure this can work. A fake source ip address at the IP layer. will this work?
Please advices. thanks
Alan

Have you resolved your problem with change the source address in socket yet ???

Similar Messages

  • How to change the source ip address

    hi all,
    i got the problem that how to change the source ip address when i
    get a website's page!
    i mean i want to change the source ip address when i access the
    remote website, sure i know when change the source ip, i can not get
    the result correctly when changing the source ip address, but it is not
    important to get the result i just want to send out a "click" event to the website by calling a post method in the site!
    does anybody have some ideas?
    Best Regards,
    Eric Gau

    Here's some code that connects to google and does a get:
    import java.io.*;
    import java.net.*;
    public class HTTPTest {
        private Socket sock;
        private BufferedReader in;
        private BufferedWriter out;
        private boolean running = false;
        HTTPTest() {
        private void go(String site) {
            try {
                sock = new Socket(site, 80);
                in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
                System.out.println("Connected");
                out.write("GET / HTTP/1.1\r\n\r\n");
                out.flush();
                doRead();
            } catch (IOException e) {
                e.printStackTrace();
        private void doRead() {
            running = true;
            String line;
            System.out.println("Read started");
            while (running) {
                try {
                    line = in.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                    line = null;
                if (line == null) {
                    running = false;
                } else {
                    System.out.println(line);
            System.out.println("Socket closed");
        public static void main(String [] args) {
            String site;
            if (args.length > 0) {
                site = args[0];
            } else {
                site = "google.ca";
            new HTTPTest().go(site);
    }

  • FM to change the customer address

    Hi Guys,
                 I am looking for FM to change the customer address.
    I found SD_CUSTOMER_MAINTAIN_ALL from here.. but the guys says its dumping..
    Can I get some source code with the FM.
    Thanks
    Senthil

    Use this.
    Data:gt_kna1   LIKE kna1  OCCURS 1000 WITH HEADER LINE,
           gt_bapiaddr1 LIKE bapiaddr1 OCCURS 1000 WITH HEADER LINE,
           gt_bapiaddr2 LIKE bapiaddr2 OCCURS 1000 WITH HEADER LINE.
    LOOP AT gt_kna1.
            CLEAR: gt_bapiaddr1, gt_bapiaddr2.
            READ TABLE gt_bapiaddr1 WITH KEY addr_no = gt_kna1-adrnr.
            IF sy-subrc NE 0.
              READ TABLE gt_bapiaddr2 WITH KEY addr_no = gt_kna1-adrnr.
            ENDIF.
            CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
              EXPORTING
                i_kna1                     = gt_kna1
                i_bapiaddr1                = gt_bapiaddr1
                i_bapiaddr2                = gt_bapiaddr2
                i_maintain_address_by_kna1 = 'X'
                pi_postflag                = 'X'
              EXCEPTIONS
                client_error               = 1
                kna1_incomplete            = 2
                knb1_incomplete            = 3
                knb5_incomplete            = 4
                knvv_incomplete            = 5
                kunnr_not_unique           = 6
                sales_area_not_unique      = 7
                sales_area_not_valid       = 8
                insert_update_conflict     = 9
                number_assignment_error    = 10
                number_not_in_range        = 11
                number_range_not_extern    = 12
                number_range_not_intern    = 13
                account_group_not_valid    = 14
                parnr_invalid              = 15
                bank_address_invalid       = 16
                tax_data_not_valid         = 17
                no_authority               = 18
                company_code_not_unique    = 19
                dunning_data_not_valid     = 20
                knb1_reference_invalid     = 21
                cam_error                  = 22
                OTHERS                     = 23.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
          ENDLOOP.

  • How do we change the source connection in OWB?

    Hello,
    Currently my source connection has read/write privileges. For security reason, i created read only schema in the source database.
    Now i want to change my username in the source mapping.
    I go to connection Explorer,
    click Location
    click database
    Click oracle
    right click on source name(existing one), click open editor.
    When i click open editor, I see all the user info are grayed out. I could not change anything.
    How do i change the current source connection username?
    Any help is appreciated..

    Hello, I have trouble changing the source connection.
    My source connection name is same as before. Only DB name, schema name is changing now for source connection. Here are the steps i have done.
    1. Went to control center manager and unregister the source mapping.
    2. Went to Connection explorer and right click on source connection and click the open editor. change the username, password, ip address, DB name.
    3. went to control center manager and re-deploy the mapping. It is not working... It says, table or view does not exists.
    Is ther any other place i need to change... Somewhere i am missing..
    Any help is highly appreciated..
    Edited by: Shrinika on Oct 21, 2010 9:52 AM

  • How to change the hardware address (MAC) of my printer to match my mac

    how to change the hardware address (MAC) of my printer to match my mac

    Hello @giomarcondes ,
    Welcome to the HP Support Forums!
    I understand that you wish to alter the MAC address on your HP Deskjet Ink Advantage 3525 e-All-in-One Printer to match the MAC address of your Mac OS X computer. Unfortunately, what you're requesting is not supported. Just to clarify, "a media access control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment". They are programmed into the device and are not designed to be changed. (Source: MAC address)
    Are you experiencing issues configuring your HP Deskjet on your wireless network to communicate with your Mac computer?
    If you do actually require support configuring the wifi connection on your printer I would be more than happy to assist you with this. I look forward to hearing from you!
    X-23
    I work on behalf of HP
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    Click the "Kudos, Thumbs Up" on the right to say "Thanks" for helping!

  • Client's IP address changed. How do I change the ip address on my computer?

    I only have one client, the computer my sons use in another state.  Everything worked fine until they moved.  Now they have a new IP address.  When I select the client from ALL COMPUTERS, a dialog box opens labeled ATTRIBUTES with an option to EDIT.  However, when I change the IP address and the DNS, only the DNS info stays in the dialog box if opened again.  Neither the IP address or the DNS info is reflected in the client's entry in ALL COMPUTERS.  The status remains OFFLINE even when phone contact with the client verifies the computer is on and connected to the Internet using the same IP address.  Alternatively, I used the Scanner.  Remote Access finds the IP address plus the ISP web address, but attempts to connect fail. I suspect there is a way for me to properly change the IP for the client since all other info is the same.  I searched the user manual and info online but can not find any info that specifically address the above situation.  Both computers are Macbooks.

    yes you can just watch this video and i show you how during the video
    http://www.youtube.com/watch?v=Ph8Cj3Jetac

  • How do I change the IP address of my PC connected to a EA3500 router ?

    I have a PC with Windows 7 connected wirelessly to a EA3500 router. How do I change the IP address on my PC ?

    What type of ip address were you talking about? Is it the private ip address that the computer gets from a DHCP server/router or the public ip address that the computer gets from your ISP? If you were talking about the private ip address (e.g. 192.168.1.1) then you can easily assign a static ip address to your computer itself. If you were talking about the public ip address then you don’t need to worry of changing the ip address it’s because the ip address will change from time to time.

  • Changing the source system in QA

    Hello All,
    I just wanted a quick opinion from your experience on the following issue:
    We  have a ECC Dev client 20 connected to BI Dev client 20
    Similarly we have ECC QA 120 connected to BI QA 120
    But due to some reason we now want to connect a new ECC QA client 150 to BI QA 120 and take out ECC QA 120 totally(120 is wiped off).
    I already have a lot of development transported to BI QA where the source system is ECC 120. Now if 120 dies and we pull the data from 150, what are the pitfalls to watch for?
    Like all my Master data objects , DSO and Cubes still point to ECC QA client 120 but now the "actual" source system is going to be ECC QA 150.
    Points,
    Gaurav

    You need to replicate all the data sources in BI from QA 150 and change the source system assignment to 150 instead of 120.
    Also, you need to reinitilase delta for delta enabled extractors.
    Two  things to watch out:
    1.  If you dont have source system identifier,  then if you happen to get records with same key, then it will overwrite. This applies to both master and transaction data.
    2. For transaction data that is not delta enables, there may be a possibiltiy with which the records will get duplicated. So, better to delete the old requests before reload the data from QA150.
    Ravi Thothadri

  • I need to change the MAC Address for Airport on MacBook

    I have a specific need to change my son's Airport MAC address as his school requires the use of USB network cards that aren't compatible with MACs. These cards are needed because the school's router uses MAC address filtering.
    Before we upgraded his Mac to Snow Leopard, we were able to change the MAC address to the MAC address of the useless dongal the school supplied. We basically created an AppleScript program that ran the "sudo ifconfig en1 ether xx:xx:xx:xx:xx:xx" and all was good.
    This command no longer works for changing the MAC address. We tried it as root user as well and by typing it into the terminal window as root. After running the command, we can run "ifconfig en1" and it does display the new mac address but when we turn the airport on and try to connect, it just hangs and won't connect.
    Our other non-Snow Leopard still works fine after running the commands so I'm guessing Apple disabled this functionality. It's hardly a security issue by being able to change your mac addres.
    Is there a new way to accomplish this? I've searched everywhere.
    Thanks!

    Would an easier solution be to provide the school's IT admin with your mac address and have it added? If they can add a block of mac addresses for the usb dongles, they can add more for machines that cannot use the dongle.
    Also: "It's hardly a security issue by being able to change your mac address."
    While it may not be a security issue for your machine, it is a security for the school network who is using mac address filtering as hopefully only one part of their wireless security.
    That being said, have you read this?
    http://osxdaily.com/2008/01/17/how-to-spoof-your-mac-address-in-mac-os-x/

  • How can I change the source file so it is direct from external hard drive?

    I am trying to make a movie on imovie of a snowboarding trip that I went on, there is around 80 to 100 gig of mp4 movies that will not fit on my computer that I have stored on my external harddrive. I had the movie half finished then found I could do no more as I had no space left in my mac. I had to delete everything and start again but I'm not doing this until I can find a way of changing the source file so I can take them direct from my external hard drive as to not use up all my computers available space. I have moved imovie to my external hard drive but it still tries to read from a movie file on my mac, how can I change that so it will read from a source file on my external hard drive, is it possible?? Can someone help me??

    Hi Bengt, Thanks for your input, much appreciated.
    I have a WD 1TIG hard drive and are using usb connection, is it possible to use fire wire with these? I have had trouble with a lot of the videos I Imported, once they downloaded the file in the viewer window showed up blank and when I mouse over them it places a picture of another file in the window and wont drag and drop into the movie window, like their corrupted or something? Had to delete just about all of them and start again. Also is it possible to select a bunch of videos in the viewer window as to change the dates to the correct dates? All I have been able to do is "select all" which is no help.

  • I am trying to change the email address associated with my existing account to free up my university email address for use in obtaining Creative Cloud.

    I am trying to change the email address associated with my existing account to free up my university email address for use in obtaining Creative Cloud.  Every time I go to the account settings of my existing account (which currently uses my university email, as I set it up years ago and had no idea it'd eventually cause problems), I enter a different email to use for that account but I continuously receive an error message saying "account changes cannot be saved."  It makes me think that it's because the email isn't verified (funny, it actually is verified since it has been the alternate email on the old account for years), but when I click the "send verification email" nothing happens (that is, no email is sent to that other email address).
    Anyway, my university is now requiring that faculty create new accounts using our university email addresses in order to register/use Creative Cloud.  Am I able to delete my old account, or can anyone help me actually change the email address associated with my old account without getting a "changes can't be saved" error?

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    or
    Make sure that EVERY DETAIL is the same in every place you enter your information
    -right down to how you spell and punctuate the parts of your name and address
    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -Credit card https://helpx.adobe.com/utilities/credit-card.html
    -email address https://forums.adobe.com/thread/1446019
    -http://helpx.adobe.com/x-productkb/global/didn-t-receive-expected-email.html

  • HT5312 How do you change the email address used to send security answers?

    How do you change the email used to send the security answers you have forgotten? I have changed the alternative email adress in Name, ID and Email Addresses but this does not change the email address in the Password and Security section.

    Jus what do you want to accomplish? The Apple ID email address is used for variosu thing onthe iPod like:
    - For purchasing media. Srrings.iTunes and App stores. Sing out and sign into anoterh account
    - Settings>iCLoudl for iCloud account
    - Settings>FaceRome for Apple ID and where You can Be Reached At email address
    - Settings>Messages for Send And Receive email address.
    - Maybe for Game Center

  • How do i change the email address for my icloud account on my 4s. when i sign in on line it is my new email address so i thought it would change automatically but obviously not!

    how do i change the email address for my icloud account on my 4s. when i sign in on line it is my new email address so i thought it would change automatically but obviously not!

    Settings>iCloud...scroll down...delete account. Then setup iCloud with your new ID.
    You can't change the Apple ID for your iCloud account, you have to delete it.

  • When I am NOT private browsing Firefox will not allow me to delete or change the website address in the location bar. My only remedy is to open a new window and search in google then click the link to that site through google. How can I resolve this?

    Question
    When I am NOT private browsing Firefox will not allow me to delete or change the website address in the location bar. My only remedy is to open a new window and search in google then click the link to that site through google. When I swap to private browsing firefox allows me to anter the website address directly into the location bar - but this is a slow [prcess to swap back and forth - also by dint of using private browsing I loose my website information.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How/can I change the "from" address in Mail?

    I just upgraded to Mountain Lion, and have come across a problem.
    I use iCloud for my mail account, but I want to change the "from" address - so the return address on my messages is NOT icloud.
    I could do this in Lion.
    In the mail account settings, there's an option that says "alias" and it lists (me)@mac.com, (me)@me.com and (me)@icloud.com, and then "custom" is an option.
    Great!
    So I choose Custom, and then I can type in the "from" address that I want.
    However, when I go to save those changes, it tells me the SMTP server can't be left blank.
    What?
    It's not blank! I didn't touch it. The icloud server is still there!
    Furthermore, it's greyed out, so even if it WERE blank, it's not like I can edit it!
    Once this happens, the only fix is to delete the whole account from mail, and to disable mail in the icloud control panel, then re-add it.
    Has anyone figured out to work around this?

    Apple's outgoing mail server - just like 99.9% of all other SMTP servers, does not allow "relaying", meaning you use a domain in the 'sent from' address that is different from a domain hosted by the server. The simple reason is to make it harder for any spammer - not assuming you are one - to abuse the server. While bandwidth, server capacity and server load are some issues, the main fear for ISPs is to get blacklisted, and consequently mails from such server being refused by all others.
    It's a general rule, and while exceptions might be technically possible, it would be a manual act which at a certain rate would become unmanageable.
    If you want, read about the antonym, open mail relay servers, here.
    You see, it's actually good behavior and absolutely in your interest to prevent you from using a "non-in-house" 'sent from' address.

Maybe you are looking for