Microsoft MVP성태의 닷넷 이야기
.NET : 35. UDP 패킷의 경유 IP 설정 (Source Routing) [링크 복사], [링크+제목 복사]
조회: 10687
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

How to programmatically inject a list of IP Addresses into the IP Options header in the IP Datagram [ Source Routing ]?
; http://blogs.msdn.com/winsdk/archive/2009/11/05/how-to-programmatically-inject-a-list-of-ip-addresses-into-the-ip-options-header-in-the-ip-datagram-source-routing.aspx

UDP 에 이런 기능이 있는지 몰랐군요. ^^;

IPPROTO_IP, IP_OPTIONS 인자로 setsockopt 를 하는 경우 같이 넘겨준 IP 를 경유해서 최종 목적지로 패킷이 전달되게 됩니다. 읽고 보니, 궁금해지는 데요. 그렇다면 경유하는 IP의 NIC 카드 레벨에서 라우팅을 해주는 것인가요? 오호... 외부망에서 UDP 를 내부망으로 보낼 수 있다는 의미인데... 테스트 한번 해봐야겠군요. ^^

코드가 간단하니 여기에 옮겨 봅니다.

1: \\Define a structure for LSR
2: typedef struct
3: {
4: unsigned char Code;
5: unsigned char Len;
6: unsigned char Offset;
7: unsigned long Addrs[2];
8: }LSR;
9:
10: //Set the Loose Source Routing Option:
11: LSR SourceRoute;
12: ZeroMemory(&SourceRoute,sizeof(LSR));
13:
14: SourceRoute.Code = 0x83; // Loose Source Routing.
15: SourceRoute.Len = 11;
16: SourceRoute.Offset = 4;
17: SourceRoute.Addrs [0] = inet_addr("a.b.c.d");
18: SourceRoute.Addrs [1] = inet_addr("x.y.z.q");
19:
20: //Set the source routing on the socket handle.
21: int iErr = setsockopt(SocketHandle,IPPROTO_IP,IP_OPTIONS,(char*)&SourceRoute,SourceRoute.oLen);








[최초 등록일: ]
[최종 수정일: 11/10/2009]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-동일조건변경허락 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.

비밀번호

댓글 작성자
 




1  2  3  4  5  6  [7]  8 
NoWriterDateCnt.TitleFile(s)
43정성태7/17/20035755탐색기 Namespace Extension 컨테이너 (VC 6.0, ATL) 2002.03.24파일 다운로드1
42정성태7/17/20034277KBManager WebBand (VC 6.0, ATL/Script) 2001.10.01파일 다운로드1
41정성태7/17/20034346UrlMonDownload (VC 6.0, ATL) 2001.06.16파일 다운로드1
40정성태7/17/20034295IE 북마크 임포트 (VC 6.0, ATL, MFC 지원) 2001.01.20파일 다운로드1
39정성태7/17/20034865MsIE.exe (VC 6.0, ATL, HTML Parser 로서의 IHTMLDocument2 이용 및 IE 보안설정) 2000.11.23파일 다운로드1
38정성태7/17/20034573EnumIE.exe (VC 6.0, ATL, 현재 사용 중인 IE에 접속) 2000.10.24파일 다운로드1
37정성태7/17/20034318ReuseIE.exe (VC ++ 6,0, Internet Explorer 재사용) 2000.04.17파일 다운로드1
36정성태7/17/20033927RemoteViewer dll (VC ++ 6.0, ATL) 2000.03.13파일 다운로드1
35정성태7/17/20034230IESpy dll (VC ++ 6.0, ATL) 2000.02.28파일 다운로드1
34정성태7/17/20033965Bmp2Gif 콘트롤 (VC ++ 6.0, MFC) 2000.02.28파일 다운로드1
33정성태7/17/20033782Gif89a 콘트롤 (VC ++ 6.0, ATL) 2000.02.28파일 다운로드1
32정성태7/17/20034289이미지 4버튼 (VC ++ 6.0, ATL) 2000.02.28파일 다운로드1
31정성태7/17/20033909이미지 홀더 (VC ++ 6.0, ATL) 2000.02.28파일 다운로드1
30정성태7/17/20034036이미지 뷰어 (VC ++ 6.0, ATL) 2000.02.28파일 다운로드1
29정성태7/17/20033815ChatClient (VC ++ 6.0, MFC) 1999.09.09파일 다운로드1
28정성태7/17/20035217Winsock2 SPI : LSP 예제 (VC ++ 6.0) 2001.08.07파일 다운로드1
27정성태7/17/20034323Echo Services Server (VC ++ 6.0, ATL Service) 2001.01.07파일 다운로드1
26정성태7/17/20037349FTP Client (VC ++ 6.0, MFC) 1999.09.14파일 다운로드1
25정성태7/17/20033717모뎀 정보를 알아내는 클래스 (VC ++ 6.0, MFC) 1999.09.12파일 다운로드1
24정성태7/17/20038445Ping (VC ++ 6.0, MFC, CSocket Class) 1999.09.09 [1]파일 다운로드1
23정성태7/21/20037407ChatServer / ChatClient (VC ++ 6.0, MFC, Win32 API Socket) 1999.08.01파일 다운로드2
22정성태7/17/20033877성능 객체 카운터 (VC 6.0, Win32) 2001.07.07파일 다운로드1
21정성태7/17/20033904StringSplit 클래스 (VC++6.0, Win32) 2000.02.28파일 다운로드1
20정성태7/17/20034169SQLDirect 클래스 (VC++6.0, Win32) 2000.02.28파일 다운로드1
19정성태7/17/20033570ImeControl 클래스 (VC++6.0, Win32) 2000.02.28파일 다운로드1
18정성태7/17/20033998RegistryEx 클래스 (VC++6.0, Win32) 2000.02.28파일 다운로드1
1  2  3  4  5  6  [7]  8