OS X 위에서 libnet 사용해서.. linspot 컴파일..

jenix의 이미지

안녕하세요.

os x 를 사용하게 되어.. 무선랜을 사용해보고자 네스팟 접속기 프로젝트인

linspot 프로그램을 오에스 텐에서 컴파일 해보고자 했습니다.

우선, libpcap 은 기본으로 설치가 되어있어서 넘어갔구요

libnet 을 1.1 을 받아서 설치하였는데..

설치도 잘 되었습니다.

/usr/lib 디렉토리에 libnet.a 부터 libnet* 들 다 생성되고..
/usr/include 디렉토리에 libnet.h , libnet/libnet-*.h 파일들도 잘 설치되었구요.

막상 linspot 소스디렉토리에서 make 를 행하게 되면

gcc -DLIBNET_BIG_ENDIAN nespot.c md5c.o -o nespot -lnet -lpcap
nespot.c: In function `main':
nespot.c:161: error: structure has no member named `octet'
nespot.c:163: error: structure has no member named `octet'
nespot.c:168: error: structure has no member named `octet'
nespot.c: In function `packet_analyze':
nespot.c:475: error: `ETH_ADDR_LEN' undeclared (first use in this function)
nespot.c:475: error: (Each undeclared identifier is reported only once
nespot.c:475: error: for each function it appears in.)
make: *** [nespot] Error 1

위와 같은 에러가 납니다.
( 원래 ETH_ADDR_LEN 은 ETH_ALEN 이었는데 libnet 헤더파일엔 저걸로 되어있길레 바꾸어보았습니다. 허나 역시 :( )

161번째 줄을 보면

    159   /* 802.1x Wireless NIC Ethernet Address print */
    160   for(i=0; i<6; i++) {
    161     fprintf(stdout, "%02X ", e-> ether_addr_octet[i] );

위와 같은데요.. /usr/include/libnet/libnet-headers.h 에 보면

e 로 선언된 libnet_ether_addr 이란 구조체에 대한 선언이 있습니다.

    372 struct libnet_ether_addr
    373 {
    374     u_char  ether_addr_octet[6];        /* Ethernet address */
    375 };

제가 보기엔 전혀 문제될 것이 없는데 octet 란 멤버가 없다니..
무슨소린지 모르겠습니다.
리눅스상에선 잘 컴파일됩니다.
mac os X 에 gcc 3.3 입니다만..
에고..
도움좀 부탁드립니다 :)

소타의 이미지

에.. 이 글에 대한 답은 아니지만요..
맥X.3 (팬서) 에서 기본적으로 네스팟 사용이 가능합니다..
그냥 에어포트 켜지고 NESPOT AP가 잡히면 로긴하라는 창이 나오거나 맥 방식이면 자동으로 설정됩니다..
-.-;; 그럼~

jenix의 이미지

아.. 그런가요? 잘 몰랐네요. 아직 직접 접속해 보진 못해서요~

혹시 저 소스 왜 컴파일 안되는지.. 아시는 분;;

도대체 octet 란 멤버를 왜 찾는지 잘 모르겠군요;

---------------------------------------------------------------------------
http://jinhyung.org -- 방문해 보세요!! Jenix 의 블로그입니다! :D

bw001730의 이미지

소스코드를 보여주셔야죠
헤더 파일에 없는 것을
소스코드에서 사용했다는 것 같은 메시지인데요

jenix의 이미지

???

161 번째 줄 ether_addr_octet[i] 부분은

libnet/libnet-headers.h 에 libnet_ether_addr 구조체로 선언이 되어있구요.

소스헤더는 #include <libnet.h> 로

libnet.h 안에 ./libnet/libnet-headers.h 로 인클루드 되어있습니다. ( 위에 다 인용을;; 했는데요;; )

475는 선언안되어서 그랬을수 있다고쳐도 ( 이상합니다. vi 로 관련 헤더파일 / 소스 다뒤지면서 검색해봐도 안나오는데 :( 대체 어디에 숨은건지 @.@ )
(더 이상한건 저 소스 전체는 리눅스에선 에러없이 컴파일이 됩니다만;;)

아무튼.. 그럼 475줄은 넘어가고.. 161번 줄에 관련된 에러는 왜 나는건지 모르겠습니다 :(

단순히 e 스트럭처의 ( e 는 struct libnet_ether_addr 구조체 입니다. ) ether_addr_octet 를 접근하는 내용인데 .
ethere_addr_octet 전체가 없다는것도 아니고
octet 만 없다고 에러를 출력하니.. @.@;;

에고... ;;;

---------------------------------------------------------------------------
http://jinhyung.org -- 방문해 보세요!! Jenix 의 블로그입니다! :D

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.