libnet 라이브러리 함수 요약
본 자료는 2페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
해당 자료는 2페이지 까지만 미리보기를 제공합니다.
2페이지 이후부터 다운로드 후 확인할 수 있습니다.

목차

Packet memory management routines 2

libnet_init_packet() 2

libnet_destroy_packet() 2

Address resolution routines 3

libnet_get_ipaddr() 3

libnet_get_hwaddr() 3

Packet injection framework routines 3

libnet_open_raw_sock() 3

libnet_close_raw_sock() 4

libnet_write_ip() 4

libnet_do_checksum () 4

Packet builder routines 5

libnet_build_ip() 5

libnet_build_tcp() 5

libnet_build_udp() 6

libnet_insert_ipo() 6

libnet_insert_tcpo() 6

Headers 6

libnet_ip_hdr 6

libnet_tcp_hdr 7

libnet_udp_hdr 7

본문내용

Packet memory management routines
int libnet_init_packet(size_t p_size, u_char **buf)
description
패킷을 사용 가능한 상태로 초기화합니다. 패킷 크기의 입력이 잘못 되었을 경우(쓰레기 값이나 음수) 알아서 적당한 값(기본으로 LIBNET_MAX_PACKET을 설정)으로 변경해줍니다. 이 함수에서 malloc를 호출한 이후로 반드시 어디선가에서는 destory_packet()을 호출해야 합니다.
return value
메모리 할당이 성공하면 할당 공간을 0으로 초기화 시키고 1을 리턴합니다. 에러가 발생하면 -1을 리턴합니다.
argument
size_t p_size: 패킷의 크기
u_char **buf: 패킷을 가리킬 포인터 변수
void libnet_destroy_packet(u_char **buf)
description
이 함수는 init_packet로부터 생성된 패킷을 free()로 buf가 참조하는 패킷을 없애주는 함수입니다. 이것은 heap 메모리를 풀어주고 buf의 참조는 NULL로 바꿔줍니다.
return value
없습니다.
argument
u_char **buf: 지울 패킷의 포인터
Address resolution routines
u_long libnet_get_ipaddr(struct libnet_link_int *l,
const u_char *device,
const u_char *buf)
description
네트워크 장치의 이름을 가리키는 링크 레이어 인터페이스의 구조체 포인터를 받아 IP 주소를 반환해 줍니다.
return value
성공시 요청한 IP 주소를 주고 실패시 -1을 리턴합니다.
argument
struct libnet_link_int *l: 링크 인터페이 구조체의 포인터
const u_char *device: 장치의 포인터
const u_char *buf: 발생할 수 있는 에러 메시지를 담을 버퍼의 포인터
struct ether_addr *libnet_get_hwaddr(struct libnet_link_int *l,
const u_char *device,
const u_char *buf)
description
네트워크 장치의 이름을 가리키는 링크 레이어 인터페이스의 구조체 포인터를 받아 이더넷 주소를 반환해 줍니다.
return value
성공시 이더넷 주소의 포인터를 주고 실패시 NULL을 리턴합니다.
argument
struct libnet_link_int *i: 링크 인터페이스 구조체의 포인터
const u_char *device: 장치의 포인터

키워드

  • 가격2,000
  • 페이지수8페이지
  • 등록일2009.05.10
  • 저작시기2008.11
  • 파일형식워드(doc)
  • 자료번호#534365
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니