##libpcap for Android
###Android.mk
LOCAL_PATH := ./jni
include $(CLEAR_VARS)
LOCAL_MODULE := pcaptest
LOCAL_SRC_FILES := libpcap-native.c
#!/usr/bin/perl -w | |
use strict; | |
# Copyright 2008, Andrew Ross andy@plausible.org | |
# Distributable under the terms of the GNU GPL, see COPYING for details | |
# The Android toolchain is ... rough. Rather than try to manage the | |
# complexity directly, this script wraps the tools into an "agcc" that | |
# works a lot like a gcc command line does for a native platform or a | |
# properly integrated cross-compiler. It accepts arbitrary arguments, |
import sys | |
import concurrent.futures | |
import random | |
import time | |
import math | |
from Queue import Queue | |
MAX_PROCESSES = 4 | |
MAX_THREADS = 5 |
Daily Habit | Environmental Factors | Did it work? | |
---|---|---|---|
Reduce Sugar intake | No sweets/sugar at home | Easy - Yes | |
Daily home cooked meals | Fully stocked fridge with an inventory whiteboard | Medium - Yes | |
Brushing teeth for atleast 120 seconds | NO SOLUTION | Nope | |
Daily Push Ups | Push Up bars in living room | Easy - Yes | |
Reduce Social Media Time | Delete Instagram from phone & Separate Android tablet for Instagram | Easy - Yes | |
Weekly Coursera course | Separate Android Tablet for Coursera | Hard - No | |
15 books in 2021 | Always carry kindly | Easy - Yes | |
Wake up at same time everyday | Alexa alarm set for 7am everyday | Hard - Kinda | |
Run twice a week | Fitbit tracking and good shoes | Medium - Yes |
struct pseudo_hdr { | |
u_int32_t src; //src ip | |
u_int32_t dst; //dst ip | |
u_char mbz; //all 0 reserved bits | |
u_char proto; //protocol field | |
u_int16_t len; //tcp length | |
}; | |
//TCP Header |
apps.facebook.com | |
connect.facebook.net | |
facebook.com | |
fbcdn.com | |
fbsbx.com | |
fbcdn.net | |
graph.facebook.com | |
login.facebook.com | |
s-static.ak.facebook.com | |
static.ak.connect.facebook.com |
##libpcap for Android
###Android.mk
LOCAL_PATH := ./jni
include $(CLEAR_VARS)
LOCAL_MODULE := pcaptest
LOCAL_SRC_FILES := libpcap-native.c
private function get_callstack($delim="\n") { | |
$dt = debug_backtrace(); | |
$cs = ''; | |
foreach ($dt as $t) { | |
$cs .= $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()" . $delim; | |
} | |
return $cs; | |
} |
$ libtoolize --force | |
$ aclocal | |
$ autoheader | |
$ automake --force-missing --add-missing | |
$ autoconf |
54a55,65 | |
> enum logevent { | |
> logConnecting, | |
> logLogged, | |
> logSearchFinished, | |
> logPasswordChanged, | |
> logDisconnected, | |
> logContactAdd, | |
> logContactRemove, | |
> logConfMembers |
gcc-4.2 -O2 -ggdb3 -DNDEBUG -Wall -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fno-stack-protector -march=core2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c -MD -o heap.o heap.c | |
In file included from heap.c:6: | |
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’ | |
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’ | |
intern.h:231: error: expected declaration specifiers or ‘...’ before ‘fd_set’ | |
intern.h:492: warning: parameter names (without types) in function declaration | |
In file included from ruby.h:702, | |
from heap.c:8: | |
intern.h:231: error: conflicting types for ‘rb_thread_select’ | |
intern.h:231: error: previous declaration of ‘rb_thread_select’ was here |